[PATCH i-g-t 17/23] lib/igt_fb: Fix planar block copy
Ville Syrjala
ville.syrjala at linux.intel.com
Mon Sep 2 14:37:52 UTC 2024
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
The block copy code tries to handle planar formats by blitting
each color plane separately. But it incorrectly picks some of
the parameters (size, bpp, etc.) from the first color plane
instead of the one it's actually copying. Pick the parameters
from the correct color plane.
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 | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 8d9d1bbe3508..2d53b317afc2 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -2829,7 +2829,8 @@ static struct blt_copy_object *allocate_and_initialize_blt(const struct igt_fb *
igt_fb_is_ccs_modifier(fb->modifier) ? COMPRESSION_ENABLED : COMPRESSION_DISABLED,
igt_fb_is_gen12_mc_ccs_modifier(fb->modifier) ? COMPRESSION_TYPE_MEDIA : COMPRESSION_TYPE_3D);
- blt_set_geom(blt, stride, 0, 0, fb->width, fb->plane_height[plane], 0, 0);
+ blt_set_geom(blt, stride, 0, 0,
+ fb->plane_width[plane], fb->plane_height[plane], 0, 0);
blt->plane_offset = fb->offsets[plane];
return blt;
@@ -2875,9 +2876,10 @@ static struct blt_copy_object *blt_fb_init(const struct igt_fb *fb,
return blt;
}
-static enum blt_color_depth blt_get_bpp(const struct igt_fb *fb)
+static enum blt_color_depth blt_get_bpp(const struct igt_fb *fb,
+ int color_plane)
{
- switch (fb->plane_bpp[0]) {
+ switch (fb->plane_bpp[color_plane]) {
case 8:
return CD_8bit;
case 16:
@@ -3020,19 +3022,19 @@ static void do_block_copy(const struct igt_fb *src_fb,
igt_assert(src && dst);
blt_copy_init(src_fb->fd, &blt);
- blt.color_depth = blt_get_bpp(src_fb);
+ blt.color_depth = blt_get_bpp(src_fb, i);
blt_set_copy_object(&blt.src, src);
blt_set_copy_object(&blt.dst, dst);
if (blt_uses_extended_block_copy(src_fb->fd)) {
blt_set_object_ext(&ext.src,
blt_compression_format(&blt, src_fb),
- src_fb->width, src_fb->height,
+ src_fb->plane_width[i], src_fb->plane_height[i],
SURFACE_TYPE_2D);
blt_set_object_ext(&ext.dst,
blt_compression_format(&blt, dst_fb),
- dst_fb->width, dst_fb->height,
+ dst_fb->plane_width[i], dst_fb->plane_height[i],
SURFACE_TYPE_2D);
pext = &ext;
}
--
2.44.2
More information about the igt-dev
mailing list