[igt-dev] [PATCH i-g-t 5/7] lib/rendercopy: Add enough surface state for AUX_CCS_E

Ville Syrjala ville.syrjala at linux.intel.com
Wed Jul 4 16:16:44 UTC 2018


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Populate the gen8+ SURFACE_STATE aux bits correctly.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/gen8_render.h     | 12 +++++++-----
 lib/rendercopy_gen9.c | 14 ++++++++++++++
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/gen8_render.h b/lib/gen8_render.h
index 048e667c8c95..470dca0fdfe7 100644
--- a/lib/gen8_render.h
+++ b/lib/gen8_render.h
@@ -131,7 +131,11 @@ struct gen8_surface_state
 	} ss5;
 
 	struct {
-		uint32_t pad; /* Multisample Control Surface stuff */
+		uint32_t aux_mode:3;
+		uint32_t aux_pitch:9;
+		uint32_t pad0:4;
+		uint32_t aux_qpitch:15;
+		uint32_t pad1:1;
 	} ss6;
 
 	struct {
@@ -159,13 +163,11 @@ struct gen8_surface_state
 	} ss9;
 
 	struct {
-		uint32_t pad0:12;
-		uint32_t aux_base_addr:20;
+		uint32_t aux_base_addr;
 	} ss10;
 
 	struct {
-		uint32_t aux_base_addr_hi:16;
-		uint32_t pad:16;
+		uint32_t aux_base_addr_hi;
 	} ss11;
 
 	struct {
diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c
index db59c9f4d776..d9e7eaf9e0d3 100644
--- a/lib/rendercopy_gen9.c
+++ b/lib/rendercopy_gen9.c
@@ -189,6 +189,20 @@ gen8_bind_buf(struct intel_batchbuffer *batch, const struct igt_buf *buf,
 	ss->ss7.shader_chanel_select_b = 6;
 	ss->ss7.shader_chanel_select_a = 7;
 
+	if (buf->aux.stride) {
+		ss->ss6.aux_mode = 0x5; /* AUX_CCS_E */
+		ss->ss6.aux_pitch = (buf->aux.stride / 128) - 1;
+
+		ss->ss10.aux_base_addr = buf->bo->offset64 + buf->aux.offset;
+		ss->ss11.aux_base_addr_hi = (buf->bo->offset64 + buf->aux.offset) >> 32;
+
+		ret = drm_intel_bo_emit_reloc(batch->bo,
+					      intel_batchbuffer_subdata_offset(batch, &ss->ss10),
+					      buf->bo, buf->aux.offset,
+					      read_domain, write_domain);
+		assert(ret == 0);
+	}
+
 	return offset;
 }
 
-- 
2.16.4



More information about the igt-dev mailing list