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

Dave Airlie airlied at kemper.freedesktop.org
Wed May 9 01:34:45 PDT 2012


 configure.ac |    6 ------
 src/driver.c |   35 ++++++++++++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 7 deletions(-)

New commits:
commit ff16713c53bcb750cab723ba3314d9188d23e7e0
Author: Matt Turner <mattst88 at gmail.com>
Date:   Wed May 9 00:26:29 2012 -0400

    configure.ac: remove DRI and RENDER
    
    Driver doesn't support either of these.
    
    Signed-off-by: Matt Turner <mattst88 at gmail.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/configure.ac b/configure.ac
index aa4ae9f..30f875c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,14 +53,8 @@ AC_ARG_WITH(xorg-module-dir,
             [moduledir="$withval"],
             [moduledir="$libdir/xorg/modules"])
 
-AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
-                                  [Disable DRI support [[default=auto]]]),
-              [DRI="$enableval"],
-              [DRI=auto])
-
 # Checks for extensions
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
-XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
 XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
commit 0ecfdf19a9745ad4a0c8680b6dae542f50d3a212
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed May 9 09:32:05 2012 +0100

    modesetting: make sure the pci device corresponds to the drm device
    
    If we get asked to pci open a device with a kms path override,
    make sure they match, otherwise this driver can steal the primary
    device binding for a usb adaptor.
    
    The driver should fallback to the old probe entry point in this case.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/src/driver.c b/src/driver.c
index 2c9878c..e977150 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -198,6 +198,39 @@ static Bool probe_hw(char *dev)
     return FALSE;
 }
 
+static char *
+ms_DRICreatePCIBusID(const struct pci_device *dev)
+{
+    char *busID;
+
+    if (asprintf(&busID, "pci:%04x:%02x:%02x.%d",
+                 dev->domain, dev->bus, dev->dev, dev->func) == -1)
+        return NULL;
+
+    return busID;
+}
+
+
+static Bool probe_hw_pci(char *dev, struct pci_device *pdev)
+{
+    int fd = open_hw(dev);
+    char *id, *devid;
+
+    if (fd == -1)
+	return FALSE;
+
+    id = drmGetBusid(fd);
+    devid = ms_DRICreatePCIBusID(pdev);
+    close(fd);
+
+    if (!id || !devid)
+	return FALSE;
+
+    if (!strcmp(id, devid))
+	return TRUE;
+
+    return FALSE;
+}
 static const OptionInfoRec *
 AvailableOptions(int chipid, int busid)
 {
@@ -219,7 +252,7 @@ ms_pci_probe(DriverPtr driver,
 						  scrn->entityInstanceList[0]);
 
 	devpath = xf86FindOptionValue(devSection->options, "kmsdev");
-	if (probe_hw(devpath)) {
+	if (probe_hw_pci(devpath, dev)) {
 	    scrn->driverVersion = 1;
 	    scrn->driverName = "modesetting";
 	    scrn->name = "modeset";


More information about the xorg-commit mailing list