From ca7c1d5e0289d8cc22a35063a599ca2047775314 Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Sat, 12 Sep 2015 01:01:42 +0200 Subject: [PATCH] launcher: Fix drm device detection for non pci devices On Odroid U2 (exynos4412) the drm device is not bound to pci. Open the detection to platform device of the drm subsystem, exclusive of control devices. https://bugzilla.gnome.org/show_bug.cgi?id=754911 --- src/backends/native/meta-launcher.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c index 54ab85c7c..34480cdc2 100644 --- a/src/backends/native/meta-launcher.c +++ b/src/backends/native/meta-launcher.c @@ -295,9 +295,9 @@ get_primary_gpu_path (const gchar *seat_name) if (!devices) goto out; - for (tmp = devices; tmp != NULL; tmp = tmp->next) + for (tmp = devices; tmp != NULL && path == NULL; tmp = tmp->next) { - GUdevDevice *pci_device; + GUdevDevice *platform_device = NULL, *pci_device = NULL; GUdevDevice *dev = tmp->data; gint boot_vga; const gchar *device_seat; @@ -324,20 +324,26 @@ get_primary_gpu_path (const gchar *seat_name) if (g_strcmp0 (seat_name, device_seat)) continue; + platform_device = g_udev_device_get_parent_with_subsystem (dev, "platform", NULL); pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL); - if (!pci_device) - continue; - /* get value of boot_vga attribute or 0 if the device has no boot_vga */ - boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga"); - g_object_unref (pci_device); - - if (boot_vga == 1) + if (platform_device != NULL) { - /* found the boot_vga device */ path = g_strdup (g_udev_device_get_device_file (dev)); - break; } + else if (pci_device != NULL) + { + /* get value of boot_vga attribute or 0 if the device has no boot_vga */ + boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga"); + if (boot_vga == 1) + { + /* found the boot_vga device */ + path = g_strdup (g_udev_device_get_device_file (dev)); + } + } + + g_object_unref (platform_device); + g_object_unref (pci_device); } g_list_free_full (devices, g_object_unref);