From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] i915/gem_busy: Another year, another ABI bump
Date: Tue, 5 Mar 2019 16:08:26 +0000 [thread overview]
Message-ID: <8d987add-5135-d1d5-abef-e7ab83761ecd@linux.intel.com> (raw)
In-Reply-To: <20190302100417.10473-1-chris@chris-wilson.co.uk>
On 02/03/2019 10:04, Chris Wilson wrote:
> The ABI ring ids are dead. Long live our classes.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
> tests/i915/gem_busy.c | 28 +++++++++++++++++++++-------
> 1 file changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/tests/i915/gem_busy.c b/tests/i915/gem_busy.c
> index eb3d3ef2b..ad8534687 100644
> --- a/tests/i915/gem_busy.c
> +++ b/tests/i915/gem_busy.c
> @@ -66,6 +66,19 @@ static void __gem_busy(int fd,
> *read = busy.busy >> 16;
> }
>
> +static uint32_t ring_to_class(unsigned int ring)
> +{
> + uint32_t class[] = {
> + [I915_EXEC_DEFAULT] = I915_ENGINE_CLASS_RENDER,
> + [I915_EXEC_RENDER] = I915_ENGINE_CLASS_RENDER,
> + [I915_EXEC_BLT] = I915_ENGINE_CLASS_COPY,
> + [I915_EXEC_BSD] = I915_ENGINE_CLASS_VIDEO,
> + [I915_EXEC_VEBOX] = I915_ENGINE_CLASS_VIDEO_ENHANCE,
> + };
> + igt_assert(ring < ARRAY_SIZE(class));
> + return class[ring];
> +}
> +
> static bool exec_noop(int fd,
> uint32_t *handles,
> unsigned ring,
> @@ -100,6 +113,7 @@ static bool still_busy(int fd, uint32_t handle)
> static void semaphore(int fd, unsigned ring, uint32_t flags)
> {
> uint32_t bbe = MI_BATCH_BUFFER_END;
> + const unsigned uabi = ring_to_class(ring & 63);
> igt_spin_t *spin;
> uint32_t handle[3];
> uint32_t read, write;
> @@ -122,26 +136,26 @@ static void semaphore(int fd, unsigned ring, uint32_t flags)
> igt_assert(exec_noop(fd, handle, ring | flags, false));
> igt_assert(still_busy(fd, handle[BUSY]));
> __gem_busy(fd, handle[TEST], &read, &write);
> - igt_assert_eq(read, 1 << ring);
> + igt_assert_eq(read, 1 << uabi);
> igt_assert_eq(write, 0);
>
> /* Requeue with a write */
> igt_assert(exec_noop(fd, handle, ring | flags, true));
> igt_assert(still_busy(fd, handle[BUSY]));
> __gem_busy(fd, handle[TEST], &read, &write);
> - igt_assert_eq(read, 1 << ring);
> - igt_assert_eq(write, ring);
> + igt_assert_eq(read, 1 << uabi);
> + igt_assert_eq(write, 1 + uabi);
>
> /* Now queue it for a read across all available rings */
> active = 0;
> for (i = I915_EXEC_RENDER; i <= I915_EXEC_VEBOX; i++) {
> if (exec_noop(fd, handle, i | flags, false))
> - active |= 1 << i;
> + active |= 1 << ring_to_class(i);
> }
> igt_assert(still_busy(fd, handle[BUSY]));
> __gem_busy(fd, handle[TEST], &read, &write);
> igt_assert_eq(read, active);
> - igt_assert_eq(write, ring); /* from the earlier write */
> + igt_assert_eq(write, 1 + uabi); /* from the earlier write */
>
> /* Check that our long batch was long enough */
> igt_assert(still_busy(fd, handle[BUSY]));
> @@ -168,7 +182,7 @@ static void one(int fd, unsigned ring, unsigned test_flags)
> struct drm_i915_gem_relocation_entry store[1024+1];
> struct drm_i915_gem_execbuffer2 execbuf;
> unsigned size = ALIGN(ARRAY_SIZE(store)*16 + 4, 4096);
> - const unsigned uabi = ring & 63;
> + const unsigned uabi = ring_to_class(ring & 63);
> uint32_t read[2], write[2];
> struct timespec tv;
> uint32_t *batch, *bbe;
> @@ -270,7 +284,7 @@ static void one(int fd, unsigned ring, unsigned test_flags)
> timeout = 1;
> }
>
> - igt_assert_eq(write[SCRATCH], uabi);
> + igt_assert_eq(write[SCRATCH], 1 + uabi);
> igt_assert_eq_u32(read[SCRATCH], 1 << uabi);
>
> igt_assert_eq(write[BATCH], 0);
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2019-03-05 16:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-02 10:04 [igt-dev] [PATCH i-g-t] i915/gem_busy: Another year, another ABI bump Chris Wilson
2019-03-02 10:57 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-02 15:09 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-03-05 16:08 ` Tvrtko Ursulin [this message]
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=8d987add-5135-d1d5-abef-e7ab83761ecd@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@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