From: Jeremy Cline <jcline@redhat.com>
To: Lyude <lyude@redhat.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_pipe_crc_basic: Add disable-crc-after-crtc-pipe-* tests
Date: Tue, 25 Aug 2020 15:45:06 -0400 [thread overview]
Message-ID: <20200825194506.GA377883@dev.jcline.org> (raw)
In-Reply-To: <20200818193528.986926-2-lyude@redhat.com>
On Tue, Aug 18, 2020 at 03:35:28PM -0400, Lyude wrote:
> From: Lyude Paul <lyude@redhat.com>
>
> I ended up hitting some bugs when writing nouveau's CRC implementation
> due to incorrectly handling the situation where we disable CRCs on a
> pipe that already been disabled, which ended up causing some other vague
> igt issues when running certain tests in multi-mode.
>
> So, let's add a trivial test for this scenario while we're at it.
>
> v2:
> * Rebased
> * Write test description for new tests
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
> tests/kms_pipe_crc_basic.c | 40 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
> index 53d76df1..e584dca9 100644
> --- a/tests/kms_pipe_crc_basic.c
> +++ b/tests/kms_pipe_crc_basic.c
> @@ -221,6 +221,41 @@ static void test_compare_crc(data_t *data, enum pipe pipe)
> igt_remove_fb(data->drm_fd, &fb1);
> }
>
> +static void test_disable_crc_after_crtc(data_t *data, enum pipe pipe)
> +{
> + igt_display_t *display = &data->display;
> + igt_output_t *output = igt_get_single_output_for_pipe(&data->display, pipe);
> + igt_pipe_crc_t *pipe_crc = igt_pipe_crc_new(data->drm_fd, pipe, "auto");
> + drmModeModeInfo *mode = igt_output_get_mode(output);
> + igt_crc_t crc[2];
> +
> + igt_display_reset(display);
> + igt_output_set_pipe(output, pipe);
> +
> + igt_create_color_fb(data->drm_fd,
> + mode->hdisplay, mode->vdisplay,
> + DRM_FORMAT_XRGB8888,
> + LOCAL_DRM_FORMAT_MOD_NONE,
> + 0.0, 1.0, 0.0, &data->fb);
The API docs indicate this could return a negative error code. I'm not
sure what errors there could be so I don't know if it's worth adding a
check here, but just something to consider. It looks like much (all?)
the existing code doesn't check so I guess it's not that problematic.
> + igt_plane_set_fb(igt_output_get_plane(output, 0), &data->fb);
> + igt_display_commit(display);
> +
> + igt_pipe_crc_start(pipe_crc);
> + igt_pipe_crc_get_current(data->drm_fd, pipe_crc, &crc[0]);
> +
> + kmstest_set_connector_dpms(data->drm_fd, output->config.connector,
> + DRM_MODE_DPMS_OFF);
> + igt_pipe_crc_stop(pipe_crc);
> +
> + kmstest_set_connector_dpms(data->drm_fd, output->config.connector,
> + DRM_MODE_DPMS_ON);
> + igt_pipe_crc_collect_crc(pipe_crc, &crc[1]);
> + igt_assert_crc_equal(&crc[0], &crc[1]);
> +
> + igt_pipe_crc_free(pipe_crc);
> + igt_remove_fb(data->drm_fd, &data->fb);
> +}
> +
> data_t data = {0, };
>
> igt_main
> @@ -265,6 +300,11 @@ igt_main
> test_read_crc(&data, pipe, 0);
> }
>
> + igt_describe("Check that disabling CRCs on a CRTC after having disabled the CRTC "
> + "does not cause issues.");
> + igt_subtest_f("disable-crc-after-crtc-pipe-%s", kmstest_pipe_name(pipe))
> + test_disable_crc_after_crtc(&data, pipe);
> +
> igt_subtest_f("hang-read-crc-pipe-%s", kmstest_pipe_name(pipe)) {
> igt_hang_t hang = igt_allow_hang(data.drm_fd, 0, 0);
>
> --
> 2.26.2
>
Reviewed-by: Jeremy Cline <jcline@redhat.com>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-08-25 19:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-18 19:35 [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_pipe_crc_basic: Use igt_display_require_output_on_pipe() Lyude
2020-08-18 19:35 ` [igt-dev] [PATCH i-g-t v2 2/2] tests/kms_pipe_crc_basic: Add disable-crc-after-crtc-pipe-* tests Lyude
2020-08-25 19:45 ` Jeremy Cline [this message]
2020-08-18 20:05 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,v2,1/2] tests/kms_pipe_crc_basic: Use igt_display_require_output_on_pipe() Patchwork
2020-08-18 20:40 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/2] tests/kms_pipe_crc_basic: Use igt_display_require_output_on_pipe() (rev2) Patchwork
2020-08-19 0:46 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2020-08-25 19:13 ` [igt-dev] [PATCH i-g-t v2 1/2] tests/kms_pipe_crc_basic: Use igt_display_require_output_on_pipe() Jeremy Cline
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=20200825194506.GA377883@dev.jcline.org \
--to=jcline@redhat.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lyude@redhat.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.