[Intel-gfx] [PATCH] intel: Don't print messages to stderr if context creation fails.

Ben Widawsky ben at bwidawsk.net
Wed Jul 18 01:06:18 CEST 2012


On Thu, 12 Jul 2012 12:45:22 -0700
Kenneth Graunke <kenneth at whitecape.org> wrote:

> Since there is no getparam for hardware context support, Mesa always
> tries to obtain a context by calling drm_intel_gem_context_create and
> NULL-checking the result.  On an older kernel without context support,
> this caused libdrm to print an unwanted message to stderr:
> 
> DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: Invalid argument
> 
> In fact, this caused every Piglit test to fail with a "warn" status due
> to the unrecognized error message.
> 
> Simply delete the message.  It's OK for context creation to fail.

Change it to DBG() and you have my:
Reviewed-by: Ben Widawsky <ben at bwidawsk.net>

> 
> Cc: Ben Widawsky <ben at bwidawsk.net>
> Cc: Paul Berry <stereotype441 at gmail.com>
> Cc: mesa-devel at lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
>  intel/intel_bufmgr_gem.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
> index a957c28..1b4ac78 100644
> --- a/intel/intel_bufmgr_gem.c
> +++ b/intel/intel_bufmgr_gem.c
> @@ -2850,11 +2850,8 @@ drm_intel_gem_context_create(drm_intel_bufmgr *bufmgr)
>  	int tmp = 0, ret;
>  
>  	ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GEM_CONTEXT_CREATE, &create);
> -	if (ret != 0) {
> -		fprintf(stderr, "DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: %s\n",
> -			strerror(errno));
> +	if (ret != 0)
>  		return NULL;
> -	}
>  
>  	context = calloc(1, sizeof(*context));
>  	context->ctx_id = create.ctx_id;



-- 
Ben Widawsky, Intel Open Source Technology Center



More information about the Intel-gfx mailing list