summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Bornecrantz <jakob@vmware.com>2010-01-21 21:23:22 +0100
committerJakob Bornecrantz <jakob@vmware.com>2010-01-25 11:24:55 +0100
commit36fd55f9f03b00263ee1ccf22bbb50e5ba048e80 (patch)
tree36c89a0704291e112276a369d94a8344bb61aa0d /src
parent16cf7e14a6dee85fadc0ab4e7c066288c3362352 (diff)
st/xorg: Export helper function for detecting modesetting
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c22
-rw-r--r--src/gallium/state_trackers/xorg/xorg_winsys.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index 41bfcd0f5e..c180f0b156 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -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
diff --git a/src/gallium/state_trackers/xorg/xorg_winsys.h b/src/gallium/state_trackers/xorg/xorg_winsys.h
index 47ee4b9ffd..865733bca2 100644
--- a/src/gallium/state_trackers/xorg/xorg_winsys.h
+++ b/src/gallium/state_trackers/xorg/xorg_winsys.h
@@ -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