Mesa (master): st/xorg: Guard against realy old versions of Xorg

Jakob Bornecrantz wallbraker at kemper.freedesktop.org
Wed Sep 2 19:01:38 UTC 2009


Module: Mesa
Branch: master
Commit: 7d8f33590f656e406b35cebc7144e958e829ca3e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7d8f33590f656e406b35cebc7144e958e829ca3e

Author: Jakob Bornecrantz <jakob at vmware.com>
Date:   Wed Sep  2 19:48:49 2009 +0200

st/xorg: Guard against realy old versions of Xorg

---

 src/gallium/state_trackers/xorg/xorg_dri2.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c
index 537ce2d..6431a0f 100644
--- a/src/gallium/state_trackers/xorg/xorg_dri2.c
+++ b/src/gallium/state_trackers/xorg/xorg_dri2.c
@@ -79,11 +79,13 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format)
     case DRI2BufferFrontLeft:
 	break;
     case DRI2BufferStencil:
+#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2
     case DRI2BufferDepthStencil:
 	if (exa_priv->depth_stencil_tex &&
 	    !pf_is_depth_stencil(exa_priv->depth_stencil_tex->format))
 	    exa_priv->depth_stencil_tex = NULL;
         /* Fall through */
+#endif
     case DRI2BufferDepth:
 	if (exa_priv->depth_stencil_tex)
 	    pipe_texture_reference(&tex, exa_priv->depth_stencil_tex);
@@ -151,7 +153,7 @@ driDoDestroyBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer)
     (*pScreen->DestroyPixmap)(private->pPixmap);
 }
 
-#if DRI2INFOREC_VERSION > 2
+#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2
 
 static DRI2BufferPtr
 driCreateBuffer(DrawablePtr pDraw, unsigned int attachment, unsigned int format)
@@ -336,13 +338,17 @@ driScreenInit(ScreenPtr pScreen)
     modesettingPtr ms = modesettingPTR(pScrn);
     DRI2InfoRec dri2info;
 
+#if defined(DRI2INFOREC_VERSION)
     dri2info.version = DRI2INFOREC_VERSION;
+#else
+    dri2info.version = 1;
+#endif
     dri2info.fd = ms->fd;
 
     dri2info.driverName = pScrn->driverName;
     dri2info.deviceName = "/dev/dri/card0"; /* FIXME */
 
-#if DRI2INFOREC_VERSION > 2
+#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2
     dri2info.CreateBuffer = driCreateBuffer;
     dri2info.DestroyBuffer = driDestroyBuffer;
 #else




More information about the mesa-commit mailing list