[PATCH i-g-t 8/8] lib/igt_fb: on Intel Xe force Vebox copy on yuv formats

Juha-Pekka Heikkila
2026-03-20T13:47:17Z

This is to test Vebox engine along with other engines. Vebox is
forced to be used when use tile4 needing tile convert and pixel
format is yuv.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
---
lib/igt_fb.c | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 0f7ebc6b4..ffda1d564 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2596,6 +2596,23 @@ static bool block_copy_ok(const struct igt_fb *fb)
fb_tile_to_blt_tile(fb->modifier));
}

+static bool use_vebox_copy(const struct igt_fb *src_fb,
+ const struct igt_fb *dst_fb)
+{
+ /* TODO:
+ * X-Tile will need to be fixed for Vebox engine on
+ * Xe2+ devices
+ */
+ bool vebox_fix = HAS_4TILE(intel_get_drm_devid(src_fb->fd)) ?
+ (src_fb->modifier == I915_FORMAT_MOD_4_TILED ||
+ dst_fb->modifier == I915_FORMAT_MOD_4_TILED) : true;
+
+ return (igt_fb_is_gen12_mc_ccs_modifier(dst_fb->modifier) ||
+ igt_format_is_yuv(src_fb->drm_format) ||
+ igt_format_is_yuv(dst_fb->drm_format)) &&
+ vebox_fix;
+}
+
static bool ccs_needs_enginecopy(const struct igt_fb *fb)
{
if (igt_fb_is_gen12_rc_ccs_cc_modifier(fb->modifier))
@@ -2624,8 +2641,9 @@ static bool blitter_ok(const struct igt_fb *fb)
is_xe_device(fb->fd))
return false;

+ /* use blitter on xe device except 4tile yuv where utilize vebox */
if (is_xe_device(fb->fd))
- return true;
+ return !use_vebox_copy(fb, fb);

for (int i = 0; i < fb->num_planes; i++) {
int width = fb->plane_width[i];
@@ -2664,6 +2682,12 @@ static bool use_enginecopy(const struct igt_fb *fb)
if (ccs_needs_enginecopy(fb))
return true;

+ /*
+ * This is to utilize Vebox for testing
+ */
+ if (use_vebox_copy(fb, fb))
+ return true;
+
return fb->modifier == I915_FORMAT_MOD_Yf_TILED ||
fb->modifier == I915_FORMAT_MOD_X_TILED;
}
@@ -2874,15 +2898,6 @@ static void fini_buf(struct intel_buf *buf)
intel_buf_destroy(buf);
}

-static bool use_vebox_copy(const struct igt_fb *src_fb,
- const struct igt_fb *dst_fb)
-{
-
- return igt_fb_is_gen12_mc_ccs_modifier(dst_fb->modifier) ||
- igt_format_is_yuv(src_fb->drm_format) ||
- igt_format_is_yuv(dst_fb->drm_format);
-}
-
/**
* copy_with_engine:
* @blit: context for the copy operation
--
2.43.0