[Intel-gfx] [PATCH v2] drm/i915/tgl: MOCS table fixes

Matt Roper matthew.d.roper at intel.com
Mon Nov 11 21:59:59 UTC 2019


The bspec was just updated with a couple corrections to the TGL MOCS
table.  Entries 16 and 17 are marked as reserved (overriding the value
we inherit from GEN11_MOCS_ENTRIES) and entry 61 shouldn't have the
LE_SCF bit applied.

Note that since we're intentionally/explicitly overriding table entries
from GEN11_MOCS_ENTRIES we should suppress the 'override-init' compiler
warnings for the TGL table.

v2:
 - Add a MOCS_ENTRY_UNUSED() and use it to declare the
   explicitly-reserved MOCS entries. (Lucas)
 - Move the warning suppression from the Makefile to a #pragma that only
   affects the TGL table. (Lucas)

Bspec: 45101
Fixes: 2ddf992179c4 ("drm/i915/tgl: Define MOCS entries for Tigerlake")
Cc: Tomasz Lis <tomasz.lis at intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/i915/gt/intel_mocs.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_mocs.c b/drivers/gpu/drm/i915/gt/intel_mocs.c
index 6e881c735b20..4ae07650bfcb 100644
--- a/drivers/gpu/drm/i915/gt/intel_mocs.c
+++ b/drivers/gpu/drm/i915/gt/intel_mocs.c
@@ -91,6 +91,9 @@ struct drm_i915_mocs_table {
 		.used = 1, \
 	}
 
+#define MOCS_ENTRY_UNUSED(__idx) \
+	[__idx] = { .used = 0 }
+
 /*
  * MOCS tables
  *
@@ -241,14 +244,20 @@ static const struct drm_i915_mocs_entry broxton_mocs_table[] = {
 		   LE_3_WB | LE_TC_1_LLC | LE_LRUM(3), \
 		   L3_1_UC)
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverride-init"
 static const struct drm_i915_mocs_entry tigerlake_mocs_table[] = {
 	/* Base - Error (Reserved for Non-Use) */
-	MOCS_ENTRY(0, 0x0, 0x0),
+	MOCS_ENTRY_UNUSED(0),
 	/* Base - Reserved */
-	MOCS_ENTRY(1, 0x0, 0x0),
+	MOCS_ENTRY_UNUSED(1),
 
 	GEN11_MOCS_ENTRIES,
 
+	/* Reserved (overrides values from GEN11_MOCS_ENTRIES) */
+	MOCS_ENTRY_UNUSED(16),
+	MOCS_ENTRY_UNUSED(17),
+
 	/* Implicitly enable L1 - HDC:L1 + L3 + LLC */
 	MOCS_ENTRY(48,
 		   LE_3_WB | LE_TC_1_LLC | LE_LRUM(3),
@@ -271,9 +280,10 @@ static const struct drm_i915_mocs_entry tigerlake_mocs_table[] = {
 		   L3_1_UC),
 	/* HW Special Case (Displayable) */
 	MOCS_ENTRY(61,
-		   LE_1_UC | LE_TC_1_LLC | LE_SCF(1),
+		   LE_1_UC | LE_TC_1_LLC,
 		   L3_3_WB),
 };
+#pragma GCC diagnostic pop
 
 static const struct drm_i915_mocs_entry icelake_mocs_table[] = {
 	/* Base - Uncached (Deprecated) */
-- 
2.21.0



More information about the Intel-gfx mailing list