From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 3/5] tests/kms_busy: Convert to using igt_get_single_output_for_pipe.
Date: Wed, 14 Mar 2018 16:46:35 +0200 [thread overview]
Message-ID: <20180314144635.GG5453@intel.com> (raw)
In-Reply-To: <20180314112021.60224-4-maarten.lankhorst@linux.intel.com>
On Wed, Mar 14, 2018 at 12:20:19PM +0100, Maarten Lankhorst wrote:
> Put a single igt_display_require_output_on_pipe in the fixture,
> so we know we always have an output on the pipe and can always
> assume it's not NULL.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> tests/kms_busy.c | 38 +++++++++++++++-----------------------
> 1 file changed, 15 insertions(+), 23 deletions(-)
>
> diff --git a/tests/kms_busy.c b/tests/kms_busy.c
> index 0828a8b38a06..5b4959681025 100644
> --- a/tests/kms_busy.c
> +++ b/tests/kms_busy.c
> @@ -35,31 +35,23 @@ IGT_TEST_DESCRIPTION("Basic check of KMS ABI with busy framebuffers.");
> static igt_output_t *
> set_fb_on_crtc(igt_display_t *dpy, int pipe, struct igt_fb *fb)
> {
> + drmModeModeInfoPtr mode;
> + igt_plane_t *primary;
> igt_output_t *output;
>
> - for_each_valid_output_on_pipe(dpy, pipe, output) {
> - drmModeModeInfoPtr mode;
> - igt_plane_t *primary;
> -
> - if (output->pending_pipe != PIPE_NONE)
> - continue;
> -
> - igt_output_set_pipe(output, pipe);
> - mode = igt_output_get_mode(output);
> + output = igt_get_single_output_for_pipe(dpy, pipe);
>
> - igt_create_pattern_fb(dpy->drm_fd,
> - mode->hdisplay, mode->vdisplay,
> - DRM_FORMAT_XRGB8888,
> - LOCAL_I915_FORMAT_MOD_X_TILED,
> - fb);
> + igt_output_set_pipe(output, pipe);
> + mode = igt_output_get_mode(output);
>
> - primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> - igt_plane_set_fb(primary, fb);
> + igt_create_pattern_fb(dpy->drm_fd, mode->hdisplay, mode->vdisplay,
> + DRM_FORMAT_XRGB8888,
> + LOCAL_I915_FORMAT_MOD_X_TILED, fb);
>
> - return output;
> - }
> + primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> + igt_plane_set_fb(primary, fb);
>
> - return NULL;
> + return output;
> }
>
> static void do_cleanup_display(igt_display_t *dpy)
> @@ -168,7 +160,7 @@ static void test_flip(igt_display_t *dpy, unsigned ring, int pipe, bool modeset)
>
> signal(SIGALRM, sighandler);
>
> - igt_require((output = set_fb_on_crtc(dpy, pipe, &fb[0])));
> + output = set_fb_on_crtc(dpy, pipe, &fb[0]);
> igt_display_commit2(dpy, COMMIT_LEGACY);
>
> igt_create_pattern_fb(dpy->drm_fd,
> @@ -246,7 +238,7 @@ static void test_hang(igt_display_t *dpy, unsigned ring,
> igt_output_t *output;
> igt_plane_t *primary;
>
> - igt_require((output = set_fb_on_crtc(dpy, pipe, &fb[0])));
> + output = set_fb_on_crtc(dpy, pipe, &fb[0]);
> igt_display_commit2(dpy, COMMIT_ATOMIC);
> primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>
> @@ -290,7 +282,7 @@ static void test_pageflip_modeset_hang(igt_display_t *dpy,
> igt_plane_t *primary;
> igt_spin_t *t;
>
> - igt_require((output = set_fb_on_crtc(dpy, pipe, &fb)));
> + output = set_fb_on_crtc(dpy, pipe, &fb);
> primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
>
> igt_display_commit2(dpy, dpy->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> @@ -337,7 +329,7 @@ igt_main
> errno = 0;
>
> igt_fixture {
> - igt_skip_on(n >= display.n_pipes);
> + igt_display_require_output_on_pipe(&display, n);
> }
>
> igt_subtest_f("basic-flip-%s",
> --
> 2.16.2
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel OTC
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-03-14 14:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 11:20 [igt-dev] [PATCH i-g-t 0/5] lib/igt_kms: Add for_each_pipe_with_single_output and igt_get_single_output_for_pipe Maarten Lankhorst
2018-03-14 11:20 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_kms: Add functions to get only a single output for a pipe Maarten Lankhorst
2018-03-14 14:43 ` Ville Syrjälä
2018-03-15 16:58 ` [igt-dev] [PATCH i-g-t] lib/igt_kms: Add functions to get only a single output for a pipe, v2 Maarten Lankhorst
2018-03-14 11:20 ` [igt-dev] [PATCH i-g-t 2/5] tests/kms_rmfb: Use for_each_pipe_with_single_output Maarten Lankhorst
2018-03-14 14:44 ` Ville Syrjälä
2018-03-14 11:20 ` [igt-dev] [PATCH i-g-t 3/5] tests/kms_busy: Convert to using igt_get_single_output_for_pipe Maarten Lankhorst
2018-03-14 14:46 ` Ville Syrjälä [this message]
2018-03-16 8:28 ` [igt-dev] [PATCH i-g-t] tests/kms_busy: Convert to using igt_get_single_output_for_pipe, v2 Maarten Lankhorst
2018-03-14 11:20 ` [igt-dev] [PATCH i-g-t 4/5] tests/kms_chv_cursor_fail: Reorder tests, and use igt_display_require_output_on_pipe Maarten Lankhorst
2018-03-14 11:20 ` [igt-dev] [PATCH i-g-t 5/5] tests/kms_chv_cursor_fail: Handle cleanup better Maarten Lankhorst
2018-03-14 14:48 ` Ville Syrjälä
2018-03-19 15:07 ` Maarten Lankhorst
2018-03-14 13:37 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Add for_each_pipe_with_single_output and igt_get_single_output_for_pipe Patchwork
2018-03-14 17:22 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-03-15 18:31 ` [igt-dev] ✗ Fi.CI.BAT: warning for lib/igt_kms: Add for_each_pipe_with_single_output and igt_get_single_output_for_pipe. (rev2) Patchwork
2018-03-15 19:29 ` Patchwork
2018-03-16 7:29 ` Patchwork
2018-03-16 9:03 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Add for_each_pipe_with_single_output and igt_get_single_output_for_pipe. (rev3) Patchwork
2018-03-16 10:41 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork
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=20180314144635.GG5453@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=maarten.lankhorst@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