[PATCH:xf86-video-tegra] make TegraPlatformProbe actually work

Lucas Stach dev at lynxeye.de
Wed Dec 19 07:54:19 PST 2012


This is mostly the same thing as omapdrm does. Makes tegra work on
xservers with "Revert "xf86: Fix non-PCI configuration-less setups""
applied.

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 src/driver.c | 16 ++++++++--------
 1 Datei geändert, 8 Zeilen hinzugefügt(+), 8 Zeilen entfernt(-)

diff --git a/src/driver.c b/src/driver.c
index 1d14694..705c6c4 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -770,15 +770,13 @@ static Bool
 TegraPlatformProbe(DriverPtr driver, int entity_num, int flags,
                    struct xf86_platform_device *dev, intptr_t match_data)
 {
-    char *path = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
+    char *busid = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_BUSID);
     ScrnInfoPtr scrn = NULL;
-    int scr_flags = 0;
-
-    if (flags & PLATFORM_PROBE_GPU_SCREEN)
-        scr_flags = XF86_ALLOCATE_GPU_SCREEN;
+    int fd;
 
-    if (TegraProbeHardware(path)) {
-        scrn = xf86AllocateScreen(driver, scr_flags);
+    fd = drmOpen(NULL, busid);
+    if (fd != -1) {
+        scrn = xf86AllocateScreen(driver, 0);
 
         xf86AddEntityToScreen(scrn, entity_num);
 
@@ -794,7 +792,9 @@ TegraPlatformProbe(DriverPtr driver, int entity_num, int flags,
         scrn->ValidMode = TegraValidMode;
 
         xf86DrvMsg(scrn->scrnIndex, X_INFO, "using %s\n",
-                   path ? path : "default device");
+                   busid ? busid : "default device");
+
+        drmClose(fd);
     }
 
     return scrn != NULL;
-- 
1.7.11.7



More information about the xorg-devel mailing list