[PATCH libdrm] libdrm: Allow dynamic drm majors on linux

Thomas Hellstrom thellstrom at vmware.com
Fri Aug 31 13:05:20 UTC 2018


Hi, Emil
On 08/31/2018 02:30 PM, Emil Velikov wrote:
> Hi Thomas,
>
> On 31 August 2018 at 12:54, Thomas Hellstrom <thellstrom at vmware.com> wrote:
>> To determine whether a device node is a drm device node or not, the code
>> currently compares the node's major number to the static drm major device
>> number.
>>
>> This breaks the standalone vmwgfx driver on XWayland dri clients,
>>
> Any particular reason why the code doesn't use a fixed node there?
> It will make the diff vs the in-kernel driver a bit smaller.
Because then it won't be able to interoperate with other in-tree 
drivers, like virtual drm drivers or passthrough usb drm drivers.
There is no clean way to share the minor number allocation with in-tree 
drm, so standalone vmwgfx is using dynamic major allocation.

>
>> and any future attempt to introduce dynamic device numbers for drm.
>>
> I'm not sure how well any such attempt will pan out, regardless of the
> libdrm checks.
>
> Namely: the static 226 has been used by a number of tools that
> interpose the libc' ioctl function.
> There could be others that also depend on it.

True, in any case for existing drivers changing static 226 to something 
else is at least 10+ years away according to Linus' policy, so the main 
issue here is really to get rid of a big annoyance in the standalone 
vmwgfx case.

/Thomas


>
> Personally, I'd go with the kernel developers decision.
>
> Dave, Daniel, others
> Should we keep or drop the major == 226 checks.
>
> Thanks
> Emil




More information about the dri-devel mailing list