Re: [Mesa-dev] [PATCH 1/2] Fix __glXInitializeVisualConfigFromTags's handling of unrecognized fbconfig tags.

2010-05-03 Thread Aaron Plattner
On Sun, May 02, 2010 at 02:39:07AM -0700, Dave Airlie wrote:
 On Fri, Apr 23, 2010 at 2:30 AM, Aaron Plattner aplatt...@nvidia.com wrote:
  __glXInitializeVisualConfigFromTags doesn't skip the payload of unrecognized
  tags.  Instead, it treats the value as if it were the next tag, which can 
  happen
  if the server's GLX extension is not Mesa's.  For example, this falls down 
  when
  NVIDIA sends a GLX_FLOAT_COMPONENTS_NV = 0 pair, causing
  __glXInitializeVisualConfigFromTags to bail out early.
 
 I've had a regression reported on irc from papillon81 with GLX_USE_GL
 and OpenSceneGraph bisected to this.

The spec is pretty clear about the attribute format for protocol:

(for visuals)

The first 18 properties are ordered; the remaining properties consist of a
property type and a property value.

(for fbconfigs)

The properties consist of a property type and a property value.

You use __glXInitializeVisualConfigFromTags in glXChooseVisual, don't you?
I think you need something like fbconfig_style_tags  bp++;  Or I guess
you could just hope that the server never sends GLX_USE_GL as a visual or
FBconfig property.

 I'm guessing we need something like the attached.
 
 Dave.
 
 
  Signed-off-by: Aaron Plattner aplatt...@nvidia.com
  ---
   src/glx/glxext.c |    2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)
 
  diff --git a/src/glx/glxext.c b/src/glx/glxext.c
  index 5289354..6d6f89e 100644
  --- a/src/glx/glxext.c
  +++ b/src/glx/glxext.c
  @@ -539,6 +539,8 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * 
  config, int count,
           i = count;
           break;
        default:
  +         /* Ignore the unrecognized tag's value */
  +         bp++;
           break;
        }
     }
  --
  1.6.3.3
 
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] Fix __glXInitializeVisualConfigFromTags's handling of unrecognized fbconfig tags.

2010-05-02 Thread Dave Airlie
On Mon, May 3, 2010 at 3:43 AM, Aaron Plattner aplatt...@nvidia.com wrote:
 On Sun, May 02, 2010 at 02:39:07AM -0700, Dave Airlie wrote:
 On Fri, Apr 23, 2010 at 2:30 AM, Aaron Plattner aplatt...@nvidia.com wrote:
  __glXInitializeVisualConfigFromTags doesn't skip the payload of 
  unrecognized
  tags.  Instead, it treats the value as if it were the next tag, which can 
  happen
  if the server's GLX extension is not Mesa's.  For example, this falls down 
  when
  NVIDIA sends a GLX_FLOAT_COMPONENTS_NV = 0 pair, causing
  __glXInitializeVisualConfigFromTags to bail out early.

 I've had a regression reported on irc from papillon81 with GLX_USE_GL
 and OpenSceneGraph bisected to this.

 The spec is pretty clear about the attribute format for protocol:

 (for visuals)

    The first 18 properties are ordered; the remaining properties consist of a
    property type and a property value.

 (for fbconfigs)

    The properties consist of a property type and a property value.

 You use __glXInitializeVisualConfigFromTags in glXChooseVisual, don't you?
 I think you need something like fbconfig_style_tags  bp++;  Or I guess
 you could just hope that the server never sends GLX_USE_GL as a visual or
 FBconfig property.


Oh good point, same handling as GL_RGBA then,

This look better?

Dave.

 I'm guessing we need something like the attached.

 Dave.

 
  Signed-off-by: Aaron Plattner aplatt...@nvidia.com
  ---
   src/glx/glxext.c |    2 ++
   1 files changed, 2 insertions(+), 0 deletions(-)
 
  diff --git a/src/glx/glxext.c b/src/glx/glxext.c
  index 5289354..6d6f89e 100644
  --- a/src/glx/glxext.c
  +++ b/src/glx/glxext.c
  @@ -539,6 +539,8 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * 
  config, int count,
           i = count;
           break;
        default:
  +         /* Ignore the unrecognized tag's value */
  +         bp++;
           break;
        }
     }
  --
  1.6.3.3
 
  ___
  mesa-dev mailing list
  mesa-dev@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/mesa-dev
 





0001-glx-fix-regression-with-GLX_USE_GL.patch
Description: Binary data
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 1/2] Fix __glXInitializeVisualConfigFromTags's handling of unrecognized fbconfig tags.

2010-05-02 Thread Xavier Chantry
On Sun, May 2, 2010 at 10:17 PM, Dave Airlie airl...@gmail.com wrote:
 On Mon, May 3, 2010 at 3:43 AM, Aaron Plattner aplatt...@nvidia.com wrote:
 On Sun, May 02, 2010 at 02:39:07AM -0700, Dave Airlie wrote:
 On Fri, Apr 23, 2010 at 2:30 AM, Aaron Plattner aplatt...@nvidia.com 
 wrote:
  __glXInitializeVisualConfigFromTags doesn't skip the payload of 
  unrecognized
  tags.  Instead, it treats the value as if it were the next tag, which can 
  happen
  if the server's GLX extension is not Mesa's.  For example, this falls 
  down when
  NVIDIA sends a GLX_FLOAT_COMPONENTS_NV = 0 pair, causing
  __glXInitializeVisualConfigFromTags to bail out early.

 I've had a regression reported on irc from papillon81 with GLX_USE_GL
 and OpenSceneGraph bisected to this.

 The spec is pretty clear about the attribute format for protocol:

 (for visuals)

    The first 18 properties are ordered; the remaining properties consist of a
    property type and a property value.

 (for fbconfigs)

    The properties consist of a property type and a property value.

 You use __glXInitializeVisualConfigFromTags in glXChooseVisual, don't you?
 I think you need something like fbconfig_style_tags  bp++;  Or I guess
 you could just hope that the server never sends GLX_USE_GL as a visual or
 FBconfig property.


 Oh good point, same handling as GL_RGBA then,

 This look better?

 Dave.


Ah there, that explains why flightgear just died with
Error: Not able to create requested visual.

Both patches seem to fix it, thanks !
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev