Mesa (mesa_7_7_branch): st/xorg: Export helper function for detecting modesetting
Jakob Bornecrantz
wallbraker at kemper.freedesktop.org
Mon Jan 25 11:53:12 UTC 2010
Module: Mesa
Branch: mesa_7_7_branch
Commit: 36fd55f9f03b00263ee1ccf22bbb50e5ba048e80
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=36fd55f9f03b00263ee1ccf22bbb50e5ba048e80
Author: Jakob Bornecrantz <jakob at vmware.com>
Date: Thu Jan 21 21:23:22 2010 +0100
st/xorg: Export helper function for detecting modesetting
---
src/gallium/state_trackers/xorg/xorg_driver.c | 22 ++++++++++++++++++++++
src/gallium/state_trackers/xorg/xorg_winsys.h | 1 +
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 41bfcd0..c180f0b 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 47ee4b9..865733b 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
More information about the mesa-commit
mailing list