From c264ef264f0936632a1603fef45c59a50369631d Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 5 Jan 2018 11:37:38 -0600 Subject: [PATCH] ecore_drm2: Don't fail if there's no boot_vga device In a multi-seat configuration it's quite likely that only one seat will have a boot_vga device. While we should use the boot_vga device if possible, we shouldn't fail just because a seat's gpu isn't the boot_vga device. Fallback to the last viable drm device we saw. Reported-by: n3rdopolis ref D5712 ref T6455 --- src/lib/ecore_drm2/ecore_drm2_device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c index 21963c98fb..67cfebbd8c 100644 --- a/src/lib/ecore_drm2/ecore_drm2_device.c +++ b/src/lib/ecore_drm2/ecore_drm2_device.c @@ -95,7 +95,7 @@ static const char * _drm2_device_find(Elput_Manager *em, const char *seat) { Eina_List *devs, *l; - const char *dev, *ret = NULL; + const char *dev, *ret = NULL, *chosen_dev = NULL; Eina_Bool found = EINA_FALSE; Eina_Bool platform = EINA_FALSE; Eina_Bool modeset; @@ -141,6 +141,7 @@ _drm2_device_find(Elput_Manager *em, const char *seat) { const char *id; + chosen_dev = dev; id = eeze_udev_syspath_get_sysattr(dparent, "boot_vga"); if (id) { @@ -160,9 +161,9 @@ cont: if (found) break; } - if (!found) goto out; + if (!chosen_dev) goto out; - ret = eeze_udev_syspath_get_devpath(dev); + ret = eeze_udev_syspath_get_devpath(chosen_dev); out: EINA_LIST_FREE(devs, dev)