[igt-dev] [PATCH i-g-t v3] lib/i915: Add mmap_offset support
Chris Wilson
chris at chris-wilson.co.uk
Tue Feb 26 19:36:06 UTC 2019
Quoting Antonio Argenziano (2019-02-26 19:29:50)
>
>
> On 26/02/19 10:47, Chris Wilson wrote:
> > Quoting Antonio Argenziano (2019-02-26 18:44:17)
> >>
> >>
> >> On 26/02/19 10:29, Chris Wilson wrote:
> >>> Quoting Antonio Argenziano (2019-02-26 18:23:53)
> >>>> +bool has_mmap_offset(int fd)
> >>>
> >>> Prefix please.
> >>>
> >>>> +{
> >>>> + static int has_mmap_offset = -1;
> >>>
> >>> What's our plan to avoiding the static?
> >>
> >> How about: make the variable not static and remove the if?
> >>
> >>>
> >>> I don't think we need the statics for these, as their use should be
> >>> limited to fixtures. Once plan has been decided upon, enact it for all
> >>> in gem_mman.c :)
> >>
> >> OK, there isn't really much in gem_mman, I'll add a patch before this
> >> one to remove what is there and not add this here.
> >>
> >> Antonio
> >>
> >>>
> >>>> +
> >>>> + if (has_mmap_offset == -1) {
> >>>> + struct drm_i915_getparam gp;
> >>>> +
> >>>> + has_mmap_offset = 0;
> >>>> +
> >>>> + memset(&gp, 0, sizeof(gp));
> >>>> + gp.param = 0x55; /* I915_PARAM_MMAP_OFFSET_VERSION */
> >
> > Waitasec... I thought we would be overloading the MMAP_GTT_VERSION since
> > we are overloading the MMAP_GTT?
>
> I think the idea was to have them separate, if we were to merge them
> what would you have return MMAP_GTT_VERSION, a new value or like a flag?
It doesn't make any difference, the param namespace is huge. It just
struck me as being a little disconnected.
-Chris
More information about the igt-dev
mailing list