Commit 90385dcf authored by Matt Roper's avatar Matt Roper Committed by Rodrigo Vivi

drm/xe/mocs: Drop HAS_RENDER_L3CC flag

The HAS_RENDER_L3CC is set unconditionally so there's no need to keep it
as a dedicated flag.  For error checking purposes, we can just make sure
the 'table' field is initialized properly.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Suggested-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent f659ac15
...@@ -25,7 +25,6 @@ static inline void mocs_dbg(const struct drm_device *dev, ...@@ -25,7 +25,6 @@ static inline void mocs_dbg(const struct drm_device *dev,
enum { enum {
HAS_GLOBAL_MOCS = BIT(0), HAS_GLOBAL_MOCS = BIT(0),
HAS_RENDER_L3CC = BIT(1),
}; };
struct xe_mocs_entry { struct xe_mocs_entry {
...@@ -440,10 +439,11 @@ static unsigned int get_mocs_settings(struct xe_device *xe, ...@@ -440,10 +439,11 @@ static unsigned int get_mocs_settings(struct xe_device *xe,
*/ */
XE_WARN_ON(info->unused_entries_index == 0); XE_WARN_ON(info->unused_entries_index == 0);
if (XE_WARN_ON(info->size > info->n_entries)) if (XE_WARN_ON(info->size > info->n_entries)) {
info->table = NULL;
return 0; return 0;
}
flags = HAS_RENDER_L3CC;
if (!IS_DGFX(xe)) if (!IS_DGFX(xe))
flags |= HAS_GLOBAL_MOCS; flags |= HAS_GLOBAL_MOCS;
...@@ -538,6 +538,6 @@ void xe_mocs_init(struct xe_gt *gt) ...@@ -538,6 +538,6 @@ void xe_mocs_init(struct xe_gt *gt)
* sure the LNCFCMOCSx registers are programmed for the subsequent * sure the LNCFCMOCSx registers are programmed for the subsequent
* memory transactions including guc transactions * memory transactions including guc transactions
*/ */
if (flags & HAS_RENDER_L3CC) if (table.table)
init_l3cc_table(gt, &table); init_l3cc_table(gt, &table);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment