[Mesa-dev] [PATCH] glx/dri2: Paper over errors in DRI2Connect when indirect

Julien Cristau jcristau at debian.org
Thu Jun 9 14:55:09 PDT 2011


On Thu, Jun  9, 2011 at 18:57:54 +1000, Christopher James Halse Rogers wrote:

> DRI2 will throw BadRequest for this when the client is not local, but
> DRI2 is an implementation detail and not something callers should have
> to know about.  Silently swallow errors in this case, and just propagate
> the failure through DRI2Connect's return code.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28125
> Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
> ---
> 
> This seems to have died a quiet death without actually getting applied.
> Kristian, was this what you had in mind?
> 
>  src/glx/dri2.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/src/glx/dri2.c b/src/glx/dri2.c
> index adfd3d1..00adff2 100644
> --- a/src/glx/dri2.c
> +++ b/src/glx/dri2.c
> @@ -180,6 +180,15 @@ DRI2Error(Display *display, xError *err, XExtCodes *codes, int *ret_code)
>  	err->minorCode == X_DRI2DestroyDrawable)
>  	return True;
>  
> +    /* If the server is non-local DRI2Connect will raise BadRequest.
> +     * Swallow this so that DRI2Connect can signal this in its return code */
> +    if (err->majorCode == codes->major_opcode &&
> +        err->minorCode == X_DRI2Connect &&
> +        err->errorCode == BadRequest) {
> +	*ret_code = False;
> +	return True;
> +    }
> +
>      return False;
>  }
>  
I tested something like this (without setting *ret_code though, so my
patch was probably wrong), seemed to work just fine.

Cheers,
Julien


More information about the mesa-dev mailing list