From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/2] igt/kms_rotation_crc: Add RGB565 90 degree test for gen>9
Date: Tue, 14 Nov 2017 17:24:18 +0200 [thread overview]
Message-ID: <20171114152418.GK10981@intel.com> (raw)
In-Reply-To: <1510671515-522-3-git-send-email-juhapekka.heikkila@gmail.com>
On Tue, Nov 14, 2017 at 04:58:35PM +0200, Juha-Pekka Heikkila wrote:
> Gen10 onwards 90 and 270 degree rotations are supported for RGB565 format.
>
> v2 (Ville Syrjälä):
> As a side effect to keep bad-pixel-format test valid on all supported
> platforms it need to use DRM_FORMAT_C8 now.
>
> While at it clean up kms_rotation_crc test a bit, take out
> test_plane_rotation_ytiled_obj() function as
> test_plane_rotation() can basically do the same.
>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> ---
> tests/kms_rotation_crc.c | 101 ++++++++++-------------------------------------
> 1 file changed, 20 insertions(+), 81 deletions(-)
>
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 27d1f80..0ed2ce3 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -376,7 +376,7 @@ static void test_plane_rotation(data_t *data, int plane_type)
> igt_plane_set_size(plane, data->fb.height, data->fb.width);
>
> ret = igt_display_try_commit2(display, commit);
> - if (data->override_fmt || data->override_tiling) {
> + if (data->override_fmt == DRM_FORMAT_C8) {
I think it would be cleaner to have some kind of data->expected_error
and then do
if (data->expected_error) {
igt_assertt(ret, data->expected_error);
contine;
}
That way it's obvious which subtests expect an error and which don't.
> igt_assert_eq(ret, -EINVAL);
> continue;
> }
> @@ -421,70 +421,6 @@ static void test_plane_rotation(data_t *data, int plane_type)
> igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> }
>
> -static void test_plane_rotation_ytiled_obj(data_t *data,
> - igt_output_t *output,
> - int plane_type)
> -{
> - igt_display_t *display = &data->display;
> - uint64_t tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
> - uint32_t format = DRM_FORMAT_XRGB8888;
> - int bpp = igt_drm_format_to_bpp(format);
> - enum igt_commit_style commit = COMMIT_LEGACY;
> - int fd = data->gfx_fd;
> - igt_plane_t *plane;
> - drmModeModeInfo *mode;
> - unsigned int stride, size, w, h;
> - uint32_t gem_handle;
> - int ret;
> -
> - plane = igt_output_get_plane_type(output, plane_type);
> - igt_require(igt_plane_has_prop(plane, IGT_PLANE_ROTATION));
> -
> - if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type == DRM_PLANE_TYPE_CURSOR)
> - commit = COMMIT_UNIVERSAL;
> -
> - if (plane_type == DRM_PLANE_TYPE_CURSOR)
> - igt_require(display->has_cursor_plane);
> -
> - if (data->display.is_atomic)
> - commit = COMMIT_ATOMIC;
> -
> - mode = igt_output_get_mode(output);
> - w = mode->hdisplay;
> - h = mode->vdisplay;
> -
> - for (stride = 512; stride < (w * bpp / 8); stride *= 2)
> - ;
> - for (size = 1024*1024; size < stride * h; size *= 2)
> - ;
> -
> - gem_handle = gem_create(fd, size);
> - ret = __gem_set_tiling(fd, gem_handle, I915_TILING_Y, stride);
> - igt_assert_eq(ret, 0);
> -
> - do_or_die(__kms_addfb(fd, gem_handle, w, h, stride,
> - format, tiling, LOCAL_DRM_MODE_FB_MODIFIERS,
> - &data->fb.fb_id));
> - data->fb.width = w;
> - data->fb.height = h;
> - data->fb.gem_handle = gem_handle;
> -
> - igt_plane_set_fb(plane, NULL);
> - igt_display_commit(display);
> -
> - igt_plane_set_rotation(plane, data->rotation);
> - igt_plane_set_fb(plane, &data->fb);
> - igt_plane_set_size(plane, h, w);
> -
> - ret = igt_display_try_commit2(display, commit);
> -
> - igt_output_set_pipe(output, PIPE_NONE);
> -
> - kmstest_restore_vt_mode();
> - igt_remove_fb(fd, &data->fb);
> - igt_assert_eq(ret, 0);
> -}
> -
> static void test_plane_rotation_exhaust_fences(data_t *data,
> igt_output_t *output,
> int plane_type)
> @@ -697,7 +633,12 @@ igt_main
> data.pos_x = 0,
> data.pos_y = 0;
> data.rotation = IGT_ROTATION_90;
> - data.override_fmt = DRM_FORMAT_RGB565;
> + /*
> + * Inside test_plane_rotation() there's
> + * check for DRM_FORMAT_C8 to make this
> + * test work correctly.
> + */
> + data.override_fmt = DRM_FORMAT_C8;
> test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
> }
>
> @@ -709,24 +650,22 @@ igt_main
> test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
> }
>
> - igt_subtest_f("primary-rotation-90-Y-tiled") {
> - enum pipe pipe;
> - igt_output_t *output;
> - int valid_tests = 0;
> + igt_subtest_f("primary-rotation-90-Y-tiled-16bpp") {
> + /*
> + * this test requires hw greater than gen9
> + */
> + igt_require(gen > 9);
gen >= 10 is a more customary way of writing this. The comment is
redundant.
> + data.rotation = IGT_ROTATION_90;
> + data.override_fmt = DRM_FORMAT_RGB565;
> + data.override_tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
> + test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
> + }
>
> + igt_subtest_f("primary-rotation-90-Y-tiled") {
> igt_require(gen >= 9);
> data.rotation = IGT_ROTATION_90;
I wonder where we're resetting data.override_tiling/fmt etc. between
the subtests? Maybe we're not and this whole thing is super buggy if you
do multiple subtests in the same run?
> -
> - for_each_pipe_with_valid_output(&data.display, pipe, output) {
> - igt_output_set_pipe(output, pipe);
> -
> - test_plane_rotation_ytiled_obj(&data, output, DRM_PLANE_TYPE_PRIMARY);
> -
> - valid_tests++;
> - break;
> - }
> -
> - igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
> + data.override_fmt = DRM_FORMAT_XRGB8888;
> + test_plane_rotation(&data, DRM_PLANE_TYPE_PRIMARY);
> }
>
> igt_subtest_f("exhaust-fences") {
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-11-14 15:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-14 14:58 [PATCH i-g-t 0/2] igt/kms_rotation_crc: Add RGB565 90 degree test for gen>9 Juha-Pekka Heikkila
2017-11-14 14:58 ` [PATCH i-g-t 1/2] lib/igt_fb: Add support for DRM_FORMAT_C8 format Juha-Pekka Heikkila
2017-11-14 15:20 ` Ville Syrjälä
2017-11-14 14:58 ` [PATCH i-g-t 2/2] igt/kms_rotation_crc: Add RGB565 90 degree test for gen>9 Juha-Pekka Heikkila
2017-11-14 15:24 ` Ville Syrjälä [this message]
2017-11-14 21:05 ` ✓ Fi.CI.BAT: success for igt/kms_rotation_crc: Add RGB565 90 degree test for gen>9 (rev2) Patchwork
2017-11-15 0:18 ` ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2017-12-04 13:21 [PATCH i-g-t 0/2] igt/kms_rotation_crc: Add RGB565 90 degree test for gen>9 Juha-Pekka Heikkila
2017-12-04 13:21 ` [PATCH i-g-t 2/2] " Juha-Pekka Heikkila
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=20171114152418.GK10981@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.