[Mesa-dev] [RFC] egl/android: Add DRM node probing and filtering

Tomasz Figa tfiga at chromium.org
Fri Apr 20 07:38:41 UTC 2018


On Fri, Apr 20, 2018 at 4:17 PM Robert Foss <robert.foss at collabora.com>
wrote:



> On 04/20/2018 06:41 AM, Tomasz Figa wrote:
> > Hi Rob,
> >
> > On Thu, Apr 19, 2018 at 1:03 AM Robert Foss <robert.foss at collabora.com>
> > wrote:
> >
> >> This patch both adds support for probing & filtering DRM nodes
> >> and switches away from using the GRALLOC_MODULE_PERFORM_GET_DRM_FD
> >> gralloc call.
> >
> >> Currently the filtering is based just on the driver name,
> >> and the desired name is supplied using the "drm.gpu.vendor_name"
> >> Android property.
> >
> >> The filtering itself is done using the newly introduced
> >> libdrm drmHandleMatch() call.
> >
> >> Signed-off-by: Robert Foss <robert.foss at collabora.com>
> >> ---
> >
> >> This patch is based on[1], which contains a new libdrm function,
> >> called drmHandleMatch(), which allows for matching an opened
> >> drm node handle against some desired properties.
> >
> >> A choice that was made for this patch was to add support for
> >> falling back to to DRM nodes that have failed the filtering,
> >> if no node passes the filter.
> >> If this wouldn't be useful to anyone, I would suggest ripping it
> >> out since it is a little bit ugly&complex.
> >
> > This is actually not only useful, but quite of a requirement for Chrome
OS,
> > where we use the same Android image for devices with different GPU
vendors.
> > (Technically we could hack it up by injecting some per-board properties,
> > but it would be painful from maintenance point of view.)

> Ack, I'll remove the fallback.

Sorry, I mean a fallback is needed. :) (+/- the missing driver check)


> >
> > But actually, the way it is implemented in this patch will not work. The
> > code assumes that the first DRM node that could be opened
> > (loader_open_device()) is fine, but if you look at what we do in our
> > Chromium patch [2], it is actually necessary to check if Mesa includes a
> > driver for it (loader_get_driver_for_fd()).
> >
> > [2]
> >
https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/780797

> Ack, I'll add a check for a driver existing.

SGTM.

Best regards,
Tomasz


More information about the mesa-dev mailing list