All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] intel: Don't print messages to stderr if context creation fails.
@ 2012-07-12 19:45 Kenneth Graunke
  2012-07-12 20:11 ` Ben Widawsky
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kenneth Graunke @ 2012-07-12 19:45 UTC (permalink / raw)
  To: intel-gfx; +Cc: mesa-devel, Ben Widawsky

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.

Cc: Ben Widawsky <ben@bwidawsk.net>
Cc: Paul Berry <stereotype441@gmail.com>
Cc: mesa-devel@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@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;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] intel: Don't print messages to stderr if context creation fails.
  2012-07-12 19:45 [PATCH] intel: Don't print messages to stderr if context creation fails Kenneth Graunke
@ 2012-07-12 20:11 ` Ben Widawsky
  2012-07-17 23:03 ` Ben Widawsky
  2012-07-17 23:06 ` Ben Widawsky
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Widawsky @ 2012-07-12 20:11 UTC (permalink / raw)
  To: Kenneth Graunke; +Cc: intel-gfx, mesa-devel

On Thu, 12 Jul 2012 12:45:22 -0700
Kenneth Graunke <kenneth@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@bwidawsk.net>

> 
> Cc: Ben Widawsky <ben@bwidawsk.net>
> Cc: Paul Berry <stereotype441@gmail.com>
> Cc: mesa-devel@lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] intel: Don't print messages to stderr if context creation fails.
  2012-07-12 19:45 [PATCH] intel: Don't print messages to stderr if context creation fails Kenneth Graunke
  2012-07-12 20:11 ` Ben Widawsky
@ 2012-07-17 23:03 ` Ben Widawsky
  2012-07-17 23:06 ` Ben Widawsky
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Widawsky @ 2012-07-17 23:03 UTC (permalink / raw)
  To: Kenneth Graunke; +Cc: intel-gfx, mesa-devel

On Thu, 12 Jul 2012 12:45:22 -0700
Kenneth Graunke <kenneth@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@bwidawsk.net>

> 
> Cc: Ben Widawsky <ben@bwidawsk.net>
> Cc: Paul Berry <stereotype441@gmail.com>
> Cc: mesa-devel@lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] intel: Don't print messages to stderr if context creation fails.
  2012-07-12 19:45 [PATCH] intel: Don't print messages to stderr if context creation fails Kenneth Graunke
  2012-07-12 20:11 ` Ben Widawsky
  2012-07-17 23:03 ` Ben Widawsky
@ 2012-07-17 23:06 ` Ben Widawsky
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Widawsky @ 2012-07-17 23:06 UTC (permalink / raw)
  To: Kenneth Graunke; +Cc: intel-gfx, mesa-dev

On Thu, 12 Jul 2012 12:45:22 -0700
Kenneth Graunke <kenneth@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@bwidawsk.net>

> 
> Cc: Ben Widawsky <ben@bwidawsk.net>
> Cc: Paul Berry <stereotype441@gmail.com>
> Cc: mesa-devel@lists.freedesktop.org
> Signed-off-by: Kenneth Graunke <kenneth@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-17 23:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 19:45 [PATCH] intel: Don't print messages to stderr if context creation fails Kenneth Graunke
2012-07-12 20:11 ` Ben Widawsky
2012-07-17 23:03 ` Ben Widawsky
2012-07-17 23:06 ` Ben Widawsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.