1
0
xorg-x11-server/commit-78f50cd.diff

107 lines
4.1 KiB
Diff

commit 78f50cd5758d778a5b01aa607c04919b69a5a47f
Author: Kristian Høgsberg <krh@redhat.com>
Date: Tue Aug 26 10:58:35 2008 -0400
Fix driGetConfigAttribIndex unaligned access to GLboolean.
We don't actually send the float mode so just drop it. Drop a couple of
other unused or redundant fields from GLXconfig.
diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 0831135..95221a7 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -907,7 +907,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
p = 0;
buf[p++] = modes->visualID;
buf[p++] = glxConvertToXVisualType( modes->visualType );
- buf[p++] = modes->rgbMode;
+ buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE;
buf[p++] = modes->redBits;
buf[p++] = modes->greenBits;
@@ -959,7 +959,7 @@ int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
return Success;
}
-#define __GLX_TOTAL_FBCONFIG_ATTRIBS (35)
+#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36)
#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)
/**
* Send the set of GLXFBConfigs to the client. There is not currently
@@ -1011,7 +1011,9 @@ DoGetFBConfigs(__GLXclientState *cl, unsigned screen)
WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID );
WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE );
- WRITE_PAIR( GLX_RGBA, modes->rgbMode );
+ WRITE_PAIR( GLX_RGBA,
+ (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE );
+ WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType );
WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode );
WRITE_PAIR( GLX_STEREO, modes->stereoMode );
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c
index 3285835..faaa3b7 100644
--- a/glx/glxdricommon.c
+++ b/glx/glxdricommon.c
@@ -88,7 +88,6 @@ static const struct { unsigned int attrib, offset; } attribMap[] = {
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_GREEN_VALUE, transparentGreen),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_BLUE_VALUE, transparentBlue),
__ATTRIB(__DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE, transparentAlpha),
- __ATTRIB(__DRI_ATTRIB_FLOAT_MODE, floatMode),
__ATTRIB(__DRI_ATTRIB_RED_MASK, redMask),
__ATTRIB(__DRI_ATTRIB_GREEN_MASK, greenMask),
__ATTRIB(__DRI_ATTRIB_BLUE_MASK, blueMask),
@@ -136,16 +135,11 @@ createModeFromConfig(const __DRIcoreExtension *core,
while (core->indexConfigAttrib(driConfig, i++, &attrib, &value)) {
switch (attrib) {
case __DRI_ATTRIB_RENDER_TYPE:
- if (value & __DRI_ATTRIB_RGBA_BIT) {
+ config->config.renderType = 0;
+ if (value & __DRI_ATTRIB_RGBA_BIT)
config->config.renderType |= GLX_RGBA_BIT;
- config->config.rgbMode = GL_TRUE;
- } else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) {
+ if (value & __DRI_ATTRIB_COLOR_INDEX_BIT)
config->config.renderType |= GLX_COLOR_INDEX_BIT;
- config->config.rgbMode = GL_FALSE;
- } else {
- config->config.renderType = 0;
- config->config.rgbMode = GL_FALSE;
- }
break;
case __DRI_ATTRIB_CONFIG_CAVEAT:
if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
@@ -164,10 +158,6 @@ createModeFromConfig(const __DRIcoreExtension *core,
if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT)
config->config.bindToTextureTargets |= GLX_TEXTURE_RECTANGLE_BIT_EXT;
break;
- case __DRI_ATTRIB_FLOAT_MODE:
- config->config.floatMode = (value ? GL_TRUE : GL_FALSE);
- break;
-
default:
setScalar(&config->config, attrib, value);
break;
diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index 39d162d..ea47db4 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -58,16 +58,9 @@ void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
typedef struct __GLXconfig __GLXconfig;
struct __GLXconfig {
__GLXconfig *next;
- GLboolean rgbMode;
- GLboolean floatMode;
- GLboolean colorIndexMode;
GLuint doubleBufferMode;
GLuint stereoMode;
- GLboolean haveAccumBuffer;
- GLboolean haveDepthBuffer;
- GLboolean haveStencilBuffer;
-
GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */
GLuint redMask, greenMask, blueMask, alphaMask;
GLint rgbBits; /* total bits for rgb */