[Mesa-dev] Removing GRALLOC_MODULE_PERFORM_GET_DRM_FD

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 26 13:12:18 UTC 2018


On 26 March 2018 at 14:08, Tomasz Figa <tfiga at chromium.org> wrote:
> On Mon, Mar 26, 2018 at 9:45 PM, Robert Foss <robert.foss at collabora.com> wrote:
>> Hey,
>>
>> On 03/23/2018 06:21 PM, Emil Velikov wrote:
>>>
>>> On 23 March 2018 at 16:20, Tomasz Figa <tfiga at chromium.org> wrote:
>>>>
>>>> On Sat, Mar 24, 2018 at 12:55 AM, Emil Velikov <emil.l.velikov at gmail.com>
>>>> wrote:
>>>>>
>>>>> On 23 March 2018 at 13:15, Tomasz Figa <tfiga at chromium.org> wrote:
>>>>>
>>>>>>
>>>>>> Perhaps we could try to use drmOpenWithType() [2]. We could have one
>>>>>> property that would be passed as "name" argument and another property
>>>>>> for "busid" argument. I assume "type" would be always RENDER?
>>>>>>
>>>>> I would strongly encourage against using the drmOpen* API, it's a DRI1
>>>>> remnant.
>>>>> It might work in a particular instance, but has a number of serious
>>>>> flaws. Some highlights:
>>>>>   - using busid works only with PCI devices
>>>>>   - open() w/o O_CLOEXEC
>>>>>   - when build w/o udev - it creates a node: mkdir, chown(root), chmod,
>>>>> mknod
>>>>>   - calls back into Xserver/DDX module
>>>>>   - last but no least - borderline hacks with massive documentation [1]
>>>>> to keep this running.
>>>>
>>>>
>>>> I wasn't aware of that. Thanks for pointing this out.
>>>>
>>>> Still, I think matching by name and/or bus ID would make sense,
>>>> wouldn't it? Perhaps Mesa already has some helpers for that?
>>>>
>>> Indeed it does make sense. AFAICT there's no such helper - yet no
>>> objections to adding one ;-)
>>
>>
>> So, I guess having one would be helpful.
>> Where should it live, and what should it be built ontop of?
>
> There is some code of similar purpose in src/loader/loader.c, e.g.
> loader_open_device(). Emil, does it sound like a reasonable place?
>
Right, should have mentioned it - src/loader/loader.c is the place
from mesa POV.

Thanks
Emil


More information about the mesa-dev mailing list