st/xorg: Export helper function for detecting modesetting
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 21 Jan 2010 20:23:22 +0000 (21:23 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Mon, 25 Jan 2010 10:24:55 +0000 (11:24 +0100)
src/gallium/state_trackers/xorg/xorg_driver.c
src/gallium/state_trackers/xorg/xorg_winsys.h

index 41bfcd0f5e74a2a538cd0936b765db34077f0205..c180f0b15676f0b55b53fe5ee7f8701fe78315d3 100644 (file)
@@ -110,6 +110,28 @@ xorg_tracker_set_functions(ScrnInfoPtr scrn)
     scrn->ValidMode = drv_valid_mode;
 }
 
+Bool
+xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device)
+{
+    char *BusID = xalloc(64);
+    sprintf(BusID, "pci:%04x:%02x:%02x.%d",
+           device->domain, device->bus,
+           device->dev, device->func);
+
+    if (drmCheckModesettingSupported(BusID)) {
+       xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
+                      "Drm modesetting not supported %s\n", BusID);
+       xfree(BusID);
+       return FALSE;
+    }
+
+    xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
+                  "Drm modesetting supported on %s\n", BusID);
+
+    xfree(BusID);
+    return TRUE;
+}
+
 
 /*
  * Internal function definitions
index 47ee4b9ffd8a9b7f5d550ad902fe399c5e7dbc02..865733bca2bd6a6d9b27c7de212a781c6443a757 100644 (file)
@@ -45,5 +45,6 @@
 
 void xorg_tracker_set_functions(ScrnInfoPtr scrn);
 const OptionInfoRec * xorg_tracker_available_options(int chipid, int busid);
+Bool xorg_tracker_have_modesetting(ScrnInfoPtr pScrn, struct pci_device *device);
 
 #endif