[Mesa-dev] [PATCH 12/12] i965/cnl: Add CNL MOCS defines

Anuj Phogat anuj.phogat at gmail.com
Sat Apr 15 00:35:27 UTC 2017


Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 src/mesa/drivers/dri/i965/brw_blorp.c            | 7 ++++++-
 src/mesa/drivers/dri/i965/brw_defines.h          | 8 ++++++++
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 8a6cc66..eae925f 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -94,12 +94,17 @@ brw_blorp_init(struct brw_context *brw)
       brw->blorp.exec = gen8_blorp_exec;
       break;
    case 9:
-   case 10:
       brw->blorp.mocs.tex = SKL_MOCS_WB;
       brw->blorp.mocs.rb = SKL_MOCS_PTE;
       brw->blorp.mocs.vb = SKL_MOCS_WB;
       brw->blorp.exec = gen9_blorp_exec;
       break;
+   case 10:
+      brw->blorp.mocs.tex = CNL_MOCS_WB;
+      brw->blorp.mocs.rb = CNL_MOCS_PTE;
+      brw->blorp.mocs.vb = CNL_MOCS_WB;
+      brw->blorp.exec = gen9_blorp_exec;
+      break;
    default:
       unreachable("Invalid gen");
    }
diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h
index 688ff61..afa13b4 100644
--- a/src/mesa/drivers/dri/i965/brw_defines.h
+++ b/src/mesa/drivers/dri/i965/brw_defines.h
@@ -1408,6 +1408,14 @@ enum brw_pixel_shader_coverage_mask_mode {
 /* TC=LLC/eLLC, LeCC=PTE, LRUM=3, L3CC=WB */
 #define SKL_MOCS_PTE (1 << 1)
 
+/* CannonLake: MOCS is now an index into an array of 62 different caching
+ * configurations programmed by the kernel.
+ */
+/* TC=LLC/eLLC, LeCC=WB, LRUM=3, L3CC=WB */
+#define CNL_MOCS_WB  (2 << 1)
+/* TC=LLC/eLLC, LeCC=PTE, LRUM=3, L3CC=WB */
+#define CNL_MOCS_PTE (1 << 1)
+
 #define MEDIA_VFE_STATE                         0x7000
 /* GEN7 DW2, GEN8+ DW3 */
 # define MEDIA_VFE_STATE_MAX_THREADS_SHIFT      16
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 1d4953e..68942f7 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -64,12 +64,14 @@ uint32_t tex_mocs[] = {
    [7] = GEN7_MOCS_L3,
    [8] = BDW_MOCS_WB,
    [9] = SKL_MOCS_WB,
+   [10] = CNL_MOCS_WB,
 };
 
 uint32_t rb_mocs[] = {
    [7] = GEN7_MOCS_L3,
    [8] = BDW_MOCS_PTE,
    [9] = SKL_MOCS_PTE,
+   [10] = CNL_MOCS_PTE,
 };
 
 static void
-- 
2.9.3



More information about the mesa-dev mailing list