Skip to content

Commit 7c5c15d

Browse files
icklerodrigovivi
authored andcommitted
drm/i915/gt: Declare gen9 has 64 mocs entries!
We checked the table size against a hardcoded number of entries, and that number was excluding the special mocs registers at the end. Fixes: 777a771 ("drm/i915/gt: Program mocs:63 for cache eviction on gen9") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: <stable@vger.kernel.org> # v4.3+ Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20201127102540.13117-1-chris@chris-wilson.co.uk (cherry picked from commit 444fbf5) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> [backported and updated the Fixes sha]
1 parent f6cbe49 commit 7c5c15d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/gpu/drm/i915/gt/intel_mocs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ struct drm_i915_mocs_table {
5959
#define _L3_CACHEABILITY(value) ((value) << 4)
6060

6161
/* Helper defines */
62-
#define GEN9_NUM_MOCS_ENTRIES 62 /* 62 out of 64 - 63 & 64 are reserved. */
63-
#define GEN11_NUM_MOCS_ENTRIES 64 /* 63-64 are reserved, but configured. */
62+
#define GEN9_NUM_MOCS_ENTRIES 64 /* 63-64 are reserved, but configured. */
6463

6564
/* (e)LLC caching options */
6665
/*
@@ -328,11 +327,11 @@ static unsigned int get_mocs_settings(const struct drm_i915_private *i915,
328327
if (INTEL_GEN(i915) >= 12) {
329328
table->size = ARRAY_SIZE(tgl_mocs_table);
330329
table->table = tgl_mocs_table;
331-
table->n_entries = GEN11_NUM_MOCS_ENTRIES;
330+
table->n_entries = GEN9_NUM_MOCS_ENTRIES;
332331
} else if (IS_GEN(i915, 11)) {
333332
table->size = ARRAY_SIZE(icl_mocs_table);
334333
table->table = icl_mocs_table;
335-
table->n_entries = GEN11_NUM_MOCS_ENTRIES;
334+
table->n_entries = GEN9_NUM_MOCS_ENTRIES;
336335
} else if (IS_GEN9_BC(i915) || IS_CANNONLAKE(i915)) {
337336
table->size = ARRAY_SIZE(skl_mocs_table);
338337
table->n_entries = GEN9_NUM_MOCS_ENTRIES;

0 commit comments

Comments
 (0)