[PATCH i-g-t v2 11/18] lib/igt_fb: Treat 2:10:10:10 properly

Ville Syrjala ville.syrjala at linux.intel.com
Wed Sep 18 12:05:11 UTC 2024


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Populate buf->depth for 10bpc formats so that rendercopy and veboxcopy
know to use the correct hardware format for these.

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 lib/igt_fb.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 0a30148ef5df..d70c26e58848 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2684,6 +2684,18 @@ igt_fb_create_intel_buf(int fd, struct buf_ops *bops,
 				    DEFAULT_MOCS_INDEX);
 	intel_buf_set_name(buf, name);
 
+	/* only really needed for proper CCS handling */
+	switch (fb->drm_format) {
+	case DRM_FORMAT_ABGR2101010:
+	case DRM_FORMAT_ARGB2101010:
+	case DRM_FORMAT_XBGR2101010:
+	case DRM_FORMAT_XRGB2101010:
+		buf->depth = 30;
+		break;
+	default:
+		break;
+	}
+
 	/* Make sure we close handle on destroy path */
 	intel_buf_set_ownership(buf, true);
 
-- 
2.44.2



More information about the igt-dev mailing list