[Mesa-dev] [PATCH 2/2] egl: Don't add hardware device if there is no render node.

Mathias Fröhlich Mathias.Froehlich at gmx.net
Mon Jun 10 10:11:40 UTC 2019


Hi Emil,

On Friday, 7 June 2019 15:43:48 CEST Emil Velikov wrote:
> On Thu, 6 Jun 2019 at 12:10, <Mathias.Froehlich at gmx.net> wrote:
> >
> > From: Mathias Fröhlich <Mathias.Froehlich at gmx.net>
> >
> > Do not offer a hardware drm backed egl device if no render node
> > is available.
> As far as I can see current implementation does _not_ add the DRM
> device if its missing render node (and a primary one).
> Looking at the change below, it's effectively making the primary node optional.
> 
> Hence the comment does not alight with the code - old and new. Can you
> elaborate?

The currently pushed implementation asks drmGetDevices2 for a list of
devices and all devices with either a render node or a master node or both
are added as hardware device. This check is the bitmasking test with
device->available_nodes that you have put near the top of _eglAddDRMDevice.
So, if there is no render node the hardware device is added.
Later on the filename of the render node as returned from
_eglGetDRMDeviceRenderNode is opened which does not succeed in that case.
egInitialize fails then which is not nice.

Past my change, a pure hardware device is not added if there is no render node.
That is decided by this above mentioned bitmask test.

The codepath that adds devices via _eglAddDevice from all the platforms is
untouched as this still uses the same bitmask as before.
I did not check this code path specifically above the call to _eglAddDevice
as this patch does not change the behavior of this case.

best

Mathias

> 
> I have not thought exactly how primary node-less DRM will work out
> esp. since the EGL_EXT_device_drm extension explicitly mentions one.
> 
> -Emil
> 






More information about the mesa-dev mailing list