All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Mark Yacoub <markyacoub@chromium.org>
Cc: Vidya Srinivas <vidya.srinivas@intel.com>,
	Development mailing list for IGT GPU Tools
	<igt-dev@lists.freedesktop.org>,
	"Modem, Bhanuprakash" <Bhanuprakash.Modem@intel.com>,
	Mark Yacoub <markyacoub@google.com>
Subject: Re: [igt-dev] [PATCH i-g-t] lib/i915/intel_memory_region: Fix regression on 5.4 kernel
Date: Fri, 17 Sep 2021 09:21:35 +0200	[thread overview]
Message-ID: <20210917072135.GA5022@zkempczy-mobl2> (raw)
In-Reply-To: <CAJUqKUrnH7grhjC8deuZs9qjsJGKJvoLKoRj3TyyFpgL5BG6pg@mail.gmail.com>

On Thu, Sep 16, 2021 at 11:25:30AM -0400, Mark Yacoub wrote:
> On Thu, Sep 16, 2021 at 10:24 AM Vidya Srinivas
> <vidya.srinivas@intel.com> wrote:
> >
> > Starting commit 8759c4a3020ce4 "Add intel_buf_init_in_region"
> > __intel_buf_init uses gem_create_in_memory_regions instead of
> > gem_create. Older kernels like 5.4 still dont have support for
> > I915_GEM_CREATE_EXT_MEMORY_REGIONS (i915_gem_create_ext_ioctl)
> > from kernel commit (https://patchwork.freedesktop.org/patch/431581/?series=89648&rev=1)
> > Due to this, the flip-vs-fences tests are failing on kernel 5.4
> > Patch add roll back to gem_create when __gem_create_in_memory_region_list fails.
> >
> > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > ---
> >  lib/i915/intel_memory_region.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
> > index 3de40549319b..323b96bad232 100644
> > --- a/lib/i915/intel_memory_region.c
> > +++ b/lib/i915/intel_memory_region.c
> > @@ -209,7 +209,9 @@ uint32_t gem_create_in_memory_region_list(int fd, uint64_t size,
> >         uint32_t handle;
> >         int ret = __gem_create_in_memory_region_list(fd, &handle, size,
> >                                                      mem_regions, num_regions);
> > -       igt_assert_eq(ret, 0);
> > +       if (ret != 0)
> > +               handle = gem_create(fd, size);

> I'm not sure if this change should be here or should be at the caller
> `void __intel_buf_init(...).

I agree, silent fallback to system memory when mem_regions could contain
only device memory is definitely not we want.

You may leave this function intact and call underscored (not-asserting)
version of __gem_create_in_memory_regions() in __intel_buf_init(), then
react to result. I mean if region _is_ system memory fallback to gem_create()
is possible, otherwise assert.

--
Zbigniew

> > +
> Let's have a check before we return, parallel to the removed `
> igt_assert_eq(ret, 0);`, Something like `igt_assert(!ret || handle).`
> >         return handle;
> >  }
> >
> > --
> > 2.33.0
> >

  reply	other threads:[~2021-09-17  7:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 14:12 [igt-dev] [PATCH i-g-t] lib/i915/intel_memory_region: Fix regression on 5.4 kernel Vidya Srinivas
2021-09-16 15:25 ` Mark Yacoub
2021-09-17  7:21   ` Zbigniew Kempczyński [this message]
2021-09-20  8:16     ` Srinivas, Vidya
2021-09-16 17:12 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-09-16 19:52 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-09-20  7:56 ` [igt-dev] [PATCH i-g-t] lib/intel_bufops: " Vidya Srinivas
2021-09-20  8:00   ` Vidya Srinivas
2021-09-20  9:24     ` Zbigniew Kempczyński
2021-09-20  9:40       ` Srinivas, Vidya
2021-09-20  9:44         ` Zbigniew Kempczyński
2021-09-20  9:24     ` Vidya Srinivas
2021-09-20  9:46       ` Zbigniew Kempczyński
2021-09-20 10:12         ` Srinivas, Vidya
2021-09-20 10:32           ` Modem, Bhanuprakash
2021-09-20 11:01             ` Srinivas, Vidya
2021-09-20 17:28             ` Zbigniew Kempczyński
2021-09-21  4:55               ` Srinivas, Vidya
2021-09-20 10:47       ` [igt-dev] [PATCH] " Vidya Srinivas
2021-09-20  9:10 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/i915/intel_memory_region: Fix regression on 5.4 kernel (rev3) Patchwork
2021-09-20 10:26 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2021-09-20 11:03 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/i915/intel_memory_region: Fix regression on 5.4 kernel (rev4) Patchwork
2021-09-20 11:28 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/i915/intel_memory_region: Fix regression on 5.4 kernel (rev5) 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=20210917072135.GA5022@zkempczy-mobl2 \
    --to=zbigniew.kempczynski@intel.com \
    --cc=Bhanuprakash.Modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=markyacoub@chromium.org \
    --cc=markyacoub@google.com \
    --cc=vidya.srinivas@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.