[PATCH i-g-t 29/37] lib/igt_fb: Treat 2:10:10:10 properly

Ville Syrjala ville.syrjala at linux.intel.com
Tue Jul 2 23:28:09 UTC 2024


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

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

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 ab04733fef61..c92997449c3f 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2657,6 +2657,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