summaryrefslogtreecommitdiff
path: root/xc
diff options
context:
space:
mode:
authoralanh <alanh>2001-01-23 18:03:02 +0000
committeralanh <alanh>2001-01-23 18:03:02 +0000
commit7e98f109ce7ab4296378174691135b1b98017f6c (patch)
treed8f1702cff705fee020c92dc4c8b752a582c1f9c /xc
parent8ff6f2dfa66971138176c8797fd0922cd71c1939 (diff)
ensure client side version checking.
Diffstat (limited to 'xc')
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c34
-rw-r--r--xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c34
2 files changed, 68 insertions, 0 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c b/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c
index 5edbabbac..88adce2ac 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_xmesa.c
@@ -56,6 +56,40 @@ static r128ContextPtr r128Ctx = NULL;
GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv )
{
sPriv->private = (void *) r128CreateScreen( sPriv );
+
+ /* Check the DRI version */
+ {
+ int major, minor, patch;
+ if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
+ if (major != 3 || minor != 1 || patch < 0) {
+ char msg[1000];
+ sprintf(msg, "R128 DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+ }
+ }
+
+ /* Check that the DDX driver version is compatible */
+ if (sPriv->ddxMajor != 4 ||
+ sPriv->ddxMinor != 0 ||
+ sPriv->ddxPatch < 0) {
+ char msg[1000];
+ sprintf(msg, "R128 DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+
+ /* Check that the DRM driver version is compatible */
+ if (sPriv->drmMajor != 2 ||
+ sPriv->drmMinor != 1 ||
+ sPriv->drmPatch < 4) {
+ char msg[1000];
+ sprintf(msg, "R128 DRI driver expected DRM driver version 2.1.x (x>=4) but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+
if ( !sPriv->private ) {
r128DestroyScreen( sPriv );
return GL_FALSE;
diff --git a/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c b/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c
index e4ff4301f..b99f67cd6 100644
--- a/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/radeon/radeon_xmesa.c
@@ -57,6 +57,40 @@ static radeonContextPtr radeonCtx = NULL;
GLboolean XMesaInitDriver( __DRIscreenPrivate *sPriv )
{
sPriv->private = (void *) radeonCreateScreen( sPriv );
+
+ /* Check the DRI version */
+ {
+ int major, minor, patch;
+ if (XF86DRIQueryVersion(sPriv->display, &major, &minor, &patch)) {
+ if (major != 3 || minor != 1 || patch < 0) {
+ char msg[1000];
+ sprintf(msg, "RADEON DRI driver expected DRI version 3.1.x but got version %d.%d.%d", major, minor, patch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+ }
+ }
+
+ /* Check that the DDX driver version is compatible */
+ if (sPriv->ddxMajor != 4 ||
+ sPriv->ddxMinor != 0 ||
+ sPriv->ddxPatch < 0) {
+ char msg[1000];
+ sprintf(msg, "RADEON DRI driver expected DDX driver version 4.0.x but got version %d.%d.%d", sPriv->ddxMajor, sPriv->ddxMinor, sPriv->ddxPatch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+
+ /* Check that the DRM driver version is compatible */
+ if (sPriv->drmMajor != 2 ||
+ sPriv->drmMinor != 1 ||
+ sPriv->drmPatch < 0) {
+ char msg[1000];
+ sprintf(msg, "RADEON DRI driver expected DRM driver version 2.1.x but got version %d.%d.%d", sPriv->drmMajor, sPriv->drmMinor, sPriv->drmPatch);
+ __driMesaMessage(msg);
+ return GL_FALSE;
+ }
+
if ( !sPriv->private ) {
radeonDestroyScreen( sPriv );
return GL_FALSE;