From: Rob Herring <[email protected]>
Fixes crashes in Mesa on platform device, which expected *device to
have a device when 0 was returned.
(code from a paste by Rob, commit message by anholt)
Signed-off-by: Eric Anholt <[email protected]>
---
xf86drm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/xf86drm.c b/xf86drm.c
index 9cfca49ddfda..9b52889e4cef 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
closedir(sysdir);
free(local_devices);
+ if (*device == NULL)
+ return -ENODEV;
return 0;
free_devices:
--
2.9.3
glxgears was spamming this 12 times at startup because of Mesa's
probing of the DRM device code, which doesn't support platform
devices.
Signed-off-by: Eric Anholt <[email protected]>
---
xf86drm.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/xf86drm.c b/xf86drm.c
index 9b52889e4cef..52add5e441d7 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3149,7 +3149,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
break;
default:
- fprintf(stderr, "The subsystem type is not supported yet\n");
continue;
}
@@ -3259,7 +3258,6 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
break;
default:
- fprintf(stderr, "The subsystem type is not supported yet\n");
continue;
}
--
2.9.3
On Fri, Oct 21, 2016 at 1:12 PM, Eric Anholt <[email protected]> wrote:
> From: Rob Herring <[email protected]>
>
> Fixes crashes in Mesa on platform device, which expected *device to
> have a device when 0 was returned.
>
> (code from a paste by Rob, commit message by anholt)
>
> Signed-off-by: Eric Anholt <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
> ---
> xf86drm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 9cfca49ddfda..9b52889e4cef 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
>
> closedir(sysdir);
> free(local_devices);
> + if (*device == NULL)
> + return -ENODEV;
> return 0;
>
> free_devices:
> --
> 2.9.3
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
On 21 October 2016 at 18:12, Eric Anholt <[email protected]> wrote:
> From: Rob Herring <[email protected]>
>
> Fixes crashes in Mesa on platform device, which expected *device to
> have a device when 0 was returned.
>
> (code from a paste by Rob, commit message by anholt)
>
> Signed-off-by: Eric Anholt <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Thanks
Emil
On Fri, Oct 21, 2016 at 1:12 PM, Eric Anholt <[email protected]> wrote:
> glxgears was spamming this 12 times at startup because of Mesa's
> probing of the DRM device code, which doesn't support platform
> devices.
>
> Signed-off-by: Eric Anholt <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
> ---
> xf86drm.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/xf86drm.c b/xf86drm.c
> index 9b52889e4cef..52add5e441d7 100644
> --- a/xf86drm.c
> +++ b/xf86drm.c
> @@ -3149,7 +3149,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
>
> break;
> default:
> - fprintf(stderr, "The subsystem type is not supported yet\n");
> continue;
> }
>
> @@ -3259,7 +3258,6 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
>
> break;
> default:
> - fprintf(stderr, "The subsystem type is not supported yet\n");
> continue;
> }
>
> --
> 2.9.3
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
On 21 October 2016 at 18:12, Eric Anholt <[email protected]> wrote:
> glxgears was spamming this 12 times at startup because of Mesa's
> probing of the DRM device code, which doesn't support platform
> devices.
>
Better option is to add support for platform devices. Can we get
anyone interested in that ?
If we drop (the annoying) printf people will just ignore/forget about
it, and things will fall through the cracks - similar to the 5+ pokes
(at various people) to add support.
On the cool side - it will allow you to use the DRI_PRIME/driconf's
device_id=libudev_path_id_tag to manage the devices on your system.
Thanks
Emil
Emil Velikov <[email protected]> writes:
> On 21 October 2016 at 18:12, Eric Anholt <[email protected]> wrote:
>> glxgears was spamming this 12 times at startup because of Mesa's
>> probing of the DRM device code, which doesn't support platform
>> devices.
>>
> Better option is to add support for platform devices. Can we get
> anyone interested in that ?
I agree it would be good but it certainly isn't remotely near the top of
my todo list. I'm just fixing up regressions.