Re: DRI backwards compatibility problem from X.Org 6.8.0 onwards

Kevin E Martin <[email protected]>
Newsgroups gmane.comp.freedesktop.release-wranglers,gmane.comp.video.dri.devel
Message-ID <[email protected]>
On Sat, Dec 11, 2004 at 12:52:45AM +0000, Alan Hourihane wrote:
> On Fri, Dec 10, 2004 at 07:04:51PM +0000, Alan Hourihane wrote:
> > Folks,
> > 
> > There's a backwards compatibility breakage with X.Org 6.8.0 and beyond
> > because of revision 1.3 of the file xc/include/glxint.h. So, those
> > that provide binary drivers that were compiled against X.Org 6.7.x or
> > XFree86 4.4.0 or earlier will break as well.
> > 
> > The problem stems from these additional fields in the GLXvisualConfigRec
> > which actually are not needed. 
> > 
> >     int multiSampleSize;
> >     int nMultiSampleBuffers;
> >     int visualSelectGroup;
> 
> Ah,
> 
> It seems as though the DMX code probably added these as it makes use
> of them. 

I just checked and these were added by SGI when they did their glxProxy
work that was included with DMX.  Guy Zadikario <guy-sJ/[email protected]> was the
principle author of glxProxy.  I would recommend contacting him to see
if there is another way to implement support for the additional extended
visual properties that would maintain backwards compatibility.  I assume
they were added to support SGI's OpenGL implementation.

One workaround is to surround those fields in GLXvisualConfigRec and the
glxProxy code that uses those fields with #ifdef __sgi/#endif (see patch
attached below).  This would be good to do for 6.8.2 to regain backwards
compatibility.

Alan, do you have a test case that you could use to make sure that I've
not missed anything?

Also, I've created a bugzilla entry for this problem:

    https://bugs.freedesktop.org/show_bug.cgi?id=2070

Thanks,
Kevin

_______________________________________________
release-wranglers mailing list
release-wranglers-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/release-wranglers
glxproxy-compat.patch (text/plain, 4.1 KB)
Index: include/GL/glxint.h
===================================================================
RCS file: /cvs/xorg/xc/include/GL/glxint.h,v
retrieving revision 1.3
diff -u -r1.3 glxint.h
--- include/GL/glxint.h	30 Jun 2004 20:06:52 -0000	1.3
+++ include/GL/glxint.h	13 Dec 2004 02:28:07 -0000
@@ -50,15 +50,21 @@
 				/*    colors are floats scaled to ints */
     int transparentRed, transparentGreen, transparentBlue, transparentAlpha;
     int transparentIndex;
+#ifdef __sgi
     int multiSampleSize;
     int nMultiSampleBuffers;
     int visualSelectGroup;
+#endif
 };
 
 #define __GLX_MIN_CONFIG_PROPS	18
 #define __GLX_MAX_CONFIG_PROPS	500
 
+#ifdef __sgi
 #define __GLX_EXT_CONFIG_PROPS 	10
+#else
+#define __GLX_EXT_CONFIG_PROPS 	7
+#endif
 
 /*
 ** Since we send all non-core visual properties as token, value pairs,
Index: programs/Xserver/hw/dmx/dmx_glxvisuals.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/dmx/dmx_glxvisuals.c,v
retrieving revision 1.1
diff -u -r1.1 dmx_glxvisuals.c
--- programs/Xserver/hw/dmx/dmx_glxvisuals.c	30 Jun 2004 20:06:53 -0000	1.1
+++ programs/Xserver/hw/dmx/dmx_glxvisuals.c	13 Dec 2004 02:28:08 -0000
@@ -147,12 +147,14 @@
 	    int value = *p++;
 
 	    switch (property) {
+#ifdef __sgi
 	      case GLX_SAMPLES_SGIS:
 		config->multiSampleSize = value;
 		break;
 	      case GLX_SAMPLE_BUFFERS_SGIS:
 		config->nMultiSampleBuffers = value;
 		break;
+#endif
 
 	      case GLX_TRANSPARENT_TYPE_EXT:
 		config->transparentPixel = value;
@@ -177,10 +179,12 @@
 		config->visualRating = value;
 		break;
 
+#ifdef __sgi
 	      /* visualSelectGroup is an internal used property */
 	      case GLX_VISUAL_SELECT_GROUP_SGIX:
 		config->visualSelectGroup = value;
 		break;
+#endif
 
 	      default :
 		/* Ignore properties we don't recognize */
@@ -591,9 +595,11 @@
 	  cfg->transparentBlue = fbcfg->transparentBlue;
 	  cfg->transparentAlpha = fbcfg->transparentAlpha;
 	  cfg->transparentIndex = fbcfg->transparentIndex;
+#ifdef __sgi
 	  cfg->multiSampleSize = fbcfg->multiSampleSize;
 	  cfg->nMultiSampleBuffers = fbcfg->nMultiSampleBuffers;
 	  cfg->visualSelectGroup = fbcfg->visualSelectGroup;
+#endif
        }
     }
 
Index: programs/Xserver/hw/dmx/glxProxy/glxcmds.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/dmx/glxProxy/glxcmds.c,v
retrieving revision 1.2
diff -u -r1.2 glxcmds.c
--- programs/Xserver/hw/dmx/glxProxy/glxcmds.c	6 Jul 2004 23:51:00 -0000	1.2
+++ programs/Xserver/hw/dmx/glxProxy/glxcmds.c	13 Dec 2004 02:28:08 -0000
@@ -1607,12 +1607,14 @@
 	buf[p++] = pGlxVisual->transparentAlpha;
 	buf[p++] = GLX_TRANSPARENT_INDEX_VALUE_EXT;
 	buf[p++] = pGlxVisual->transparentIndex;
+#ifdef __sgi
 	buf[p++] = GLX_SAMPLES_SGIS;
 	buf[p++] = pGlxVisual->multiSampleSize;
 	buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;
 	buf[p++] = pGlxVisual->nMultiSampleBuffers;
 	buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
 	buf[p++] = pGlxVisual->visualSelectGroup;
+#endif
 
 	WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, 
 		(char *)buf);
Index: programs/Xserver/hw/dmx/glxProxy/glxvisuals.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/dmx/glxProxy/glxvisuals.c,v
retrieving revision 1.1
diff -u -r1.1 glxvisuals.c
--- programs/Xserver/hw/dmx/glxProxy/glxvisuals.c	30 Jun 2004 20:06:55 -0000	1.1
+++ programs/Xserver/hw/dmx/glxProxy/glxvisuals.c	13 Dec 2004 02:28:09 -0000
@@ -71,10 +71,13 @@
 	   (v1->transparentGreen == v2->transparentGreen) &&
 	   (v1->transparentBlue == v2->transparentBlue) &&
 	   (v1->transparentAlpha == v2->transparentAlpha) &&
-	   (v1->transparentIndex == v2->transparentIndex) &&
-	   (v1->multiSampleSize == v2->multiSampleSize) &&
+	   (v1->transparentIndex == v2->transparentIndex)
+#ifdef __sgi
+	   && (v1->multiSampleSize == v2->multiSampleSize) &&
 	   (v1->nMultiSampleBuffers == v2->nMultiSampleBuffers) &&
-	   (v1->visualSelectGroup == v2->visualSelectGroup)         ) {
+	   (v1->visualSelectGroup == v2->visualSelectGroup)
+#endif
+	  ) {
 
 	      return(1);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.