]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/pat: Default XE_CACHE_NONE_COMPRESSION to invalid
authorXin Wang <x.wang@intel.com>
Thu, 16 Apr 2026 04:55:25 +0000 (21:55 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 21 Apr 2026 17:20:17 +0000 (10:20 -0700)
Initialize XE_CACHE_NONE_COMPRESSION PAT index to XE_PAT_INVALID_IDX by
default, same as XE_CACHE_WB_COMPRESSION. Platforms that support this
cache mode will override it in xe_pat_init_early(). This ensures that
accidental use on unsupported platforms can be detected.

A subsequent patch introduces a helper to assert on invalid PAT index
access at all call sites.

Suggested-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Xin Wang <x.wang@intel.com>
Link: https://patch.msgid.link/20260416045526.536497-3-x.wang@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_pat.c

index 75aaae7b003d02e398b23a430dece21ce36e1110..fad5b5a5ed4a0ca256a98168e4beda1dab3f5bd5 100644 (file)
@@ -559,6 +559,7 @@ static const struct xe_pat_ops xe3p_xpc_pat_ops = {
 void xe_pat_init_early(struct xe_device *xe)
 {
        xe->pat.idx[XE_CACHE_WB_COMPRESSION] = XE_PAT_INVALID_IDX;
+       xe->pat.idx[XE_CACHE_NONE_COMPRESSION] = XE_PAT_INVALID_IDX;
        if (GRAPHICS_VERx100(xe) == 3511) {
                xe->pat.ops = &xe3p_xpc_pat_ops;
                xe->pat.table = xe3p_xpc_pat_table;