On Wed, Jul 19, 2017 at 08:37:06AM -0700, Gurchetan Singh wrote: > On ChromeOS devices, readdir() processes the directory in > the following order: > > -NAME- -TYPE- > . n/a > .. n/a > vgem n/a > card1 DRM_BUS_PLATFORM > renderD129 DRM_BUS_PLATFORM > card0 DRM_BUS_PCI > renderD128 DRM_BUS_PCI > controlD64 DRM_BUS_PCI > > In drmGetDevices2, after drmProcessPlatformDevice fails for > /dev/dri/card1, we don't process the remaining directory entries. > As such, Vulkan fails to initialize since Mesa uses drmGetDevices2. > To fix this, continue if drmProcessPlatformDevice fails. > --- > xf86drm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) I'm not sure this is a good fix. drmProcessPlatformDevice() is only supposed to fail in fatal situations, such as out-of-memory. So the reason it doesn't continue is that it doesn't make sense to. In the case of out-of-memory situations, for example, the next allocation is assumed to fail as well. Now, reading the code again, maybe the reason it is failing is because the code tries to look for OF_FULLNAME and OF_COMPATIBLE_N and may not find them. I suspect that card1 and renderD129 are from a vgem device, which is, as far as I can tell, the only case of a platform device without an OF node. In that case I think we should fix drmProcessPlatformDevice() to deal with those cases instead (make the list of compatibles optional, and fallback to some other mechanism to determine the name). Otherwise we will be silently ignoring errors and skipping devices that we really shouldn't. Thierry
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel