All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Print the fb dimensions when the src coord check fails
@ 2017-11-01 18:35 Ville Syrjala
  2017-11-02  9:50 ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjala @ 2017-11-01 18:35 UTC (permalink / raw)
  To: dri-devel

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

When debugging bad plane source coordinates it helps to have an
idea of what the framebuffer dimensions are.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_atomic.c      | 5 +++--
 drivers/gpu/drm/drm_framebuffer.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index c2da5585e201..83fd86534552 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -907,11 +907,12 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
 	    state->src_h > fb_height ||
 	    state->src_y > fb_height - state->src_h) {
 		DRM_DEBUG_ATOMIC("Invalid source coordinates "
-				 "%u.%06ux%u.%06u+%u.%06u+%u.%06u\n",
+				 "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n",
 				 state->src_w >> 16, ((state->src_w & 0xffff) * 15625) >> 10,
 				 state->src_h >> 16, ((state->src_h & 0xffff) * 15625) >> 10,
 				 state->src_x >> 16, ((state->src_x & 0xffff) * 15625) >> 10,
-				 state->src_y >> 16, ((state->src_y & 0xffff) * 15625) >> 10);
+				 state->src_y >> 16, ((state->src_y & 0xffff) * 15625) >> 10,
+				 state->fb->width, state->fb->height);
 		return -ENOSPC;
 	}
 
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 2affe53f3fda..0354dcf57038 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -78,11 +78,12 @@ int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
 	    src_h > fb_height ||
 	    src_y > fb_height - src_h) {
 		DRM_DEBUG_KMS("Invalid source coordinates "
-			      "%u.%06ux%u.%06u+%u.%06u+%u.%06u\n",
+			      "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n",
 			      src_w >> 16, ((src_w & 0xffff) * 15625) >> 10,
 			      src_h >> 16, ((src_h & 0xffff) * 15625) >> 10,
 			      src_x >> 16, ((src_x & 0xffff) * 15625) >> 10,
-			      src_y >> 16, ((src_y & 0xffff) * 15625) >> 10);
+			      src_y >> 16, ((src_y & 0xffff) * 15625) >> 10,
+			      fb->width, fb->height);
 		return -ENOSPC;
 	}
 
-- 
2.13.6

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Print the fb dimensions when the src coord check fails
  2017-11-01 18:35 [PATCH] drm: Print the fb dimensions when the src coord check fails Ville Syrjala
@ 2017-11-02  9:50 ` Daniel Vetter
  2017-11-02 13:16   ` Gustavo Padovan
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2017-11-02  9:50 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: dri-devel

On Wed, Nov 01, 2017 at 08:35:33PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> When debugging bad plane source coordinates it helps to have an
> idea of what the framebuffer dimensions are.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Makes sense.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/drm_atomic.c      | 5 +++--
>  drivers/gpu/drm/drm_framebuffer.c | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index c2da5585e201..83fd86534552 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -907,11 +907,12 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
>  	    state->src_h > fb_height ||
>  	    state->src_y > fb_height - state->src_h) {
>  		DRM_DEBUG_ATOMIC("Invalid source coordinates "
> -				 "%u.%06ux%u.%06u+%u.%06u+%u.%06u\n",
> +				 "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n",
>  				 state->src_w >> 16, ((state->src_w & 0xffff) * 15625) >> 10,
>  				 state->src_h >> 16, ((state->src_h & 0xffff) * 15625) >> 10,
>  				 state->src_x >> 16, ((state->src_x & 0xffff) * 15625) >> 10,
> -				 state->src_y >> 16, ((state->src_y & 0xffff) * 15625) >> 10);
> +				 state->src_y >> 16, ((state->src_y & 0xffff) * 15625) >> 10,
> +				 state->fb->width, state->fb->height);
>  		return -ENOSPC;
>  	}
>  
> diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
> index 2affe53f3fda..0354dcf57038 100644
> --- a/drivers/gpu/drm/drm_framebuffer.c
> +++ b/drivers/gpu/drm/drm_framebuffer.c
> @@ -78,11 +78,12 @@ int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y,
>  	    src_h > fb_height ||
>  	    src_y > fb_height - src_h) {
>  		DRM_DEBUG_KMS("Invalid source coordinates "
> -			      "%u.%06ux%u.%06u+%u.%06u+%u.%06u\n",
> +			      "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n",
>  			      src_w >> 16, ((src_w & 0xffff) * 15625) >> 10,
>  			      src_h >> 16, ((src_h & 0xffff) * 15625) >> 10,
>  			      src_x >> 16, ((src_x & 0xffff) * 15625) >> 10,
> -			      src_y >> 16, ((src_y & 0xffff) * 15625) >> 10);
> +			      src_y >> 16, ((src_y & 0xffff) * 15625) >> 10,
> +			      fb->width, fb->height);
>  		return -ENOSPC;
>  	}
>  
> -- 
> 2.13.6
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Print the fb dimensions when the src coord check fails
  2017-11-02  9:50 ` Daniel Vetter
@ 2017-11-02 13:16   ` Gustavo Padovan
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo Padovan @ 2017-11-02 13:16 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: dri-devel

2017-11-02 Daniel Vetter <daniel@ffwll.ch>:

> On Wed, Nov 01, 2017 at 08:35:33PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > When debugging bad plane source coordinates it helps to have an
> > idea of what the framebuffer dimensions are.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Makes sense.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

queued for 4.16. Thanks for your patch.

Gustavo

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-11-02 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 18:35 [PATCH] drm: Print the fb dimensions when the src coord check fails Ville Syrjala
2017-11-02  9:50 ` Daniel Vetter
2017-11-02 13:16   ` Gustavo Padovan

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.