i965: disable repacking for compression for applicable gen
authorDongwon Kim <dongwon.kim@intel.com>
Thu, 27 Jun 2019 16:54:35 +0000 (09:54 -0700)
committerAnuj Phogat <anuj.phogat@gmail.com>
Mon, 8 Jul 2019 17:54:38 +0000 (10:54 -0700)
set bit15 (Disable Repacking for Compression) of CACHE_MODE_0 register
if the gen attribute, 'disable_ccs_repack' is set.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_defines.h
src/mesa/drivers/dri/i965/brw_state_upload.c

index f0096e996b5713c86951fe8d69a58d58e6893732..60052ee6f5f1dc2c83ce4216f7c880f73aa5578e 100644 (file)
@@ -1576,6 +1576,7 @@ enum brw_pixel_shader_coverage_mask_mode {
 # define GEN9_PARTIAL_RESOLVE_DISABLE_IN_VC (1 << 1)
 # define GEN8_HIZ_PMA_MASK_BITS \
    REG_MASK(GEN8_HIZ_NP_PMA_FIX_ENABLE | GEN8_HIZ_NP_EARLY_Z_FAILS_DISABLE)
+# define GEN11_DISABLE_REPACKING_FOR_COMPRESSION (1 << 15)
 
 #define GEN7_GT_MODE                    0x7008
 # define GEN9_SUBSLICE_HASHING_8x8      (0 << 8)
index c41d9551a1e22c48c12d147ab64b7954cb8e800d..041bf159d5a0c55fc96b36e15f14620a90d9be90 100644 (file)
@@ -115,6 +115,15 @@ brw_upload_initial_gpu_state(struct brw_context *brw)
                                REG_MASK(GEN11_STATE_CACHE_REDIRECT_TO_CS_SECTION_ENABLE));
    }
 
+   /* hardware specification recommends disabling repacking for
+    * the compatibility with decompression mechanism in display controller.
+    */
+   if (devinfo->disable_ccs_repack) {
+      brw_load_register_imm32(brw, GEN7_CACHE_MODE_0,
+                              GEN11_DISABLE_REPACKING_FOR_COMPRESSION |
+                              REG_MASK(GEN11_DISABLE_REPACKING_FOR_COMPRESSION));
+   }
+
    if (devinfo->gen == 10 || devinfo->gen == 11) {
       /* From gen10 workaround table in h/w specs:
        *