From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 11/12] tests/kms_big_fb: Test planar YCbCr formats
Date: Wed, 20 Dec 2023 19:59:33 +0200 [thread overview]
Message-ID: <20231220175934.22849-12-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20231220175934.22849-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Panning around inside planar YCbCr framebuffers is a bit
more involved that the RGB counterpart. It seems prudent
to test that we are correctly handling these case.
We'll manually trick rendercopy to also copy the chroma
plane for us. It might be nice to make rendercopy eventually
handle this entirely on its own, but for now we'll take this
slight shortcut.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tests/intel/kms_big_fb.c | 38 ++++++++++++++++++++++++++++++--------
1 file changed, 30 insertions(+), 8 deletions(-)
diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
index 80644ce94ab6..f8dd5a015ee1 100644
--- a/tests/intel/kms_big_fb.c
+++ b/tests/intel/kms_big_fb.c
@@ -42,27 +42,27 @@
#include "xe/xe_query.h"
/**
- * SUBTEST: linear-%dbpp-rotate-%d
+ * SUBTEST: linear-%s-rotate-%d
* Description: Sanity check if addfb ioctl works correctly for given combination
* of Linear modifier with %arg[1]-bpp & %arg[2]-rotation
* Functionality: big_fbs, kms_gem_interop, rotation
*
- * SUBTEST: linear-%dbpp-rotate-%d-hflip
+ * SUBTEST: linear-%s-rotate-%d-hflip
* Description: Sanity check if addfb ioctl works correctly for given combination
* of Linear modifier with %arg[1]-bpp & %arg[2]-rotation
* Functionality: big_fbs, kms_gem_interop, rotation
*
- * arg[1].values: 8, 16, 32, 64
+ * arg[1].values: 8bpp, 16bpp, 32bpp, 64bpp, nv12, p016
* arg[2].values: 0, 90, 180, 270
*/
/**
- * SUBTEST: %s-%dbpp-rotate-%d
+ * SUBTEST: %s-%s-rotate-%d
* Description: Sanity check if addfb ioctl works correctly for given combination
* of %arg[1] with %arg[2]-bpp & %arg[3]-rotation
* Functionality: big_fbs, kms_gem_interop, rotation, tiling
*
- * SUBTEST: %s-%dbpp-rotate-%d-hflip
+ * SUBTEST: %s-%s-rotate-%d-hflip
* Description: Sanity check if addfb ioctl works correctly for given combination
* of %arg[1] with %arg[2]-bpp & %arg[3]-rotation
* Functionality: big_fbs, kms_gem_interop, rotation, tiling
@@ -74,7 +74,7 @@
* @y-tiled: TILE-Y modifier
* @yf-tiled: TILE-YF modifier
*
- * arg[2].values: 8, 16, 32, 64
+ * arg[2].values: 8bpp, 16bpp, 32bpp, 64bpp, nv12, p016
* arg[3].values: 0, 90, 180, 270
*
* arg[4]:
@@ -237,6 +237,18 @@ static void copy_pattern(data_t *data,
*/
if (data->render_copy) {
data->render_copy(data->ibb, src, sx, sy, w, h, dst, dx, dy);
+
+ /* FIXME rendercopy should do this for us perhaps? */
+ if (igt_format_is_yuv_semiplanar(data->format)) {
+ igt_assert(!igt_fb_is_ccs_modifier(data->modifier));
+
+ src->bpp *= 2;
+ src->surface[0] = src->surface[1];
+ dst->bpp *= 2;
+ dst->surface[0] = dst->surface[1];
+
+ data->render_copy(data->ibb, src, sx/2, sy/2, w/2, h/2, dst, dx/2, dy/2);
+ }
} else {
w = min(w, src_fb->width - sx);
w = min(w, dst_fb->width - dx);
@@ -320,6 +332,10 @@ static void generate_pattern(data_t *data,
pat_fb.width, pat_fb.height);
w++;
h++;
+ if (igt_format_is_yuv_semiplanar(data->format)) {
+ w++;
+ h++;
+ }
}
}
@@ -478,8 +494,9 @@ static bool test_plane(data_t *data)
int y = coords[i].y;
/* Hardware limitation */
- if (data->format == DRM_FORMAT_RGB565 &&
- igt_rotation_90_or_270(data->rotation)) {
+ if ((data->format == DRM_FORMAT_RGB565 &&
+ igt_rotation_90_or_270(data->rotation)) ||
+ igt_format_is_yuv_semiplanar(data->format)) {
x &= ~1;
y &= ~1;
}
@@ -940,6 +957,9 @@ static bool has_async_flip(data_t *data)
* TODO: preferably probe all this stuff with
* TEST_ONLY rather than hardcoding it...
*/
+ if (igt_format_is_yuv_semiplanar(data->format))
+ return false;
+
if (intel_display_ver(data->devid) < 12 &&
data->modifier == DRM_FORMAT_MOD_LINEAR)
return false;
@@ -968,6 +988,8 @@ static const struct {
{ DRM_FORMAT_RGB565, "16bpp", },
{ DRM_FORMAT_XRGB8888, "32bpp", },
{ DRM_FORMAT_XBGR16161616F, "64bpp", },
+ { DRM_FORMAT_NV12, "nv12", },
+ { DRM_FORMAT_P016, "p016", },
};
static const igt_rotation_t rotations[] = {
--
2.41.0
next prev parent reply other threads:[~2023-12-20 18:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 17:59 [PATCH i-g-t 00/12] tests/kms_big_fb: Test planar formats, and CCS Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 01/12] lib/rendercopy: Add deltas to all surface relocs Ville Syrjala
2023-12-22 5:03 ` [PATCH i-g-t v2 " Ville Syrjala
2023-12-22 5:37 ` [PATCH i-g-t " Zbigniew Kempczyński
2023-12-22 6:01 ` Ville Syrjälä
2023-12-22 6:06 ` Ville Syrjälä
2023-12-22 6:52 ` Ville Syrjälä
2023-12-22 7:26 ` Zbigniew Kempczyński
2023-12-22 8:33 ` Ville Syrjälä
2023-12-20 17:59 ` [PATCH i-g-t 02/12] tests/kms_big_fb: Use igt_fb_create_intel_buf() Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 03/12] lib/igt_fb: Expose igt_fb_is_ccs_modifier() Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 04/12] tests/kms_big_fb: Fix async Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 05/12] tests/kms_big_fb: Test async flips + linear on tgl+ Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 06/12] tests/kms_big_fb: Determine the max fb size the same way always Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 07/12] tests/kms_frontbuffer_tracking: Use igt_create_fb() Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 08/12] lib/igt_fb: Make igt_calc_fb_size() somewhat usable Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 09/12] tests/kms_big_fb: Nuke fliptab[] Ville Syrjala
2023-12-20 17:59 ` [PATCH i-g-t 10/12] tests/kms_big_fb: Replace 'bpp' with 'name' Ville Syrjala
2023-12-20 17:59 ` Ville Syrjala [this message]
2023-12-20 17:59 ` [PATCH i-g-t 12/12] tests/kms_big_fb: Also test some CCS modifiers Ville Syrjala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231220175934.22849-12-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox