[PATCH i-g-t 2/3] lib/igt_fb: add I915_FORMAT_MOD_4_TILED_XE2_CCS modifier support

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Jul 25 18:16:21 UTC 2024


Here is added support for I915_FORMAT_MOD_4_TILED_XE2_CCS modifier
for Intel Xe2 hardware.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 lib/igt_fb.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ab162a5b7..5bbdbfa72 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -481,6 +481,7 @@ void igt_get_fb_tile_size(int fd, uint64_t modifier, int fb_bpp,
 	case I915_FORMAT_MOD_4_TILED_DG2_RC_CCS:
 	case I915_FORMAT_MOD_4_TILED_DG2_MC_CCS:
 	case I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC:
+	case I915_FORMAT_MOD_4_TILED_XE2_CCS:
 		igt_require_intel(fd);
 		if (intel_display_ver(intel_get_drm_devid(fd)) == 2) {
 			*width_ret = 128;
@@ -955,8 +956,11 @@ static uint64_t calc_fb_size(struct igt_fb *fb)
 		size += calc_plane_size(fb, plane);
 	}
 
-	if (is_xe_device(fb->fd))
+	if (is_xe_device(fb->fd)) {
 		size = ALIGN(size, xe_get_default_alignment(fb->fd));
+		if (fb->modifier == I915_FORMAT_MOD_4_TILED_XE2_CCS)
+			size = ALIGN(size, SZ_64K);
+	}
 
 	return size;
 }
@@ -1020,6 +1024,7 @@ uint64_t igt_fb_mod_to_tiling(uint64_t modifier)
 	case I915_FORMAT_MOD_4_TILED_MTL_RC_CCS:
 	case I915_FORMAT_MOD_4_TILED_MTL_MC_CCS:
 	case I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC:
+	case I915_FORMAT_MOD_4_TILED_XE2_CCS:
 		return I915_TILING_4;
 	case I915_FORMAT_MOD_Yf_TILED:
 	case I915_FORMAT_MOD_Yf_TILED_CCS:
@@ -2564,7 +2569,8 @@ static bool use_blitter(const struct igt_fb *fb)
 	if (!blitter_ok(fb))
 		return false;
 
-	return fb->modifier == I915_FORMAT_MOD_4_TILED ||
+	return fb->modifier == I915_FORMAT_MOD_4_TILED_XE2_CCS ||
+	       fb->modifier == I915_FORMAT_MOD_4_TILED ||
 	       fb->modifier == I915_FORMAT_MOD_Y_TILED ||
 	       fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
 	       (is_i915_device(fb->fd) && !gem_has_mappable_ggtt(fb->fd)) ||
@@ -5000,6 +5006,7 @@ const char *igt_fb_modifier_name(uint64_t modifier)
 		return "4";
 	case I915_FORMAT_MOD_4_TILED_MTL_RC_CCS:
 	case I915_FORMAT_MOD_4_TILED_DG2_RC_CCS:
+	case I915_FORMAT_MOD_4_TILED_XE2_CCS:
 		return "4-rc-ccs";
 	case I915_FORMAT_MOD_4_TILED_MTL_MC_CCS:
 	case I915_FORMAT_MOD_4_TILED_DG2_MC_CCS:
-- 
2.43.2



More information about the igt-dev mailing list