[igt-dev] [PATCH i-g-t 25/25] tests/kms_plane: Test all modifiers as well
Ville Syrjala
ville.syrjala at linux.intel.com
Thu Jul 19 15:04:15 UTC 2018
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
Instead of just testing each pixel format let's test every
format+modifier combo.
Obviously testing with solid filled fbs isn't the most effective
way to detect tiling problems, but we can't really do much more if
we want to keep comparing YUV vs. RGB results (unless we start to
render the RGB content in a way that matches the YUV subsampling
behaviour of the hardware).
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
tests/kms_plane.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index e0625748186f..e483457f37f6 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -453,14 +453,15 @@ static void set_legacy_lut(data_t *data, enum pipe pipe,
static void test_format_plane_color(data_t *data, enum pipe pipe,
igt_plane_t *plane,
- uint32_t format, int width, int height,
+ uint32_t format, uint64_t modifier,
+ int width, int height,
int color, igt_crc_t *crc, struct igt_fb *fb)
{
const color_t *c = &colors[color];
struct igt_fb old_fb = *fb;
igt_create_color_fb(data->drm_fd, width, height,
- format, LOCAL_DRM_FORMAT_MOD_NONE,
+ format, modifier,
c->red, c->green, c->blue, fb);
igt_plane_set_fb(plane, fb);
@@ -483,6 +484,7 @@ static void test_format_plane(data_t *data, enum pipe pipe,
struct igt_fb fb = {};
drmModeModeInfo *mode;
uint32_t format, ref_format;
+ uint64_t modifier, ref_modifier;
uint64_t width, height;
igt_crc_t ref_crc[ARRAY_SIZE(colors)];
@@ -491,6 +493,7 @@ static void test_format_plane(data_t *data, enum pipe pipe,
width = mode->hdisplay;
height = mode->vdisplay;
ref_format = format = DRM_FORMAT_XRGB8888;
+ ref_modifier = modifier = DRM_FORMAT_MOD_NONE;
} else {
if (!plane->drm_plane) {
igt_debug("Only legacy cursor ioctl supported, skipping cursor plane\n");
@@ -499,6 +502,7 @@ static void test_format_plane(data_t *data, enum pipe pipe,
do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_WIDTH, &width));
do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height));
ref_format = format = DRM_FORMAT_ARGB8888;
+ ref_modifier = modifier = DRM_FORMAT_MOD_NONE;
}
igt_debug("Testing connector %s on %s plane %s.%u\n",
@@ -519,34 +523,38 @@ static void test_format_plane(data_t *data, enum pipe pipe,
test_init(data, pipe);
igt_pipe_crc_start(data->pipe_crc);
- igt_info("Testing format " IGT_FORMAT_FMT " on %s.%u\n",
- IGT_FORMAT_ARGS(format),
+ igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
+ IGT_FORMAT_ARGS(format), modifier,
kmstest_pipe_name(pipe), plane->index);
for (int i = 0; i < ARRAY_SIZE(colors); i++) {
test_format_plane_color(data, pipe, plane,
- format, width, height,
+ format, modifier,
+ width, height,
i, &ref_crc[i], &fb);
}
- for (int i = 0; i < plane->drm_plane->count_formats; i++) {
+ for (int i = 0; i < plane->format_mod_count; i++) {
igt_crc_t crc;
- format = plane->drm_plane->formats[i];
+ format = plane->formats[i];
+ modifier = plane->modifiers[i];
- if (format == ref_format)
+ if (format == ref_format &&
+ modifier == ref_modifier)
continue;
if (!igt_fb_supported_format(format))
continue;
- igt_info("Testing format " IGT_FORMAT_FMT " on %s.%u\n",
- IGT_FORMAT_ARGS(format),
+ igt_info("Testing format " IGT_FORMAT_FMT " / modifier 0x%" PRIx64 " on %s.%u\n",
+ IGT_FORMAT_ARGS(format), modifier,
kmstest_pipe_name(pipe), plane->index);
for (int j = 0; j < ARRAY_SIZE(colors); j++) {
test_format_plane_color(data, pipe, plane,
- format, width, height,
+ format, modifier,
+ width, height,
j, &crc, &fb);
igt_assert_crc_equal(&crc, &ref_crc[j]);
--
2.16.4
More information about the igt-dev
mailing list