[igt-dev] [PATCH i-g-t v3] lib/i915: Add mmap_offset support

Antonio Argenziano antonio.argenziano at intel.com
Tue Feb 26 19:29:50 UTC 2019



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?

Antonio

> -Chris
> 


More information about the igt-dev mailing list