Hello,<br><br>Are there any other issues with this patch?<br>Is there anything more needed for it to be commited?<br><br>Regards,<br>Tomasz Lis<br><br><div class="gmail_quote">2013/1/9 Tomasz Lis <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">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>
This version advertises both ARB and EXT strings, and initializes<br>
the capability to default value of FALSE. It has corrected required<br>
GLX version and does not influence swrast. The sRGB capable attribute<br>
is attached only to those configs which do have this capability.<br>
<br>
Signed-off-by: Tomasz Lis <<a href="mailto:tomasz.lis@intel.com">tomasz.lis@intel.com</a>><br>
---<br>
glx/extension_string.c | 2 ++<br>
glx/extension_string.h | 2 ++<br>
glx/glxcmds.c | 26 ++++++++++++++++++++++----<br>
glx/glxdri2.c | 7 +++++++<br>
glx/glxdricommon.c | 4 +++-<br>
glx/glxscreens.h | 3 +++<br>
hw/xquartz/GL/visualConfigs.c | 3 +++<br>
hw/xwin/glx/indirect.c | 2 ++<br>
8 files changed, 44 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/glx/extension_string.c b/glx/extension_string.c<br>
index 544ca1f..58f930f 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(0,0), N, },<br>
{ 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(0,0), 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>
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>
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..5b7a628 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,8 +1005,17 @@ __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++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */<br>
- buf[p++] = 0;<br>
+ /* Add attribute only if its value is not default. */<br>
+ if (modes->sRGBCapable != GL_FALSE) {<br>
+ buf[p++] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT;<br>
+ buf[p++] = modes->sRGBCapable;<br>
+ }<br>
+ /* Don't add visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)?<br>
+ * Pad the remaining place with zeroes, so that attributes count is constant. */<br>
+ while (p < GLX_VIS_CONFIG_TOTAL) {<br>
+ buf[p++] = 0;<br>
+ buf[p++] = 0;<br>
+ }<br>
<br>
assert(p == GLX_VIS_CONFIG_TOTAL);<br>
if (client->swapped) {<br>
@@ -1017,7 +1026,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 +1118,15 @@ 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>
+ /* Add attribute only if its value is not default. */<br>
+ if (modes->sRGBCapable != GL_FALSE) {<br>
+ WRITE_PAIR(GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT, modes->sRGBCapable);<br>
+ }<br>
+ /* Pad the remaining place with zeroes, so that attributes count is constant. */<br>
+ while (p < __GLX_FBCONFIG_ATTRIBS_LENGTH) {<br>
+ WRITE_PAIR(0, 0);<br>
+ }<br>
+ assert(p == __GLX_FBCONFIG_ATTRIBS_LENGTH);<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.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>
index e37eefb..5efd04f 100644<br>
--- 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>
+ c->sRGBCapable = GL_FALSE;<br>
+<br>
c = c->next;<br>
}<br>
}<br>
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c<br>
index c0069a2..e6faf19 100644<br>
--- 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>
+ c->base.sRGBCapable = 0;<br>
<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>
+ c->base.sRGBCapable = 0;<br>
<br>
n++;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.9.5</font></span><br></blockquote></div>