[Mesa-dev] [PATCH] glx: Fix return value from indirect_bind_context

Ian Romanick idr at freedesktop.org
Fri Oct 25 21:59:03 CEST 2013


On 10/25/2013 12:14 PM, Adam Jackson wrote:
> _XReply returns 1 on success, but indirect_bind_context returns 0 on
> success.
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70486
Reviewed-and-tested-by: Ian Romanick <ian.d.romanick at intel.com>

The other way to fix this would be to make glx_context_vtable::bind
return Bool instead of int.  That would be more work, but it may be a
tiny bit cleaner in the end.  *shrug*

> ---
>  src/glx/indirect_glx.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c
> index d27b019..28b8cd0 100644
> --- a/src/glx/indirect_glx.c
> +++ b/src/glx/indirect_glx.c
> @@ -132,7 +132,7 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
>     __GLXattribute *state;
>     Display *dpy = gc->psc->dpy;
>     int opcode = __glXSetupForCommand(dpy);
> -   Bool ret;
> +   Bool sent;
>  
>     if (old != &dummyContext && !old->isDirect && old->psc->dpy == dpy) {
>        tag = old->currentContextTag;
> @@ -141,8 +141,8 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
>        tag = 0;
>     }
>  
> -   ret = SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read,
> -                                &gc->currentContextTag);
> +   sent = SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read,
> +				 &gc->currentContextTag);
>  
>     if (!IndirectAPI)
>        IndirectAPI = __glXNewIndirectAPI();
> @@ -155,7 +155,7 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old,
>        __glXInitVertexArrayState(gc);
>     }
>  
> -   return ret;
> +   return !sent;
>  }
>  
>  static void
> 



More information about the mesa-dev mailing list