From: Xin Wang Date: Thu, 16 Apr 2026 04:55:25 +0000 (-0700) Subject: drm/xe/pat: Default XE_CACHE_NONE_COMPRESSION to invalid X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=369738a43a62c6ee46033ed1a26ed7d08c0e4b68;p=thirdparty%2Fkernel%2Flinux.git drm/xe/pat: Default XE_CACHE_NONE_COMPRESSION to invalid 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 Cc: Matt Roper Reviewed-by: Matthew Auld Signed-off-by: Xin Wang Link: https://patch.msgid.link/20260416045526.536497-3-x.wang@intel.com Signed-off-by: Matt Roper --- diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index 75aaae7b003d0..fad5b5a5ed4a0 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -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;