Re: [RFC PATCH i-g-t] lib/i915: Restrict mmap types to GTT if no MMAP_OFFSET support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Chris Wilson (2020-02-20 16:09:14)
> Quoting Janusz Krzysztofik (2020-02-20 15:32:03)
> > Commit b0da8bb705c0 ("lib/i915: for_each_mmap_offset_type()")
> > introduced a macro that makes it easy to repeat a test body within a
> > loop for each mmap-offset mapping type supported by v4 of i915 MMAP_GTT
> > API. However, when run on an older version of the driver, those
> > subtests are believed to be still repeated for each known mmap-offset
> > mapping type while effectively exercising GTT mapping type only.  As
> > that may be confusing, fix it.
> > 
> > It has been assumed that the modified macro is still suitable for use
> > inside gem_mmap_offset test itself.  Would that not be case,
> > gem_mmap_offset could redefine the macro back to its initial form for
> > internal use.
> > 
> > Suggested-by: Michał Winiarski <michal.winiarski@xxxxxxxxx>
> > Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@xxxxxxxxxxxxxxx>
> > Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > ---
> >  lib/i915/gem_mman.h          |  5 +++--
> >  tests/i915/gem_ctx_sseu.c    |  2 +-
> >  tests/i915/gem_exec_params.c |  2 +-
> >  tests/i915/gem_madvise.c     | 18 ++++++++++++++----
> >  tests/i915/gem_mmap_offset.c | 10 +++++-----
> >  tests/i915/i915_pm_rpm.c     |  2 +-
> >  6 files changed, 25 insertions(+), 14 deletions(-)
> > 
> > diff --git a/lib/i915/gem_mman.h b/lib/i915/gem_mman.h
> > index 4fc6a0186..491767023 100644
> > --- a/lib/i915/gem_mman.h
> > +++ b/lib/i915/gem_mman.h
> > @@ -101,9 +101,10 @@ extern const struct mmap_offset {
> >         unsigned int domain;
> >  } mmap_offset_types[];
> >  
> > -#define for_each_mmap_offset_type(__t) \
> > +#define for_each_mmap_offset_type(fd, __t) \
> >         for (const struct mmap_offset *__t = mmap_offset_types; \
> > -            (__t)->name; \
> > +            (__t)->name && (gem_has_mmap_offset(fd) || \
> > +                            (__t)->type == I915_MMAP_OFFSET_GTT); \
> 
> Sigh.
> 
> extern bool gem_has_mmap_offset_type(int i915, const struct mmap_offset *t);
> 
> && gem_has_mmap_offset_type(fd, t)

Sorry, make that

	for_each_if(gem_has_mmap_offset_type(i915, t))
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux