ecore-drm: Fix drm cards on ARM platform not having boot_vga parameter
authorChris Michael <cp.michael@samsung.com>
Wed, 8 Oct 2014 14:06:45 +0000 (10:06 -0400)
committerChris Michael <cp.michael@samsung.com>
Wed, 8 Oct 2014 14:06:45 +0000 (10:06 -0400)
Summary:
On some ARM platforms, the drivers do not list boot_vga as an
attribute, so we cannot do checks for that. This patch fixes finding
drm cards on those platforms by skipping the boot_vga check if we had
to use "platform" to find it.

Thanks to shiin for the report :)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_drm/ecore_drm_device.c

index 7e43ad2..e3e46be 100644 (file)
@@ -152,6 +152,7 @@ ecore_drm_device_find(const char *name, const char *seat)
 {
    Ecore_Drm_Device *dev = NULL;
    Eina_Bool found = EINA_FALSE;
+   Eina_Bool platform = EINA_FALSE;
    Eina_List *devs, *l;
    const char *device;
 
@@ -189,17 +190,23 @@ ecore_drm_device_find(const char *name, const char *seat)
           {
              devparent = 
                eeze_udev_syspath_get_parent_filtered(device, "platform", NULL);
+             platform = EINA_TRUE;
           }
 
         if (devparent)
           {
-             const char *id;
-
-             if ((id = eeze_udev_syspath_get_sysattr(devparent, "boot_vga")))
+             if (!platform)
                {
-                  if (!strcmp(id, "1")) found = EINA_TRUE;
-                  eina_stringshare_del(id);
+                  const char *id;
+
+                  if ((id = eeze_udev_syspath_get_sysattr(devparent, "boot_vga")))
+                    {
+                       if (!strcmp(id, "1")) found = EINA_TRUE;
+                       eina_stringshare_del(id);
+                    }
                }
+             else
+               found = EINA_TRUE;
 
              eina_stringshare_del(devparent);
           }