diff mbox

[v2,2/2] drm/gem-fb-helper: Use debug message on gem lookup failure

Message ID 1505147865-18194-2-git-send-email-noralf@tronnes.org (mailing list archive)
State New, archived
Headers show

Commit Message

Noralf Trønnes Sept. 11, 2017, 4:37 p.m. UTC
GEM lookup failure can easily be triggered by userspace so make
it a debug message, not an error message.

Also remove unnecessary inner parentheses and fix alphabetical
struct declaration order.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/drm_gem_framebuffer_helper.c | 4 ++--
 include/drm/drm_gem_framebuffer_helper.h     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Laurent Pinchart Sept. 13, 2017, 2:44 a.m. UTC | #1
Hi Noralf,

Thank you for the patch.

On Monday, 11 September 2017 19:37:45 EEST Noralf Trønnes wrote:
> GEM lookup failure can easily be triggered by userspace so make
> it a debug message, not an error message.
> 
> Also remove unnecessary inner parentheses and fix alphabetical
> struct declaration order.
> 
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/drm_gem_framebuffer_helper.c | 4 ++--
>  include/drm/drm_gem_framebuffer_helper.h     | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index e2ca002..9cf6566
> 100644
> --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
> @@ -157,7 +157,7 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev,
> struct drm_file *file,
> 
>  		objs[i] = drm_gem_object_lookup(file, mode_cmd->handles[i]);
>  		if (!objs[i]) {
> -			DRM_DEV_ERROR(dev->dev, "Failed to lookup GEM\n");
> +			DRM_DEBUG_KMS("Failed to lookup GEM object\n");
>  			ret = -ENOENT;
>  			goto err_gem_object_put;
>  		}
> @@ -235,7 +235,7 @@ int drm_gem_fb_prepare_fb(struct drm_plane *plane,
>  	struct dma_buf *dma_buf;
>  	struct dma_fence *fence;
> 
> -	if ((plane->state->fb == state->fb) || !state->fb)
> +	if (plane->state->fb == state->fb || !state->fb)
>  		return 0;
> 
>  	dma_buf = drm_gem_fb_get_obj(state->fb, 0)->dma_buf;
> diff --git a/include/drm/drm_gem_framebuffer_helper.h
> b/include/drm/drm_gem_framebuffer_helper.h index db9cfa0..5ca7cdc 100644
> --- a/include/drm/drm_gem_framebuffer_helper.h
> +++ b/include/drm/drm_gem_framebuffer_helper.h
> @@ -2,8 +2,8 @@
>  #define __DRM_GEM_FB_HELPER_H__
> 
>  struct drm_device;
> -struct drm_file;
>  struct drm_fb_helper_surface_size;
> +struct drm_file;
>  struct drm_framebuffer;
>  struct drm_framebuffer_funcs;
>  struct drm_gem_object;
Noralf Trønnes Sept. 16, 2017, 12:14 p.m. UTC | #2
Den 13.09.2017 04.44, skrev Laurent Pinchart:
> Hi Noralf,
>
> Thank you for the patch.
>
> On Monday, 11 September 2017 19:37:45 EEST Noralf Trønnes wrote:
>> GEM lookup failure can easily be triggered by userspace so make
>> it a debug message, not an error message.
>>
>> Also remove unnecessary inner parentheses and fix alphabetical
>> struct declaration order.
>>
>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
>> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks, applied to drm-misc.

Noralf.

>> ---
>>   drivers/gpu/drm/drm_gem_framebuffer_helper.c | 4 ++--
>>   include/drm/drm_gem_framebuffer_helper.h     | 2 +-
>>   2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
>> b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index e2ca002..9cf6566
>> 100644
>> --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
>> +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
>> @@ -157,7 +157,7 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev,
>> struct drm_file *file,
>>
>>   		objs[i] = drm_gem_object_lookup(file, mode_cmd->handles[i]);
>>   		if (!objs[i]) {
>> -			DRM_DEV_ERROR(dev->dev, "Failed to lookup GEM\n");
>> +			DRM_DEBUG_KMS("Failed to lookup GEM object\n");
>>   			ret = -ENOENT;
>>   			goto err_gem_object_put;
>>   		}
>> @@ -235,7 +235,7 @@ int drm_gem_fb_prepare_fb(struct drm_plane *plane,
>>   	struct dma_buf *dma_buf;
>>   	struct dma_fence *fence;
>>
>> -	if ((plane->state->fb == state->fb) || !state->fb)
>> +	if (plane->state->fb == state->fb || !state->fb)
>>   		return 0;
>>
>>   	dma_buf = drm_gem_fb_get_obj(state->fb, 0)->dma_buf;
>> diff --git a/include/drm/drm_gem_framebuffer_helper.h
>> b/include/drm/drm_gem_framebuffer_helper.h index db9cfa0..5ca7cdc 100644
>> --- a/include/drm/drm_gem_framebuffer_helper.h
>> +++ b/include/drm/drm_gem_framebuffer_helper.h
>> @@ -2,8 +2,8 @@
>>   #define __DRM_GEM_FB_HELPER_H__
>>
>>   struct drm_device;
>> -struct drm_file;
>>   struct drm_fb_helper_surface_size;
>> +struct drm_file;
>>   struct drm_framebuffer;
>>   struct drm_framebuffer_funcs;
>>   struct drm_gem_object;
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
index e2ca002..9cf6566 100644
--- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
+++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
@@ -157,7 +157,7 @@  drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file,
 
 		objs[i] = drm_gem_object_lookup(file, mode_cmd->handles[i]);
 		if (!objs[i]) {
-			DRM_DEV_ERROR(dev->dev, "Failed to lookup GEM\n");
+			DRM_DEBUG_KMS("Failed to lookup GEM object\n");
 			ret = -ENOENT;
 			goto err_gem_object_put;
 		}
@@ -235,7 +235,7 @@  int drm_gem_fb_prepare_fb(struct drm_plane *plane,
 	struct dma_buf *dma_buf;
 	struct dma_fence *fence;
 
-	if ((plane->state->fb == state->fb) || !state->fb)
+	if (plane->state->fb == state->fb || !state->fb)
 		return 0;
 
 	dma_buf = drm_gem_fb_get_obj(state->fb, 0)->dma_buf;
diff --git a/include/drm/drm_gem_framebuffer_helper.h b/include/drm/drm_gem_framebuffer_helper.h
index db9cfa0..5ca7cdc 100644
--- a/include/drm/drm_gem_framebuffer_helper.h
+++ b/include/drm/drm_gem_framebuffer_helper.h
@@ -2,8 +2,8 @@ 
 #define __DRM_GEM_FB_HELPER_H__
 
 struct drm_device;
-struct drm_file;
 struct drm_fb_helper_surface_size;
+struct drm_file;
 struct drm_framebuffer;
 struct drm_framebuffer_funcs;
 struct drm_gem_object;