From: Petri Latvala <petri.latvala@intel.com>
To: Lyude <lyude@redhat.com>
Cc: igt-dev@lists.freedesktop.org, nouveau@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 4/4] tests: Add nouveau-crc tests
Date: Wed, 18 Mar 2020 10:19:13 +0200 [thread overview]
Message-ID: <20200318081913.GJ9497@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20200318010047.237024-5-lyude@redhat.com>
On Tue, Mar 17, 2020 at 09:00:47PM -0400, Lyude wrote:
> From: Lyude Paul <lyude@redhat.com>
>
> We're finally getting CRC support in nouveau, so let's start testing
> this in igt as well! While the normal CRC capture tests are nice,
> there's a number of Nvidia-specific hardware characteristics that we
> need to test as well.
>
> The most important one is known as a "notifier context flip". Basically,
> Nvidia GPUs store generated CRCs in an allocated memory region, referred
> to as the notifier context, that the driver programs itself. Strangely,
> this region can only hold a limited number of CRC entries, and once it
> runs out of available entries the hardware simply sets an overrun bit
> and stops writing any new CRC entries.
>
> Since igt-gpu-tools doesn't really have an expectation of only being
> able to grab a limited number of CRCs, we work around this in nouveau by
> allocating two separate CRC notifier regions each time we start
> capturing CRCs, and then flip between them whenever we get close to
> filling our currently programmed notifier context. While this keeps the
> number of CRC entries we lose to an absolute minimum, we are guaranteed
> to lose exactly one CRC entry between context flips. Thus, we add some
> tests to ensure that nouveau handles these flips correctly
> (pipe-[A-F]-ctx-flip-detection), and that igt itself is also able to
> handle them correctly (pipe-[A-F]-ctx-flip-skip-current-frame). Since
> these tests use a debugfs interface to manually control the notifier
> context flip threshold, we also add one test to ensure that any flip
> thresholds we set are cleared after a single CRC capture
> (ctx-flip-threshold-reset-after-capture).
>
> In addition, we also add some simple tests to test Nvidia-specific CRC
> sources.
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
> lib/drmtest.c | 10 ++
> lib/drmtest.h | 2 +
> tests/meson.build | 1 +
> tests/nouveau_crc.c | 396 ++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 409 insertions(+)
> create mode 100644 tests/nouveau_crc.c
>
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index 1fc39925..53c01754 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -112,6 +112,11 @@ bool is_i915_device(int fd)
> return __is_device(fd, "i915");
> }
>
> +bool is_nouveau_device(int fd)
> +{
> + return __is_device(fd, "nouveau");
> +}
> +
> bool is_vc4_device(int fd)
> {
> return __is_device(fd, "vc4");
> @@ -537,6 +542,11 @@ void igt_require_intel(int fd)
> igt_require(is_i915_device(fd) && has_known_intel_chipset(fd));
> }
>
> +void igt_require_nouveau(int fd)
> +{
> + igt_require(is_nouveau_device(fd));
> +}
> +
> void igt_require_vc4(int fd)
> {
> igt_require(is_vc4_device(fd));
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index 632c616b..4937e9d2 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -97,10 +97,12 @@ void gem_quiescent_gpu(int fd);
>
> void igt_require_amdgpu(int fd);
> void igt_require_intel(int fd);
> +void igt_require_nouveau(int fd);
> void igt_require_vc4(int fd);
>
> bool is_amdgpu_device(int fd);
> bool is_i915_device(int fd);
> +bool is_nouveau_device(int fd);
> bool is_vc4_device(int fd);
>
> /**
> diff --git a/tests/meson.build b/tests/meson.build
> index 7629afde..9ff74cc6 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -70,6 +70,7 @@ test_progs = [
> 'kms_vblank',
> 'kms_vrr',
> 'meta_test',
> + 'nouveau_crc',
> 'panfrost_get_param',
> 'panfrost_gem_new',
> 'panfrost_prime',
> diff --git a/tests/nouveau_crc.c b/tests/nouveau_crc.c
> new file mode 100644
> index 00000000..09e17a6f
> --- /dev/null
> +++ b/tests/nouveau_crc.c
> @@ -0,0 +1,396 @@
> +/*
> + * Copyright © 2019 Red Hat Inc.
Verify that the authoring year is correct.
--
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-03-18 8:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 1:00 [igt-dev] [PATCH i-g-t 0/4] Add nouveau-crc tests Lyude
2020-03-18 1:00 ` [igt-dev] [PATCH i-g-t 1/4] lib/igt_core: Add igt_require_fd() Lyude
2020-03-18 8:12 ` Petri Latvala
2020-03-18 1:00 ` [igt-dev] [PATCH i-g-t 2/4] lib/igt_debugfs: Add igt_debugfs_pipe_dir() Lyude
2020-03-18 1:00 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_kms: Hook up connector dithering prop Lyude
2020-03-18 1:00 ` [igt-dev] [PATCH i-g-t 4/4] tests: Add nouveau-crc tests Lyude
2020-03-18 8:19 ` Petri Latvala [this message]
2020-03-18 1:47 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2020-03-18 2:05 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-03-18 8:32 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20200318081913.GJ9497@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lyude@redhat.com \
--cc=nouveau@lists.freedesktop.org \
/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