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
This commit is contained in:
parent
4a770907c1
commit
ca7c1d5e02
@ -295,9 +295,9 @@ get_primary_gpu_path (const gchar *seat_name)
|
|||||||
if (!devices)
|
if (!devices)
|
||||||
goto out;
|
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;
|
GUdevDevice *dev = tmp->data;
|
||||||
gint boot_vga;
|
gint boot_vga;
|
||||||
const gchar *device_seat;
|
const gchar *device_seat;
|
||||||
@ -324,22 +324,28 @@ get_primary_gpu_path (const gchar *seat_name)
|
|||||||
if (g_strcmp0 (seat_name, device_seat))
|
if (g_strcmp0 (seat_name, device_seat))
|
||||||
continue;
|
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);
|
pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL);
|
||||||
if (!pci_device)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
|
if (platform_device != NULL)
|
||||||
|
{
|
||||||
|
path = g_strdup (g_udev_device_get_device_file (dev));
|
||||||
|
}
|
||||||
|
else if (pci_device != NULL)
|
||||||
|
{
|
||||||
/* get value of boot_vga attribute or 0 if the device has no boot_vga */
|
/* 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");
|
boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga");
|
||||||
g_object_unref (pci_device);
|
|
||||||
|
|
||||||
if (boot_vga == 1)
|
if (boot_vga == 1)
|
||||||
{
|
{
|
||||||
/* found the boot_vga device */
|
/* found the boot_vga device */
|
||||||
path = g_strdup (g_udev_device_get_device_file (dev));
|
path = g_strdup (g_udev_device_get_device_file (dev));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (platform_device);
|
||||||
|
g_object_unref (pci_device);
|
||||||
|
}
|
||||||
|
|
||||||
g_list_free_full (devices, g_object_unref);
|
g_list_free_full (devices, g_object_unref);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
Loading…
Reference in New Issue
Block a user