summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-04-24 12:09:21 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-06-11 22:46:00 -0700
commit98c3c21735197fbd2c8166c9bdabf055e14c9009 (patch)
treedc73f6b35f7441d88afdd8e80677e8abd925f042
parent4cb4c210c365fd40ad314e0707eb38811f240a12 (diff)
DRI2: Add interface for drivers to query DRI2 extension version
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> (cherry picked from commit 28ddfc88d8d547941c7f4713db527a3c2f9ec35a)
-rw-r--r--hw/xfree86/dri2/dri2.c9
-rw-r--r--hw/xfree86/dri2/dri2.h18
2 files changed, 27 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 0b52a0f8c..80de18f86 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -380,3 +380,12 @@ static XF86ModuleVersionInfo DRI2VersRec =
_X_EXPORT XF86ModuleData dri2ModuleData = { &DRI2VersRec, DRI2Setup, NULL };
+void
+DRI2Version(int *major, int *minor)
+{
+ if (major != NULL)
+ *major = DRI2VersRec.majorversion;
+
+ if (minor != NULL)
+ *minor = DRI2VersRec.minorversion;
+}
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index 5e7fd65d5..e6c4b97d0 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -100,4 +100,22 @@ int DRI2CopyRegion(DrawablePtr pDraw,
unsigned int dest,
unsigned int src);
+/**
+ * Determine the major and minor version of the DRI2 extension.
+ *
+ * Provides a mechanism to other modules (e.g., 2D drivers) to determine the
+ * version of the DRI2 extension. While it is possible to peek directly at
+ * the \c XF86ModuleData from a layered module, such a module will fail to
+ * load (due to an unresolved symbol) if the DRI2 extension is not loaded.
+ *
+ * \param major Location to store the major verion of the DRI2 extension
+ * \param minor Location to store the minor verion of the DRI2 extension
+ *
+ * \note
+ * This interface was added some time after the initial release of the DRI2
+ * module. Layered modules that wish to use this interface must first test
+ * its existance by calling \c xf86LoaderCheckSymbol.
+ */
+extern _X_EXPORT void DRI2Version(int *major, int *minor);
+
#endif