From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: viswax.krishna.raveendra.talabattula@intel.com
Cc: igt-dev@lists.freedesktop.org, Mahesh.Meena@intel.com
Subject: Re: [igt-dev] [Patch V4] [i-g-t] tests/i915: test pass for no caching case
Date: Thu, 20 May 2021 23:11:58 -0700 [thread overview]
Message-ID: <87im3cehu9.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20210521060237.774731-1-viswax.krishna.raveendra.talabattula@intel.com>
On Thu, 20 May 2021 23:02:37 -0700, <viswax.krishna.raveendra.talabattula@intel.com> wrote:
>
> diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
> index aad5f141..225703ea 100644
> --- a/tests/i915/gem_userptr_blits.c
> +++ b/tests/i915/gem_userptr_blits.c
> @@ -2016,6 +2016,7 @@ static void test_set_caching(int i915)
> };
> uint32_t handle;
> void *page;
> + int ret;
>
> page = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
> MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
> @@ -2032,15 +2033,41 @@ static void test_set_caching(int i915)
>
> for (int idx = 0; idx < ARRAY_SIZE(levels); idx++) {
> gem_userptr(i915, page, 4096, 0, 0, &handle);
> - igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
> + ret = __gem_set_caching(i915, handle, levels[idx]);
> + if (levels[idx] == I915_CACHING_NONE) {
> + if(ret != 0)
> + igt_assert_eq(ret, -ENXIO);
> + else
> + igt_warn("Deprecated userptr SET_CACHING behavior\n");
> + } else {
> + igt_assert_eq(ret, 0);
> + }
> gem_close(i915, handle);
> }
>
> gem_userptr(i915, page, 4096, 0, 0, &handle);
> - for (int idx = 0; idx < ARRAY_SIZE(levels); idx++)
> - igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
> - for (int idx = 0; idx < ARRAY_SIZE(levels); idx++)
> - igt_assert_eq(__gem_set_caching(i915, handle, levels[idx]), 0);
> + for (int idx = 0; idx < ARRAY_SIZE(levels); idx++) {
> + ret = __gem_set_caching(i915, handle, levels[idx]);
> + if (levels[idx] == I915_CACHING_NONE) {
> + if (ret != 0)
> + igt_assert_eq(ret, -ENXIO);
> + else
> + igt_warn("Deprecated userptr SET_CACHING behavior\n");
I didn't realize this would result in the warning getting printed three
times which is pointless. I think we can just delete this 'else' and the
one below, just retain the one at the top.
Sorry I didn't realize it earlier so you'll need to spin this one more
time.
> + } else {
> + igt_assert_eq(ret, 0);
> + }
> + }
> + for (int idx = 0; idx < ARRAY_SIZE(levels); idx++) {
> + ret = __gem_set_caching(i915, handle, levels[idx]);
> + if (levels[idx] == I915_CACHING_NONE) {
> + if (ret != 0)
> + igt_assert_eq(ret, -ENXIO);
> + else
> + igt_warn("Deprecated userptr SET_CACHING behavior\n");
> + } else {
> + igt_assert_eq(ret, 0);
> + }
> + }
> gem_close(i915, handle);
>
> munmap(page, 4096);
> --
> 2.30.0
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2021-05-21 6:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 6:02 [igt-dev] [Patch V4] [i-g-t] tests/i915: test pass for no caching case viswax.krishna.raveendra.talabattula
2021-05-21 6:11 ` Dixit, Ashutosh [this message]
2021-05-21 7:07 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915: test pass for no caching case (rev3) Patchwork
2021-05-22 22:09 ` [igt-dev] ✓ Fi.CI.IGT: " 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=87im3cehu9.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=Mahesh.Meena@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=viswax.krishna.raveendra.talabattula@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 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.