diff --git a/debian/patches/drm_device_keep_trying.patch b/debian/patches/drm_device_keep_trying.patch index 3f45cf2..7ba03f6 100644 --- a/debian/patches/drm_device_keep_trying.patch +++ b/debian/patches/drm_device_keep_trying.patch @@ -16,11 +16,9 @@ Signed-off-by: Bryce Harrington hw/xfree86/os-support/linux/lnx_platform.c | 29 +++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) -diff --git a/config/udev.c b/config/udev.c -index 454838f..af133d2 100644 --- a/config/udev.c +++ b/config/udev.c -@@ -98,7 +98,7 @@ device_added(struct udev_device *udev_device) +@@ -98,7 +98,7 @@ if (strncmp(sysname, "card", 4) != 0) return; @@ -29,7 +27,7 @@ index 454838f..af133d2 100644 config_udev_odev_setup_attribs(path, syspath, NewGPUDeviceRequest); return; -@@ -267,7 +267,7 @@ device_removed(struct udev_device *device) +@@ -267,7 +267,7 @@ if (strncmp(sysname,"card", 4) != 0) return; @@ -38,7 +36,15 @@ index 454838f..af133d2 100644 if (!path) return; -@@ -437,6 +437,16 @@ config_udev_odev_setup_attribs(const char *path, const char *syspath, +@@ -425,6 +425,7 @@ + { + struct OdevAttributes *attribs = config_odev_allocate_attribute_list(); + int ret; ++ const char *platform; + + if (!attribs) + return FALSE; +@@ -437,6 +438,32 @@ if (ret == FALSE) goto fail; @@ -50,13 +56,27 @@ index 454838f..af133d2 100644 + strncpy(pci_str + 4, end - 12, 12); + ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_BUSID, pci_str); + } ++ } else if ((platform = strstr(syspath, "/devices/platform/"))) { ++ const char *end; ++ platform += 18; ++ end = strchr(platform, '.'); ++ if (end) { ++ char *busid; ++ ret = asprintf(&busid, "platform:%.*s:%02li\n", ++ (int)(end - platform), platform, strtol(end + 1, NULL, 10)); ++ if (ret >= 0) { ++ ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_BUSID, busid); ++ free(busid); ++ } ++ else ret = FALSE; ++ } + } ++ if (ret == FALSE) ++ goto fail; + /* ownership of attribs is passed to probe layer */ probe_callback(attribs); return TRUE; -diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c -index 76f5583..11bb9fc 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c @@ -17,36 +17,6 @@ @@ -96,15 +116,15 @@ index 76f5583..11bb9fc 100644 Bool xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid) { -@@ -119,10 +89,7 @@ xf86PlatformDeviceProbe(struct OdevAttributes *attribs) +@@ -119,10 +89,7 @@ LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path); -+ xf86_add_platform_device(attribs); - ret = get_drm_info(attribs, path); - if (ret == FALSE) - goto out_free; - ++ xf86_add_platform_device(attribs); return; out_free: