[igt-dev] [PATCH i-g-t 2/2] tests/gem_exec_basic: Add gem create fallback
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Thu Dec 9 13:27:00 UTC 2021
On Thu, Dec 09, 2021 at 01:21:41PM +0200, Petri Latvala wrote:
> On Wed, Dec 08, 2021 at 06:24:16PM +0100, Zbigniew Kempczyński wrote:
> > If we're on stable kernels which still don't have local memory turned on
> > provide a fallback to generic gem_create() call when requested region is
> > the system memory.
> >
> > Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> > Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
> > ---
> > tests/i915/gem_exec_basic.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/i915/gem_exec_basic.c b/tests/i915/gem_exec_basic.c
> > index 008a35d0a..6307e929c 100644
> > --- a/tests/i915/gem_exec_basic.c
> > +++ b/tests/i915/gem_exec_basic.c
> > @@ -28,12 +28,15 @@
> >
> > IGT_TEST_DESCRIPTION("Basic sanity check of execbuf-ioctl rings.");
> >
> > -static uint32_t batch_create(int fd, uint32_t batch_size, uint32_t region)
> > +static uint32_t batch_create(int fd, uint64_t batch_size, uint32_t region)
> > {
> > const uint32_t bbe = MI_BATCH_BUFFER_END;
> > uint32_t handle;
> > + int ret;
> >
> > - handle = gem_create_in_memory_regions(fd, batch_size, region);
> > + ret = __gem_create_in_memory_regions(fd, &handle, &batch_size, region);
> > + if (ret == -ENODEV && IS_SYSTEM_MEMORY_REGION(region))
> > + handle = gem_create(fd, batch_size);
> > gem_write(fd, handle, 0, &bbe, sizeof(bbe));
>
> Can't gem_create_in_memory_regions() do this fallback?
Hmm, I think I can provide such fallback within
__gem_create_in_memory_region_list() function. It would be suitable
for all tests. So I'm going to fix it and resubmit.
--
Zbigniew
>
> Anyway,
> Acked-by: Petri Latvala <petri.latvala at intel.com>
>
>
>
> >
> > return handle;
> > --
> > 2.26.0
> >
More information about the igt-dev
mailing list