xf86-video-modesetting: 2 commits - configure.ac src/driver.c

Maarten Lankhorst mlankhorst at kemper.freedesktop.org
Wed Jun 12 05:12:58 PDT 2013


 configure.ac |    2 +-
 src/driver.c |   28 ++++++++++++++++++++--------
 2 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit 58d3dc53a89c5aa2acfc93e4ae5719dd92b785b9
Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date:   Wed Jun 12 14:11:53 2013 +0200

    bump to 0.8.0
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>

diff --git a/configure.ac b/configure.ac
index f0c267f..6f7a7be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-modesetting],
-        [0.7.0],
+        [0.8.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-modesetting])
 AC_CONFIG_SRCDIR([Makefile.am])
commit a299400b8404f935e5e2bc6a5b9c17821844bd0d
Author: Maarten Lankhorst <maarten.lankhorst at canonical.com>
Date:   Wed Jun 12 14:05:19 2013 +0200

    modesetting: probe only succeeds if connectors are detected
    
    This will prevent modesetting being used for outputless intel or nvidia cards.
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>

diff --git a/src/driver.c b/src/driver.c
index c3d78be..cc526f6 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -201,12 +201,25 @@ static int open_hw(char *dev)
     return fd;
 }
 
+static int check_outputs(int fd)
+{
+    drmModeResPtr res = drmModeGetResources(fd);
+    int ret;
+
+    if (!res)
+        return FALSE;
+    ret = res->count_connectors > 0;
+    drmModeFreeResources(res);
+    return ret;
+}
+
 static Bool probe_hw(char *dev)
 {
     int fd = open_hw(dev);
     if (fd != -1) {
+        int ret = check_outputs(fd);
         close(fd);
-        return TRUE;
+        return ret;
     }
     return FALSE;
 }
@@ -226,7 +239,7 @@ ms_DRICreatePCIBusID(const struct pci_device *dev)
 
 static Bool probe_hw_pci(char *dev, struct pci_device *pdev)
 {
-    int fd = open_hw(dev);
+    int ret = FALSE, fd = open_hw(dev);
     char *id, *devid;
     drmSetVersion sv;
 
@@ -247,13 +260,12 @@ static Bool probe_hw_pci(char *dev, struct pci_device *pdev)
     devid = ms_DRICreatePCIBusID(pdev);
     close(fd);
 
-    if (!id || !devid)
-	return FALSE;
-
-    if (!strcmp(id, devid))
-	return TRUE;
+    if (id && devid && !strcmp(id, devid))
+        ret = check_outputs(fd);
 
-    return FALSE;
+    free(id);
+    free(devid);
+    return ret;
 }
 static const OptionInfoRec *
 AvailableOptions(int chipid, int busid)


More information about the xorg-commit mailing list