aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx')
-rw-r--r--src/glx/Makefile1
-rw-r--r--src/glx/dri_common.c4
-rw-r--r--src/glx/glxconfig.c5
-rw-r--r--src/glx/glxconfig.h3
-rw-r--r--src/glx/glxcurrent.c10
-rw-r--r--src/glx/glxext.c4
-rw-r--r--src/glx/glxextensions.c2
-rw-r--r--src/glx/glxextensions.h2
-rw-r--r--src/glx/indirect.c4
9 files changed, 27 insertions, 8 deletions
diff --git a/src/glx/Makefile b/src/glx/Makefile
index 3d92ebbe038..dd96973ea8f 100644
--- a/src/glx/Makefile
+++ b/src/glx/Makefile
@@ -64,6 +64,7 @@ INCLUDES = -I. \
-I$(TOP)/src/mapi/glapi \
$(LIBDRM_CFLAGS) \
$(DRI2PROTO_CFLAGS) \
+ $(GLPROTO_CFLAGS) \
$(X11_INCLUDES)
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 83d6e3c3108..06a73e4a6b2 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -222,7 +222,9 @@ __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE,
bindToMipmapTexture),
- __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
+ __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),
+ __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable)
+};
static int
scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value)
diff --git a/src/glx/glxconfig.c b/src/glx/glxconfig.c
index 1d9678f48cd..c3e1d5a5680 100644
--- a/src/glx/glxconfig.c
+++ b/src/glx/glxconfig.c
@@ -188,6 +188,10 @@ glx_config_get(struct glx_config * mode, int attribute, int *value_return)
*value_return = mode->yInverted;
return 0;
+ case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
+ *value_return = mode->sRGBCapable;
+ return 0;
+
/* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX.
* It is ONLY for communication between the GLX client and the GLX
* server.
@@ -251,6 +255,7 @@ glx_config_create_list(unsigned count)
(*next)->bindToMipmapTexture = GLX_DONT_CARE;
(*next)->bindToTextureTargets = GLX_DONT_CARE;
(*next)->yInverted = GLX_DONT_CARE;
+ (*next)->sRGBCapable = GLX_DONT_CARE;
next = &((*next)->next);
}
diff --git a/src/glx/glxconfig.h b/src/glx/glxconfig.h
index f7ee958e4be..2f1074ca5fa 100644
--- a/src/glx/glxconfig.h
+++ b/src/glx/glxconfig.h
@@ -100,6 +100,9 @@ struct glx_config {
GLint bindToMipmapTexture;
GLint bindToTextureTargets;
GLint yInverted;
+
+ /* EXT_framebuffer_sRGB */
+ GLint sRGBCapable;
};
#define __GLX_MIN_CONFIG_PROPS 18
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c
index 9a6499037b1..1f845ce65e1 100644
--- a/src/glx/glxcurrent.c
+++ b/src/glx/glxcurrent.c
@@ -189,7 +189,7 @@ glXGetCurrentDrawable(void)
}
static void
-__glXGenerateError(Display * dpy, struct glx_context *gc, XID resource,
+__glXGenerateError(Display * dpy, XID resource,
BYTE errorCode, CARD16 minorCode)
{
xError error;
@@ -198,7 +198,7 @@ __glXGenerateError(Display * dpy, struct glx_context *gc, XID resource,
error.resourceID = resource;
error.sequenceNumber = dpy->request;
error.type = X_Error;
- error.majorCode = gc->majorOpcode;
+ error.majorCode = __glXSetupForCommand(dpy);
error.minorCode = minorCode;
_XError(dpy, &error);
}
@@ -235,12 +235,12 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
}
if (gc == NULL && (draw != None || read != None)) {
- __glXGenerateError(dpy, gc, (draw != None) ? draw : read,
+ __glXGenerateError(dpy, (draw != None) ? draw : read,
BadMatch, X_GLXMakeContextCurrent);
return False;
}
if (gc != NULL && (draw == None || read == None)) {
- __glXGenerateError(dpy, gc, None, BadMatch, X_GLXMakeContextCurrent);
+ __glXGenerateError(dpy, None, BadMatch, X_GLXMakeContextCurrent);
return False;
}
@@ -284,7 +284,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw,
__glXUnlock();
if (ret) {
- __glXGenerateError(dpy, gc, None, ret, X_GLXMakeContextCurrent);
+ __glXGenerateError(dpy, None, ret, X_GLXMakeContextCurrent);
return GL_FALSE;
}
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 25d266e18e1..e35dcb73e89 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -546,6 +546,10 @@ __glXInitializeVisualConfigFromTags(struct glx_config * config, int count,
config->yInverted = *bp++;
break;
#endif
+ case GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT:
+ config->sRGBCapable = *bp++;
+ break;
+
case GLX_USE_GL:
if (fbconfig_style_tags)
bp++;
diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c
index ffd466479b4..d6eb408309c 100644
--- a/src/glx/glxextensions.c
+++ b/src/glx/glxextensions.c
@@ -83,6 +83,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(EXT_visual_info), VER(0,0), Y, Y, N, N },
#endif
{ GLX(EXT_visual_rating), VER(0,0), Y, Y, N, N },
+ { GLX(EXT_framebuffer_sRGB), VER(0,0), Y, Y, N, N },
#ifdef GLX_USE_APPLEGL
{ GLX(MESA_agp_offset), VER(0,0), N, N, N, N }, /* Deprecated */
{ GLX(MESA_copy_sub_buffer), VER(0,0), N, N, N, N },
@@ -190,6 +191,7 @@ static const struct extension_info known_gl_extensions[] = {
{ GL(EXT_framebuffer_blit), VER(0,0), Y, N, N, N },
{ GL(EXT_framebuffer_multisample), VER(0,0), Y, N, N, N },
{ GL(EXT_framebuffer_object), VER(0,0), Y, N, N, N },
+ { GL(EXT_framebuffer_sRGB), VER(0,0), Y, N, N, N },
{ GL(EXT_multi_draw_arrays), VER(1,4), Y, N, Y, N },
{ GL(EXT_packed_depth_stencil), VER(0,0), Y, N, N, N },
{ GL(EXT_packed_pixels), VER(1,2), Y, N, N, N },
diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h
index 333b3f9adbd..4fa7a61d338 100644
--- a/src/glx/glxextensions.h
+++ b/src/glx/glxextensions.h
@@ -40,6 +40,7 @@ enum
EXT_visual_info_bit,
EXT_visual_rating_bit,
EXT_import_context_bit,
+ EXT_framebuffer_sRGB_bit,
MESA_agp_offset_bit,
MESA_copy_sub_buffer_bit,
MESA_depth_float_bit,
@@ -118,6 +119,7 @@ enum
GL_EXT_framebuffer_blit_bit,
GL_EXT_framebuffer_multisample_bit,
GL_EXT_framebuffer_object_bit,
+ GL_EXT_framebuffer_sRGB_bit,
GL_EXT_multi_draw_arrays_bit,
GL_EXT_packed_depth_stencil_bit,
GL_EXT_packed_pixels_bit,
diff --git a/src/glx/indirect.c b/src/glx/indirect.c
index f79175b760d..b2675c2958f 100644
--- a/src/glx/indirect.c
+++ b/src/glx/indirect.c
@@ -10717,5 +10717,5 @@ __indirect_get_proc_address(const char *name)
#endif /* GLX_SHARED_GLAPI */
-#undef FASTCALL
-#undef NOINLINE
+# undef FASTCALL
+# undef NOINLINE