[igt-dev] [PATCH i-g-t] lib/rendercopy_gen9: Set rw domains to zero for GEN12

Mika Kahola
2019-11-28T09:12:32Z

GEN12 doesn't need read and write domains to be set. Let's set
these to zero in case of GEN12.

Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
lib/rendercopy_gen9.c | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c
index 3189594f..891b7ff1 100644
--- a/lib/rendercopy_gen9.c
+++ b/lib/rendercopy_gen9.c
@@ -194,7 +194,7 @@ gen6_render_flush(struct intel_batchbuffer *batch,
/* Mostly copy+paste from gen6, except height, width, pitch moved */
static uint32_t
gen8_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
- int is_dst) {
+ int is_dst, unsigned gen) {
struct gen9_surface_state *ss;
uint32_t write_domain, read_domain, offset;
int ret;
@@ -210,6 +210,12 @@ gen8_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
read_domain = I915_GEM_DOMAIN_SAMPLER;
}

+ /* domains not needed for GEN12 */
+ if (gen == 12) {
+ write_domain = 0;
+ read_domain = 0;
+ }
+
ss = intel_batchbuffer_subdata_alloc(batch, sizeof(*ss), 64);
offset = intel_batchbuffer_subdata_offset(batch, ss);
annotation_add_state(&aub_annotations, AUB_TRACE_SURFACE_STATE,
@@ -277,7 +283,8 @@ gen8_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
static uint32_t
gen8_bind_surfaces(struct intel_batchbuffer *batch,
const struct igt_buf *src,
- const struct igt_buf *dst)
+ const struct igt_buf *dst,
+ unsigned gen)
{
uint32_t *binding_table, offset;

@@ -286,8 +293,8 @@ gen8_bind_surfaces(struct intel_batchbuffer *batch,
annotation_add_state(&aub_annotations, AUB_TRACE_BINDING_TABLE,
offset, 8);

- binding_table[0] = gen8_bind_buf(batch, dst, 1);
- binding_table[1] = gen8_bind_buf(batch, src, 0);
+ binding_table[0] = gen8_bind_buf(batch, dst, 1, gen);
+ binding_table[1] = gen8_bind_buf(batch, src, 0, gen);

return offset;
}
@@ -1187,7 +1194,8 @@ void _gen9_render_copyfunc(struct intel_batchbuffer *batch,
unsigned dst_y,
drm_intel_bo *aux_pgtable_bo,
const uint32_t ps_kernel[][4],
- uint32_t ps_kernel_size)
+ uint32_t ps_kernel_size,
+ unsigned gen)
{
uint32_t ps_sampler_state, ps_kernel_off, ps_binding_table;
uint32_t scissor_state;
@@ -1204,7 +1212,7 @@ void _gen9_render_copyfunc(struct intel_batchbuffer *batch,

annotation_init(&aub_annotations);

- ps_binding_table = gen8_bind_surfaces(batch, src, dst);
+ ps_binding_table = gen8_bind_surfaces(batch, src, dst, gen);
ps_sampler_state = gen8_create_sampler(batch);
ps_kernel_off = gen8_fill_ps(batch, ps_kernel, ps_kernel_size);
vertex_buffer = gen7_fill_vertex_buffer_data(batch, src,
@@ -1307,8 +1315,8 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,

{
_gen9_render_copyfunc(batch, context, src, src_x, src_y,
- width, height, dst, dst_x, dst_y, NULL,
- ps_kernel_gen9, sizeof(ps_kernel_gen9));
+ width, height, dst, dst_x, dst_y, NULL,
+ ps_kernel_gen9, sizeof(ps_kernel_gen9), 9);
}

void gen11_render_copyfunc(struct intel_batchbuffer *batch,
@@ -1319,8 +1327,8 @@ void gen11_render_copyfunc(struct intel_batchbuffer *batch,

{
_gen9_render_copyfunc(batch, context, src, src_x, src_y,
- width, height, dst, dst_x, dst_y, NULL,
- ps_kernel_gen11, sizeof(ps_kernel_gen11));
+ width, height, dst, dst_x, dst_y, NULL,
+ ps_kernel_gen11, sizeof(ps_kernel_gen11), 11);
}

void gen12_render_copyfunc(struct intel_batchbuffer *batch,
@@ -1335,10 +1343,10 @@ void gen12_render_copyfunc(struct intel_batchbuffer *batch,
gen12_aux_pgtable_init(&pgtable_info, batch->bufmgr, src, dst);

_gen9_render_copyfunc(batch, context, src, src_x, src_y,
- width, height, dst, dst_x, dst_y,
- pgtable_info.pgtable_bo,
- gen12_render_copy,
- sizeof(gen12_render_copy));
+ width, height, dst, dst_x, dst_y,
+ pgtable_info.pgtable_bo,
+ gen12_render_copy,
+ sizeof(gen12_render_copy), 12);

gen12_aux_pgtable_cleanup(&pgtable_info);
}
--
2.17.1