diff options
author | Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> | 2018-11-30 09:21:27 -0500 |
---|---|---|
committer | Harry Wentland <harry.wentland@amd.com> | 2019-01-08 09:57:58 -0500 |
commit | dc97f6ed7522b4d2e5a375bbd573f122abe91325 (patch) | |
tree | 03a5c51b86e2eeddc7b93310daf91e4a85e858c4 /tests/kms_plane_lowres.c | |
parent | e7b6c813e188cdf2ba73acd85e632d80783ffa98 (diff) |
tests/kms_plane_lowres: Don't fail tests when missing format/mod support
The kms_plane_lowres subtests will fail on non-i915 hardware because
of the devid lookups and tiling format requirements.
This patch makes use of the igt_display_has_format_mod() helper to
check for support before failing fb creation.
The tests still won't fully run yet on i915 hardware because they'll
skip during calls to igt_assert_plane_visible - those require an i915
extension to get the CRTC/plane set for a given pipe.
v2: Use igt_display_has_format_mod helper (Ville)
v3: Move variable declarations to loop scope (Ville)
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_plane_lowres.c')
-rw-r--r-- | tests/kms_plane_lowres.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/kms_plane_lowres.c b/tests/kms_plane_lowres.c index 0824ef8f..b27e5e61 100644 --- a/tests/kms_plane_lowres.c +++ b/tests/kms_plane_lowres.c @@ -142,6 +142,10 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, int i = 1, x, y; igt_plane_t *plane; + igt_skip_on(!igt_display_has_format_mod(&data->display, + DRM_FORMAT_XRGB8888, + modifier)); + igt_output_set_pipe(output, pipe); mode = igt_output_get_mode(output); @@ -158,6 +162,9 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, /* yellow sprite plane in lower left corner */ for_each_plane_on_pipe(&data->display, pipe, plane) { + uint64_t plane_modifier; + uint32_t plane_format; + if (plane->type == DRM_PLANE_TYPE_PRIMARY) { igt_plane_set_fb(plane, &data->fb[0]); continue; @@ -171,10 +178,19 @@ test_setup(data_t *data, enum pipe pipe, uint64_t modifier, x = 0; y = mode->vdisplay - size; + plane_format = plane->type == DRM_PLANE_TYPE_CURSOR ? + DRM_FORMAT_ARGB8888 : DRM_FORMAT_XRGB8888; + + plane_modifier = plane->type == DRM_PLANE_TYPE_CURSOR ? + LOCAL_DRM_FORMAT_MOD_NONE : modifier; + + igt_skip_on(!igt_plane_has_format_mod(plane, plane_format, + plane_modifier)); + igt_create_color_fb(data->drm_fd, size, size, - plane->type == DRM_PLANE_TYPE_CURSOR ? DRM_FORMAT_ARGB8888 : DRM_FORMAT_XRGB8888, - plane->type == DRM_PLANE_TYPE_CURSOR ? LOCAL_DRM_FORMAT_MOD_NONE : modifier, + plane_format, + plane_modifier, 1.0, 1.0, 0.0, &data->fb[i]); @@ -251,11 +267,6 @@ static void test_plane_position(data_t *data, enum pipe pipe, uint64_t modifier) { igt_output_t *output; - const int gen = intel_gen(intel_get_drm_devid(data->drm_fd)); - - if (modifier == LOCAL_I915_FORMAT_MOD_Y_TILED || - modifier == LOCAL_I915_FORMAT_MOD_Yf_TILED) - igt_skip_on(gen < 9); for_each_valid_output_on_pipe(&data->display, pipe, output) test_plane_position_with_output(data, pipe, output, modifier); |