[Mesa-dev] [PATCH 1/2] egl/egldevice: Fix broken reference to dev->device without LIBDRM

Ilia Mirkin imirkin at alum.mit.edu
Thu Dec 27 21:02:35 UTC 2018


Based on looking at the commit in question, I guess it was meant to be used in

+#ifdef HAVE_LIBDRM
+   case EGL_DRM_DEVICE_FILE_EXT:
+      if (_eglDeviceSupports(dev, _EGL_DEVICE_DRM))
+         return dev->device->nodes[DRM_NODE_PRIMARY];
+      /* fall through */
+#endif

If so I'd rather stick the entire function under a HAVE_LIBDRM guard
instead of having it return NULL unexpectedly. But I'd definitely like
to hear from Emil in case I'm missing something.

On Thu, Dec 27, 2018 at 3:59 PM Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>
> I don't see this function used anywhere... it's not exported either.
>
> It was added in dbb4457d9858fa977246aa5e9cabe83455022dfe by Emil as
> part of EGL_EXT_device_drm, but appears unused in that commit as well.
>
> Emil - can this function just be removed perhaps?
>
>   -ilia
>
> On Thu, Dec 27, 2018 at 3:47 PM Alexander von Gluck IV
> <kallisti5 at unixzen.com> wrote:
> >
> > ---
> >  src/egl/main/egldevice.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c
> > index 4878039be0..96042f4c5c 100644
> > --- a/src/egl/main/egldevice.c
> > +++ b/src/egl/main/egldevice.c
> > @@ -211,7 +211,11 @@ _eglDeviceSupports(_EGLDevice *dev, _EGLDeviceExtension ext)
> >  const char *
> >  _eglGetDRMDeviceRenderNode(_EGLDevice *dev)
> >  {
> > -   return dev->device->nodes[DRM_NODE_RENDER];
> > +   const char* result = NULL;
> > +#ifdef HAVE_LIBDRM
> > +   result = dev->device->nodes[DRM_NODE_RENDER];
> > +#endif
> > +   return result;
> >  }
> >
> >  EGLBoolean
> > --
> > 2.14.5
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list