[mutter] launcher: Fix drm device detection for non pci devices



commit ca7c1d5e0289d8cc22a35063a599ca2047775314
Author: Alban Browaeys <prahal yahoo com>
Date:   Sat Sep 12 01:01:42 2015 +0200

    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 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c
index 54ab85c..34480cd 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]