SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH] drm/rcar-du: Avoid restarting when shutting down
@ 2015-03-17  1:21 Magnus Damm
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2015-03-17  1:21 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm+renesas@opensource.se>

This is a prototype patch that removes one DU restart operation
from the shutdown sequence. With this in place both the required
time for mode switching is reduced and so is the amount of flicker.

Needs to be reworked to fit on top of atomic update support.

Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 drivers/gpu/drm/rcar-du/rcar_du_crtc.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- 0001/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
+++ work/drivers/gpu/drm/rcar-du/rcar_du_crtc.c	2015-03-16 12:43:00.127684181 +0900
@@ -187,7 +187,7 @@ void rcar_du_crtc_route_output(struct dr
 		rcdu->dpad0_source = rcrtc->index;
 }
 
-void rcar_du_crtc_update_planes(struct drm_crtc *crtc)
+static void __rcar_du_crtc_update_planes(struct drm_crtc *crtc, bool restart)
 {
 	struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
 	struct rcar_du_plane *planes[RCAR_DU_NUM_HW_PLANES];
@@ -247,7 +247,7 @@ void rcar_du_crtc_update_planes(struct d
 		 */
 		if (value != dptsr) {
 			rcar_du_group_write(rcrtc->group, DPTSR, dptsr);
-			if (rcrtc->group->used_crtcs)
+			if (restart && rcrtc->group->used_crtcs)
 				rcar_du_group_restart(rcrtc->group);
 		}
 	}
@@ -256,6 +256,11 @@ void rcar_du_crtc_update_planes(struct d
 			    dspr);
 }
 
+void rcar_du_crtc_update_planes(struct drm_crtc *crtc)
+{
+	__rcar_du_crtc_update_planes(crtc, true);
+}
+
 static void rcar_du_crtc_start(struct rcar_du_crtc *rcrtc)
 {
 	struct drm_crtc *crtc = &rcrtc->crtc;
@@ -314,7 +319,7 @@ static void rcar_du_crtc_stop(struct rca
 
 	mutex_lock(&rcrtc->group->planes.lock);
 	rcrtc->plane->enabled = false;
-	rcar_du_crtc_update_planes(crtc);
+	__rcar_du_crtc_update_planes(crtc, false);
 	mutex_unlock(&rcrtc->group->planes.lock);
 
 	/* Select switch sync mode. This stops display operation and configures

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

* Re: [PATCH] drm/rcar-du: Avoid restarting when shutting down
@ 2015-04-29 12:03 Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2015-04-29 12:03 UTC (permalink / raw)
  To: linux-sh

Hi Magnus,

Thank you for the patch.

On Tuesday 17 March 2015 10:21:56 Magnus Damm wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
> 
> This is a prototype patch that removes one DU restart operation
> from the shutdown sequence. With this in place both the required
> time for mode switching is reduced and so is the amount of flicker.
> 
> Needs to be reworked to fit on top of atomic update support.
> 
> Not-Yet-Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

I believe this issue has been addressed by the "[PATCH 00/10] R-Car DU: Fix 
flicker due to hardware plane reassociations" I've posted yesterday.

> ---
> 
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> --- 0001/drivers/gpu/drm/rcar-du/rcar_du_crtc.c
> +++ work/drivers/gpu/drm/rcar-du/rcar_du_crtc.c	2015-03-16
> 12:43:00.127684181 +0900 @@ -187,7 +187,7 @@ void
> rcar_du_crtc_route_output(struct dr
>  		rcdu->dpad0_source = rcrtc->index;
>  }
> 
> -void rcar_du_crtc_update_planes(struct drm_crtc *crtc)
> +static void __rcar_du_crtc_update_planes(struct drm_crtc *crtc, bool
> restart) {
>  	struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
>  	struct rcar_du_plane *planes[RCAR_DU_NUM_HW_PLANES];
> @@ -247,7 +247,7 @@ void rcar_du_crtc_update_planes(struct d
>  		 */
>  		if (value != dptsr) {
>  			rcar_du_group_write(rcrtc->group, DPTSR, dptsr);
> -			if (rcrtc->group->used_crtcs)
> +			if (restart && rcrtc->group->used_crtcs)
>  				rcar_du_group_restart(rcrtc->group);
>  		}
>  	}
> @@ -256,6 +256,11 @@ void rcar_du_crtc_update_planes(struct d
>  			    dspr);
>  }
> 
> +void rcar_du_crtc_update_planes(struct drm_crtc *crtc)
> +{
> +	__rcar_du_crtc_update_planes(crtc, true);
> +}
> +
>  static void rcar_du_crtc_start(struct rcar_du_crtc *rcrtc)
>  {
>  	struct drm_crtc *crtc = &rcrtc->crtc;
> @@ -314,7 +319,7 @@ static void rcar_du_crtc_stop(struct rca
> 
>  	mutex_lock(&rcrtc->group->planes.lock);
>  	rcrtc->plane->enabled = false;
> -	rcar_du_crtc_update_planes(crtc);
> +	__rcar_du_crtc_update_planes(crtc, false);
>  	mutex_unlock(&rcrtc->group->planes.lock);
> 
>  	/* Select switch sync mode. This stops display operation and configures

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2015-04-29 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17  1:21 [PATCH] drm/rcar-du: Avoid restarting when shutting down Magnus Damm
  -- strict thread matches above, loose matches on Subject: below --
2015-04-29 12:03 Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox