Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe: Only advertise NO_COMPRESSION hint on devices with flat CCS
@ 2026-02-11 11:40 Sanjay Yadav
  2026-02-11 12:49 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sanjay Yadav @ 2026-02-11 11:40 UTC (permalink / raw)
  To: intel-xe; +Cc: matthew.auld, José Roberto de Souza, Stuart Summers

Devices like CRI have GRAPHICS_VER >= 20 but don't have compression
support their PAT table (xe3p_xpc_pat_table) has no compression-enabled
entries.

Only advertise HAS_NO_COMPRESSION_HINT flag when the device actually has
flat CCS and thus compression capability.

v2:
- Also reject NO_COMPRESSION flag in xe_gem_create_ioctl() when device
  lacks flat CCS support (Matt A)
- Updated commit subject to reflect changes in both xe_query.c and xe_bo.c

Fixes: 78d91ba6bd796 ("drm/xe/uapi: Add NO_COMPRESSION BO flag and query capability")
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Stuart Summers <stuart.summers@intel.com>
Signed-off-by: Sanjay Yadav <sanjay.kumar.yadav@intel.com>
---
 drivers/gpu/drm/xe/xe_bo.c    | 3 ++-
 drivers/gpu/drm/xe/xe_query.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 8bf16d60b9a5..4b29a442de3e 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -3200,7 +3200,8 @@ int xe_gem_create_ioctl(struct drm_device *dev, void *data,
 		bo_flags |= XE_BO_FLAG_SCANOUT;
 
 	if (args->flags & DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION) {
-		if (XE_IOCTL_DBG(xe, GRAPHICS_VER(xe) < 20))
+		if (XE_IOCTL_DBG(xe, GRAPHICS_VER(xe) < 20 ||
+				 !xe_device_has_flat_ccs(xe)))
 			return -EOPNOTSUPP;
 		bo_flags |= XE_BO_FLAG_NO_COMPRESSION;
 	}
diff --git a/drivers/gpu/drm/xe/xe_query.c b/drivers/gpu/drm/xe/xe_query.c
index 34db266b723f..c152ebfbd7d8 100644
--- a/drivers/gpu/drm/xe/xe_query.c
+++ b/drivers/gpu/drm/xe/xe_query.c
@@ -335,7 +335,7 @@ static int query_config(struct xe_device *xe, struct drm_xe_device_query *query)
 	if (xe->info.has_usm && IS_ENABLED(CONFIG_DRM_XE_GPUSVM))
 		config->info[DRM_XE_QUERY_CONFIG_FLAGS] |=
 			DRM_XE_QUERY_CONFIG_FLAG_HAS_CPU_ADDR_MIRROR;
-	if (GRAPHICS_VER(xe) >= 20)
+	if (GRAPHICS_VER(xe) >= 20 && xe_device_has_flat_ccs(xe))
 		config->info[DRM_XE_QUERY_CONFIG_FLAGS] |=
 			DRM_XE_QUERY_CONFIG_FLAG_HAS_NO_COMPRESSION_HINT;
 	config->info[DRM_XE_QUERY_CONFIG_FLAGS] |=
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-11 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-11 11:40 [PATCH v2] drm/xe: Only advertise NO_COMPRESSION hint on devices with flat CCS Sanjay Yadav
2026-02-11 12:49 ` ✓ CI.KUnit: success for " Patchwork
2026-02-11 14:07 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-11 16:49 ` [PATCH v2] " Matthew Auld
2026-02-11 17:56 ` ✗ Xe.CI.FULL: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox