These are not all the changes, sorry for that.<br><br>It seems I don't know how to correctly re-send the patch.<br><br><div class="gmail_quote">2012/12/4 <span dir="ltr"><<a href="mailto:listom@gmail.com" target="_blank">listom@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">From: Tomasz Lis <<a href="mailto:tomasz.lis@intel.com">tomasz.lis@intel.com</a>><br>
<br>
Changes to correctly initialize the sRGB capability attribute and<br>
transfer it between XServer and the client. Modifications include<br>
extension string, transferring visual config attribs and fbconfig<br>
attribs. Also, attribute is initialized in the modules which do not<br>
really use it (xquartz and xwin).<br>
</div>This version advertises both ARB and EXT strings, and initializes<br>
the capability to default value of FALSE.<br>
<div class="im"><br>
Signed-off-by: Tomasz Lis <<a href="mailto:tomasz.lis@intel.com">tomasz.lis@intel.com</a>><br>
---<br>
</div> glx/extension_string.c | 2 ++<br>
glx/extension_string.h | 2 ++<br>
<div class="im"> glx/glxcmds.c | 7 +++++--<br>
glx/glxdri2.c | 7 +++++++<br>
glx/glxdricommon.c | 4 +++-<br>
glx/glxscreens.c | 2 ++<br>
glx/glxscreens.h | 3 +++<br>
hw/xquartz/GL/visualConfigs.c | 3 +++<br>
hw/xwin/glx/indirect.c | 2 ++<br>
</div> 9 files changed, 29 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/glx/extension_string.c b/glx/extension_string.c<br>
index 544ca1f..70dc915 100644<br>
--- a/glx/extension_string.c<br>
+++ b/glx/extension_string.c<br>
@@ -71,9 +71,11 @@ static const struct extension_info known_glx_extensions[] = {<br>
{ GLX(ARB_create_context), VER(0,0), N, },<br>
{ GLX(ARB_create_context_profile), VER(0,0), N, },<br>
{ GLX(ARB_create_context_robustness), VER(0,0), N, },<br>
+ { GLX(ARB_framebuffer_sRGB), VER(1,1), N, },<br>
<div class="im"> { GLX(ARB_multisample), VER(1,4), Y, },<br>
<br>
{ GLX(EXT_create_context_es2_profile), VER(0,0), N, },<br>
+ { GLX(EXT_framebuffer_sRGB), VER(1,1), N, },<br>
{ GLX(EXT_import_context), VER(0,0), Y, },<br>
{ GLX(EXT_texture_from_pixmap), VER(0,0), Y, },<br>
{ GLX(EXT_visual_info), VER(0,0), Y, },<br>
diff --git a/glx/extension_string.h b/glx/extension_string.h<br>
</div>index 7a4a8b1..3ce5593 100644<br>
--- a/glx/extension_string.h<br>
+++ b/glx/extension_string.h<br>
@@ -39,8 +39,10 @@ enum {<br>
ARB_create_context_bit = 0,<br>
ARB_create_context_profile_bit,<br>
ARB_create_context_robustness_bit,<br>
+ ARB_framebuffer_sRGB_bit,<br>
<div><div class="h5"> ARB_multisample_bit,<br>
EXT_create_context_es2_profile_bit,<br>
+ EXT_framebuffer_sRGB_bit,<br>
EXT_import_context_bit,<br>
EXT_texture_from_pixmap_bit,<br>
EXT_visual_info_bit,<br>
diff --git a/glx/glxcmds.c b/glx/glxcmds.c<br>
index c1f4e22..720a1a8 100644<br>
--- a/glx/glxcmds.c<br>
+++ b/glx/glxcmds.c<br>
@@ -913,7 +913,7 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)<br>
<br>
enum {<br>
GLX_VIS_CONFIG_UNPAIRED = 18,<br>
- GLX_VIS_CONFIG_PAIRED = 20<br>
+ GLX_VIS_CONFIG_PAIRED = 22<br>
};<br>
<br>
enum {<br>
@@ -1005,6 +1005,8 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)<br>
buf[p++] = modes->samples;<br>
buf[p++] = GLX_SAMPLE_BUFFERS_SGIS;<br>
buf[p++] = modes->sampleBuffers;<br>
+ buf[p++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT;<br>
+ buf[p++] = modes->sRGBCapable;<br>
buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */<br>
buf[p++] = 0;<br>
<br>
@@ -1017,7 +1019,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)<br>
return Success;<br>
}<br>
<br>
-#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36)<br>
+#define __GLX_TOTAL_FBCONFIG_ATTRIBS (37)<br>
#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2)<br>
/**<br>
* Send the set of GLXFBConfigs to the client. There is not currently<br>
@@ -1109,6 +1111,7 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)<br>
WRITE_PAIR(GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture);<br>
WRITE_PAIR(GLX_BIND_TO_TEXTURE_TARGETS_EXT,<br>
modes->bindToTextureTargets);<br>
+ WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable);<br>
<br>
if (client->swapped) {<br>
__GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH);<br>
diff --git a/glx/glxdri2.c b/glx/glxdri2.c<br>
index bce1bfa..ef7afb4 100644<br>
--- a/glx/glxdri2.c<br>
+++ b/glx/glxdri2.c<br>
@@ -882,6 +882,13 @@ initializeExtensions(__GLXDRIscreen * screen)<br>
"AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n");<br>
}<br>
<br>
+ /* enable EXT_framebuffer_sRGB extension (even if there are no sRGB capable fbconfigs) */<br>
+ {<br>
+ __glXEnableExtension(screen->glx_enable_bits,<br>
+ "GLX_EXT_framebuffer_sRGB");<br>
+ LogMessage(X_INFO, "AIGLX: enabled GLX_EXT_framebuffer_sRGB\n");<br>
+ }<br>
+<br>
for (i = 0; extensions[i]; i++) {<br>
#ifdef __DRI_READ_DRAWABLE<br>
if (strcmp(extensions[i]->name, __DRI_READ_DRAWABLE) == 0) {<br>
diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c<br>
index c90f380..b027f24 100644<br>
--- a/glx/glxdricommon.c<br>
+++ b/glx/glxdricommon.c<br>
@@ -105,7 +105,9 @@ __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),<br>
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb),<br>
__ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGBA, bindToTextureRgba),<br>
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),<br>
- __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};<br>
+ __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),<br>
+ __ATTRIB(__DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE, sRGBCapable),<br>
+ };<br>
<br>
static void<br>
setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value)<br>
diff --git a/glx/glxscreens.c b/glx/glxscreens.c<br>
index 61d590c..e87256d 100644<br>
--- a/glx/glxscreens.c<br>
+++ b/glx/glxscreens.c<br>
@@ -164,7 +164,9 @@ static char GLXServerVendorName[] = "SGI";<br>
unsigned glxMajorVersion = SERVER_GLX_MAJOR_VERSION;<br>
unsigned glxMinorVersion = SERVER_GLX_MINOR_VERSION;<br>
static char GLXServerExtensions[] =<br>
+ "GLX_ARB_framebuffer_sRGB "<br>
"GLX_ARB_multisample "<br>
+ "GLX_EXT_framebuffer_sRGB "<br>
"GLX_EXT_visual_info "<br>
"GLX_EXT_visual_rating "<br>
"GLX_EXT_import_context "<br>
diff --git a/glx/glxscreens.h b/glx/glxscreens.h<br>
index b29df58..0a7b604 100644<br>
--- a/glx/glxscreens.h<br>
+++ b/glx/glxscreens.h<br>
@@ -102,6 +102,9 @@ struct __GLXconfig {<br>
GLint bindToMipmapTexture;<br>
GLint bindToTextureTargets;<br>
GLint yInverted;<br>
+<br>
+ /* ARB_framebuffer_sRGB */<br>
+ GLint sRGBCapable;<br>
};<br>
<br>
GLint glxConvertToXVisualType(int visualType);<br>
diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c<br>
</div></div>index e37eefb..5efd04f 100644<br>
<div class="im">--- a/hw/xquartz/GL/visualConfigs.c<br>
+++ b/hw/xquartz/GL/visualConfigs.c<br>
@@ -326,6 +326,9 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)<br>
c->bindToTextureTargets = 0;<br>
c->yInverted = 0;<br>
<br>
+ /* EXT_framebuffer_sRGB */<br>
</div>+ c->sRGBCapable = GL_FALSE;<br>
<div class="im">+<br>
c = c->next;<br>
}<br>
}<br>
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c<br>
</div>index c0069a2..e6faf19 100644<br>
<div class="im">--- a/hw/xwin/glx/indirect.c<br>
+++ b/hw/xwin/glx/indirect.c<br>
@@ -2017,6 +2017,7 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen)<br>
c->base.bindToMipmapTexture = -1;<br>
c->base.bindToTextureTargets = -1;<br>
c->base.yInverted = -1;<br>
</div>+ c->base.sRGBCapable = 0;<br>
<div class="im"><br>
n++;<br>
<br>
@@ -2411,6 +2412,7 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen)<br>
GLX_TEXTURE_1D_BIT_EXT | GLX_TEXTURE_2D_BIT_EXT |<br>
GLX_TEXTURE_RECTANGLE_BIT_EXT;<br>
c->base.yInverted = -1;<br>
</div>+ c->base.sRGBCapable = 0;<br>
<div class="HOEnZb"><div class="h5"><br>
n++;<br>
<br>
--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
<a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
Info: <a href="http://lists.x.org/mailman/listinfo/xorg-devel" target="_blank">http://lists.x.org/mailman/listinfo/xorg-devel</a><br>
</div></div></blockquote></div><br>