}
static inline struct brw_address
-render_bo(struct brw_bo *bo, uint32_t offset)
+rw_bo(struct brw_bo *bo, uint32_t offset)
{
return (struct brw_address) {
.bo = bo,
}
static inline struct brw_address
-render_ro_bo(struct brw_bo *bo, uint32_t offset)
+ro_bo(struct brw_bo *bo, uint32_t offset)
{
return (struct brw_address) {
.bo = bo,
}
static inline struct brw_address
-instruction_bo(struct brw_bo *bo, uint32_t offset)
+ggtt_bo(struct brw_bo *bo, uint32_t offset)
{
return (struct brw_address) {
.bo = bo,
};
}
-static inline struct brw_address
-instruction_ro_bo(struct brw_bo *bo, uint32_t offset)
-{
- return (struct brw_address) {
- .bo = bo,
- .offset = offset,
- };
-}
-
-static inline struct brw_address
-vertex_bo(struct brw_bo *bo, uint32_t offset)
-{
- return (struct brw_address) {
- .bo = bo,
- .offset = offset,
- };
-}
-
#if GEN_GEN == 4
static inline struct brw_address
KSP(struct brw_context *brw, uint32_t offset)
{
- return instruction_ro_bo(brw->cache.bo, offset);
+ return ro_bo(brw->cache.bo, offset);
}
#else
static inline uint32_t
struct GENX(VERTEX_BUFFER_STATE) buf_state = {
.VertexBufferIndex = buffer_nr,
.BufferPitch = stride,
- .BufferStartingAddress = vertex_bo(bo, start_offset),
+ .BufferStartingAddress = ro_bo(bo, start_offset),
#if GEN_GEN >= 8
.BufferSize = end_offset - start_offset,
#endif
.BufferAccessType = step_rate ? INSTANCEDATA : VERTEXDATA,
.InstanceDataStepRate = step_rate,
#if GEN_GEN >= 5
- .EndAddress = vertex_bo(bo, end_offset - 1),
+ .EndAddress = ro_bo(bo, end_offset - 1),
#endif
#endif
ib.CutIndexEnable = brw->prim_restart.enable_cut_index;
#endif
ib.IndexFormat = brw_get_index_type(index_buffer->index_size);
- ib.BufferStartingAddress = vertex_bo(brw->ib.bo, 0);
+ ib.BufferStartingAddress = ro_bo(brw->ib.bo, 0);
#if GEN_GEN >= 8
ib.IndexBufferMOCS = GEN_GEN >= 9 ? SKL_MOCS_WB : BDW_MOCS_WB;
ib.BufferSize = brw->ib.size;
#else
- ib.BufferEndingAddress = vertex_bo(brw->ib.bo, brw->ib.size - 1);
+ ib.BufferEndingAddress = ro_bo(brw->ib.bo, brw->ib.size - 1);
#endif
}
}
clip.GuardbandClipTestEnable = true;
clip.ClipperViewportStatePointer =
- instruction_ro_bo(brw->batch.bo, brw->clip.vp_offset);
+ ro_bo(brw->batch.bo, brw->clip.vp_offset);
clip.ScreenSpaceViewportXMin = -1;
clip.ScreenSpaceViewportXMax = 1;
* something loaded through the GPE (L2 ISC), so it's INSTRUCTION
* domain.
*/
- sf.SetupViewportStateOffset =
- instruction_ro_bo(brw->batch.bo, brw->sf.vp_offset);
+ sf.SetupViewportStateOffset = ro_bo(brw->batch.bo, brw->sf.vp_offset);
sf.PointRasterizationRule = RASTRULE_UPPER_RIGHT;
if (stage_state->sampler_count)
wm.SamplerStatePointer =
- instruction_ro_bo(brw->batch.bo, stage_state->sampler_offset);
+ ro_bo(brw->batch.bo, stage_state->sampler_offset);
#if GEN_GEN == 5
if (wm_prog_data->prog_offset_2)
wm.GRFRegisterCount2 = wm_prog_data->reg_blocks_2;
#endif
if (wm_prog_data->base.total_scratch) {
- wm.ScratchSpaceBasePointer =
- render_bo(stage_state->scratch_bo, 0);
+ wm.ScratchSpaceBasePointer = rw_bo(stage_state->scratch_bo, 0);
wm.PerThreadScratchSpace =
ffs(stage_state->per_thread_scratch) - 11;
}
pkt.FloatingPointMode = stage_prog_data->use_alt_mode; \
\
if (stage_prog_data->total_scratch) { \
- pkt.ScratchSpaceBasePointer = \
- render_bo(stage_state->scratch_bo, 0); \
+ pkt.ScratchSpaceBasePointer = rw_bo(stage_state->scratch_bo, 0); \
pkt.PerThreadScratchSpace = \
ffs(stage_state->per_thread_scratch) - 11; \
} \
vs.StatisticsEnable = false;
vs.SamplerStatePointer =
- instruction_ro_bo(brw->batch.bo, stage_state->sampler_offset);
+ ro_bo(brw->batch.bo, stage_state->sampler_offset);
#endif
#if GEN_GEN == 5
pkt.ConstantBody.ReadLength[n] = range->length;
pkt.ConstantBody.Buffer[n] =
- render_ro_bo(bo, range->start * 32 + binding->Offset);
+ ro_bo(bo, range->start * 32 + binding->Offset);
n--;
}
assert(n >= 0);
pkt.ConstantBody.ReadLength[n] = stage_state->push_const_size;
pkt.ConstantBody.Buffer[n] =
- render_ro_bo(stage_state->push_const_bo,
- stage_state->push_const_offset);
+ ro_bo(stage_state->push_const_bo,
+ stage_state->push_const_offset);
}
#else
pkt.ConstantBody.ReadLength[0] = stage_state->push_const_size;
cc.StatisticsEnable = brw->stats_wm;
- cc.CCViewportStatePointer =
- instruction_ro_bo(brw->batch.bo, brw->cc.vp_offset);
+ cc.CCViewportStatePointer = ro_bo(brw->batch.bo, brw->cc.vp_offset);
#else
/* _NEW_COLOR */
cc.BlendConstantColorRed = ctx->Color.BlendColorUnclamped[0];
brw_batch_emit(brw, GENX(3DSTATE_SO_BUFFER), sob) {
sob.SOBufferIndex = i;
- sob.SurfaceBaseAddress = render_bo(bo, start);
+ sob.SurfaceBaseAddress = rw_bo(bo, start);
#if GEN_GEN < 8
sob.SurfacePitch = linked_xfb_info->Buffers[i].Stride * 4;
- sob.SurfaceEndAddress = render_bo(bo, end);
+ sob.SurfaceEndAddress = rw_bo(bo, end);
#else
sob.SOBufferEnable = true;
sob.StreamOffsetWriteEnable = true;
sob.SurfaceSize = MAX2(xfb_obj->Size[i] / 4, 1) - 1;
sob.StreamOutputBufferOffsetAddress =
- instruction_bo(brw_obj->offset_bo, i * sizeof(uint32_t));
+ ggtt_bo(brw_obj->offset_bo, i * sizeof(uint32_t));
if (brw_obj->zero_offsets) {
/* Zero out the offset and write that to offset_bo */
if (prog_data->base.total_scratch) {
ps.ScratchSpaceBasePointer =
- render_bo(stage_state->scratch_bo,
- ffs(stage_state->per_thread_scratch) - 11);
+ rw_bo(stage_state->scratch_bo,
+ ffs(stage_state->per_thread_scratch) - 11);
}
}
}
bo_offset = stage_state->per_thread_scratch / 1024 - 1;
}
vfe.ScratchSpaceBasePointer =
- render_bo(stage_state->scratch_bo, bo_offset);
+ rw_bo(stage_state->scratch_bo, bo_offset);
}
const uint32_t subslices = MAX2(brw->screen->subslice_total, 1);
uint32_t report_id)
{
brw_batch_emit(brw, GENX(MI_REPORT_PERF_COUNT), mi_rpc) {
- mi_rpc.MemoryAddress = instruction_bo(bo, offset_in_bytes);
+ mi_rpc.MemoryAddress = ggtt_bo(bo, offset_in_bytes);
mi_rpc.ReportID = report_id;
}
}