[Mesa-dev] [PATCH] i965: Add some informative debug when the X Server botches DRI2 GetBuffers.

Kenneth Graunke kenneth at whitecape.org
Sat Jan 18 20:02:48 PST 2014


On 01/18/2014 10:27 AM, Eric Anholt wrote:
> We've had various bug reports over the years where miptrees are missing,
> and when I screwed it up while adding DRI2 to the modesetting driver, I
> figured I should put the info necessary for debug here.
> ---
>  src/mesa/drivers/dri/i965/brw_context.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
> index 51918b9..e2d7c6d 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.c
> +++ b/src/mesa/drivers/dri/i965/brw_context.c
> @@ -1257,14 +1257,24 @@ intel_process_dri2_buffer(struct brw_context *brw,
>                                            buffer->pitch,
>                                            buffer->name,
>                                            buffer_name);
> -   if (!region)
> +   if (!region) {
> +      fprintf(stderr,
> +              "Failed to make region for returned DRI2 buffer "
> +              "(%dx%d, named %d).\n"
> +              "This is likely a bug in the X Server that will lead to a "
> +              "crash soon.\n",
> +              drawable->w, drawable->h, buffer->name);
>        return;
> +   }
>  
>     rb->mt = intel_miptree_create_for_dri2_buffer(brw,
>                                                   buffer->attachment,
>                                                   intel_rb_format(rb),
>                                                   num_samples,
>                                                   region);
> +
> +   assert(rb->mt);
> +
>     intel_region_release(&region);
>  }
>  
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>


More information about the mesa-dev mailing list