All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Print erroneous hscale/vscale on failure
@ 2018-09-05 20:46 Sean Paul
  2018-09-05 21:56 ` Daniel Vetter
  2018-09-06 11:30 ` Ville Syrjälä
  0 siblings, 2 replies; 4+ messages in thread
From: Sean Paul @ 2018-09-05 20:46 UTC (permalink / raw)
  To: dri-devel; +Cc: Sean Paul, Sean Paul

From: Sean Paul <seanpaul@chromium.org>

I ran across this last week when I was trying to get this function to
work. It's useful to have the scale values in the log upon failure.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
---
 drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 2c23a48482da..1725546d5105 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -758,7 +758,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
 	hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
 	vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
 	if (hscale < 0 || vscale < 0) {
-		DRM_DEBUG_KMS("Invalid scaling of plane\n");
+		DRM_DEBUG_KMS("Invalid scaling of plane (%d/%d)\n",
+			      hscale, vscale);
 		drm_rect_debug_print("src: ", &plane_state->src, true);
 		drm_rect_debug_print("dst: ", &plane_state->dst, false);
 		return -ERANGE;
-- 
Sean Paul, Software Engineer, Google / Chromium OS

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

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

* Re: [PATCH] drm: Print erroneous hscale/vscale on failure
  2018-09-05 20:46 [PATCH] drm: Print erroneous hscale/vscale on failure Sean Paul
@ 2018-09-05 21:56 ` Daniel Vetter
  2018-09-06 11:30 ` Ville Syrjälä
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2018-09-05 21:56 UTC (permalink / raw)
  To: Sean Paul; +Cc: Sean Paul, dri-devel

On Wed, Sep 05, 2018 at 04:46:01PM -0400, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> I ran across this last week when I was trying to get this function to
> work. It's useful to have the scale values in the log upon failure.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>

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

> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 2c23a48482da..1725546d5105 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -758,7 +758,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
>  	hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
>  	vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
>  	if (hscale < 0 || vscale < 0) {
> -		DRM_DEBUG_KMS("Invalid scaling of plane\n");
> +		DRM_DEBUG_KMS("Invalid scaling of plane (%d/%d)\n",
> +			      hscale, vscale);
>  		drm_rect_debug_print("src: ", &plane_state->src, true);
>  		drm_rect_debug_print("dst: ", &plane_state->dst, false);
>  		return -ERANGE;
> -- 
> Sean Paul, Software Engineer, Google / Chromium OS
> 
> _______________________________________________
> 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] 4+ messages in thread

* Re: [PATCH] drm: Print erroneous hscale/vscale on failure
  2018-09-05 20:46 [PATCH] drm: Print erroneous hscale/vscale on failure Sean Paul
  2018-09-05 21:56 ` Daniel Vetter
@ 2018-09-06 11:30 ` Ville Syrjälä
  2018-09-06 12:10   ` Sean Paul
  1 sibling, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2018-09-06 11:30 UTC (permalink / raw)
  To: Sean Paul; +Cc: Sean Paul, dri-devel

On Wed, Sep 05, 2018 at 04:46:01PM -0400, Sean Paul wrote:
> From: Sean Paul <seanpaul@chromium.org>
> 
> I ran across this last week when I was trying to get this function to
> work. It's useful to have the scale values in the log upon failure.
> 
> Signed-off-by: Sean Paul <seanpaul@chromium.org>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 2c23a48482da..1725546d5105 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -758,7 +758,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
>  	hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
>  	vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
>  	if (hscale < 0 || vscale < 0) {
> -		DRM_DEBUG_KMS("Invalid scaling of plane\n");
> +		DRM_DEBUG_KMS("Invalid scaling of plane (%d/%d)\n",
> +			      hscale, vscale);

I think it's just going to be -ERANGE for at least one of them.
So not quite sure what extra benefit we get from this. What
might be more helpful is printing the actual computed scale
factor and the min/max.

>  		drm_rect_debug_print("src: ", &plane_state->src, true);
>  		drm_rect_debug_print("dst: ", &plane_state->dst, false);
>  		return -ERANGE;
> -- 
> Sean Paul, Software Engineer, Google / Chromium OS
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm: Print erroneous hscale/vscale on failure
  2018-09-06 11:30 ` Ville Syrjälä
@ 2018-09-06 12:10   ` Sean Paul
  0 siblings, 0 replies; 4+ messages in thread
From: Sean Paul @ 2018-09-06 12:10 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Sean Paul, Sean Paul, dri-devel

On Thu, Sep 06, 2018 at 02:30:24PM +0300, Ville Syrjälä wrote:
> On Wed, Sep 05, 2018 at 04:46:01PM -0400, Sean Paul wrote:
> > From: Sean Paul <seanpaul@chromium.org>
> > 
> > I ran across this last week when I was trying to get this function to
> > work. It's useful to have the scale values in the log upon failure.
> > 
> > Signed-off-by: Sean Paul <seanpaul@chromium.org>
> > ---
> >  drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> > index 2c23a48482da..1725546d5105 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -758,7 +758,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
> >  	hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
> >  	vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
> >  	if (hscale < 0 || vscale < 0) {
> > -		DRM_DEBUG_KMS("Invalid scaling of plane\n");
> > +		DRM_DEBUG_KMS("Invalid scaling of plane (%d/%d)\n",
> > +			      hscale, vscale);
> 
> I think it's just going to be -ERANGE for at least one of them.
> So not quite sure what extra benefit we get from this. What
> might be more helpful is printing the actual computed scale
> factor and the min/max.

Good point, it will tell you which scale is invalid, but not necessarily why.
I'll tweak the args for drm_rect_calc_*scale to return -errno and pass *scale by
pointer.

v2 incoming

Sean

> 
> >  		drm_rect_debug_print("src: ", &plane_state->src, true);
> >  		drm_rect_debug_print("dst: ", &plane_state->dst, false);
> >  		return -ERANGE;
> > -- 
> > Sean Paul, Software Engineer, Google / Chromium OS
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> -- 
> Ville Syrjälä
> Intel

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-09-06 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05 20:46 [PATCH] drm: Print erroneous hscale/vscale on failure Sean Paul
2018-09-05 21:56 ` Daniel Vetter
2018-09-06 11:30 ` Ville Syrjälä
2018-09-06 12:10   ` Sean Paul

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.