From: Daniel Vetter <daniel@ffwll.ch>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 3/4] tests/kms_plane: Eliminate modeset between every plane
Date: Fri, 29 Mar 2019 10:45:26 +0100 [thread overview]
Message-ID: <20190329094526.GK2665@phenom.ffwll.local> (raw)
In-Reply-To: <20190328175727.3086-3-ville.syrjala@linux.intel.com>
On Thu, Mar 28, 2019 at 07:57:26PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Move the pipe/primary plane stuff outside the plane loop so that
> we can avoid all that overhead (including a modeset) when switching
> from one plane to another.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> tests/kms_plane.c | 52 +++++++++++++++++++++++++----------------------
> 1 file changed, 28 insertions(+), 24 deletions(-)
>
> diff --git a/tests/kms_plane.c b/tests/kms_plane.c
> index 4007c894f87a..3f14dbf8e9b9 100644
> --- a/tests/kms_plane.c
> +++ b/tests/kms_plane.c
> @@ -447,8 +447,6 @@ static void test_format_plane_color(data_t *data, enum pipe pipe,
> static bool test_format_plane(data_t *data, enum pipe pipe,
> igt_output_t *output, igt_plane_t *plane)
> {
> - igt_plane_t *primary;
> - struct igt_fb primary_fb;
> struct igt_fb fb = {};
> drmModeModeInfo *mode;
> uint32_t format, ref_format;
> @@ -481,18 +479,6 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> igt_output_name(output), kmstest_plane_type_name(plane->type),
> kmstest_pipe_name(pipe), plane->index);
>
> - igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
> - DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &primary_fb);
> -
> - igt_output_set_pipe(output, pipe);
> - primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> - igt_plane_set_fb(primary, &primary_fb);
> -
> - igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> -
> - set_legacy_lut(data, pipe, 0xfc00);
> -
> - test_init(data, pipe);
> igt_pipe_crc_start(data->pipe_crc);
>
> igt_info("Testing format " IGT_FORMAT_FMT " on %s.%u\n",
> @@ -562,17 +548,9 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> }
>
> igt_pipe_crc_stop(data->pipe_crc);
> - test_fini(data);
> -
> - set_legacy_lut(data, pipe, 0xffff);
>
> - igt_plane_set_fb(primary, NULL);
> igt_plane_set_fb(plane, NULL);
> - igt_output_set_pipe(output, PIPE_NONE);
> - igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> -
> igt_remove_fb(data->drm_fd, &fb);
> - igt_remove_fb(data->drm_fd, &primary_fb);
>
> return result;
> }
> @@ -580,6 +558,9 @@ static bool test_format_plane(data_t *data, enum pipe pipe,
> static void
> test_pixel_formats(data_t *data, enum pipe pipe)
> {
> + struct igt_fb primary_fb;
> + igt_plane_t *primary;
> + drmModeModeInfo *mode;
> bool result;
> igt_output_t *output;
> igt_plane_t *plane;
> @@ -587,13 +568,36 @@ test_pixel_formats(data_t *data, enum pipe pipe)
> output = igt_get_single_output_for_pipe(&data->display, pipe);
> igt_require(output);
>
> + mode = igt_output_get_mode(output);
> +
> + igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
> + DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &primary_fb);
> +
> + igt_output_set_pipe(output, pipe);
> + primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> + igt_plane_set_fb(primary, &primary_fb);
> +
> + igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> +
> + set_legacy_lut(data, pipe, 0xfc00);
> +
> + test_init(data, pipe);
> +
> result = true;
> for_each_plane_on_pipe(&data->display, pipe, plane)
> result &= test_format_plane(data, pipe, output, plane);
>
> - igt_assert_f(result, "At least one CRC mismatch happened\n");
> + test_fini(data);
>
> - igt_output_set_pipe(output, PIPE_ANY);
> + set_legacy_lut(data, pipe, 0xffff);
> +
> + igt_plane_set_fb(primary, NULL);
> + igt_output_set_pipe(output, PIPE_NONE);
> + igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> +
> + igt_remove_fb(data->drm_fd, &primary_fb);
> +
> + igt_assert_f(result, "At least one CRC mismatch happened\n");
> }
>
> static void
> --
> 2.19.2
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-03-29 9:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-28 17:57 [igt-dev] [PATCH i-g-t 1/4] tests/kms_plane: Remove the upscaling requirement Ville Syrjala
2019-03-28 17:57 ` [igt-dev] [PATCH i-g-t 2/4] tests/kms_plane: Reduce the plane size 64x64 Ville Syrjala
2019-03-29 9:42 ` Daniel Vetter
2019-03-28 17:57 ` [igt-dev] [PATCH i-g-t 3/4] tests/kms_plane: Eliminate modeset between every plane Ville Syrjala
2019-03-29 9:45 ` Daniel Vetter [this message]
2019-03-28 17:57 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_plane: Test all modifiers as well Ville Syrjala
2019-03-29 9:53 ` Daniel Vetter
2019-03-29 11:11 ` Ville Syrjälä
2019-03-28 18:36 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/kms_plane: Remove the upscaling requirement Patchwork
2019-03-29 4:25 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-03-29 9:41 ` [igt-dev] [PATCH i-g-t 1/4] " Daniel Vetter
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=20190329094526.GK2665@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox