[Mesa-dev] [PATCH] intel: Give an explanation why we are exiting for debugging.

Eric Anholt eric at anholt.net
Fri Sep 2 11:53:13 PDT 2011


On Fri,  2 Sep 2011 12:33:44 -0300, Eugeni Dodonov <eugeni at dodonov.net> wrote:
> From: Eugeni Dodonov <eugeni.dodonov at intel.com>
> 
> This could happen in 3 different cases, and ERRNO can explain what
> happened. First case would be EIO (gpu hang), second EINVAL (something is
> wrong inside the batch), and we also discovered that sometimes it happens
> with ENOSPACE. All of those cases are different it it could be worth to at
> least know what happened.
>
> Signed-off-by: Eugeni Dodonov <eugeni.dodonov at intel.com>
> ---
>  src/mesa/drivers/dri/intel/intel_batchbuffer.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
> index db4343b..73367f3 100644
> --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
> +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
> @@ -138,6 +138,7 @@ do_flush_locked(struct intel_context *intel)
>     }
>  
>     if (ret != 0) {
> +      _mesa_warning(NULL, "do_flush_locked: %d\n", ret);
>        exit(1);
>     }
>     intel->vtbl.new_batch(intel);

I would make it

fprintf(stderr, "intel_batchbuffer_flush failed: %s\n", strerror(ret));

You want the output even if built without Mesa debugging enabled, and
strings are nicer than numbers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110902/11383db9/attachment.pgp>


More information about the mesa-dev mailing list