diff mbox series

[libdrm,1/2] xf86drm: fallback to DRIVER uevent entry when OF_FULLNAME fails

Message ID 20181018200737.5953-2-christian.gmeiner@gmail.com (mailing list archive)
State New, archived
Headers show
Series xf86drm: add OF_ fallback mechanism | expand

Commit Message

Christian Gmeiner Oct. 18, 2018, 8:07 p.m. UTC
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Emil Velikov Oct. 25, 2018, 1:34 p.m. UTC | #1
On Thu, 18 Oct 2018 at 21:07, Christian Gmeiner
<christian.gmeiner@gmail.com> wrote:
>
> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> ---
>  xf86drm.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 10df682b..4ee1337b 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3516,6 +3516,8 @@ static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
>      snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
>
>      name = sysfs_uevent_get(path, "OF_FULLNAME");
> +    if (!name)
> +        name = sysfs_uevent_get(path, "DRIVER");

This workaround will work for etnaviv, but not for all platform devices.
Personally, I'd recommend reverting the Mesa patch for now... I'm
checking with some kernel-savvy people how we can resolve thing
properly.

-Emil
Christian Gmeiner Oct. 25, 2018, 4:07 p.m. UTC | #2
Am Do., 25. Okt. 2018 um 15:35 Uhr schrieb Emil Velikov
<emil.l.velikov@gmail.com>:
>
> On Thu, 18 Oct 2018 at 21:07, Christian Gmeiner
> <christian.gmeiner@gmail.com> wrote:
> >
> > Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
> > ---
> >  xf86drm.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/xf86drm.c b/xf86drm.c
> > index 10df682b..4ee1337b 100644
> > --- a/xf86drm.c
> > +++ b/xf86drm.c
> > @@ -3516,6 +3516,8 @@ static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
> >      snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
> >
> >      name = sysfs_uevent_get(path, "OF_FULLNAME");
> > +    if (!name)
> > +        name = sysfs_uevent_get(path, "DRIVER");
>
> This workaround will work for etnaviv, but not for all platform devices.
> Personally, I'd recommend reverting the Mesa patch for now... I'm
> checking with some kernel-savvy people how we can resolve thing
> properly.

I am fine with that - will prepare a revert patch.
diff mbox series

Patch

diff --git a/xf86drm.c b/xf86drm.c
index 10df682b..4ee1337b 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3516,6 +3516,8 @@  static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
 
     name = sysfs_uevent_get(path, "OF_FULLNAME");
+    if (!name)
+        name = sysfs_uevent_get(path, "DRIVER");
     if (!name)
         return -ENOENT;