LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [v1] drm/arm/mali-dp: Add a loop around the second set CVAL and try 5 times
@ 2019-05-08 10:58 Wen He
  2019-05-09 15:27 ` liviu.dudau
  0 siblings, 1 reply; 3+ messages in thread
From: Wen He @ 2019-05-08 10:58 UTC (permalink / raw)
  To: dri-devel, linux-kernel, liviu.dudau, brian.starkey; +Cc: Leo Li, Wen He

This patch trying to fix monitor freeze issue caused by drm error
'flip_done timed out' on LS1028A platform. this set try is make a loop
around the second setting CVAL and try like 5 times before giveing up.

Signed-off-by: Liviu <liviu.Dudau@arm.com>
Signed-off-by: Wen He <wen.he_1@nxp.com>
---
 drivers/gpu/drm/arm/malidp_drv.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 21725c9b9f5e..18cb7f134f4e 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -192,6 +192,7 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state)
 {
 	struct drm_device *drm = state->dev;
 	struct malidp_drm *malidp = drm->dev_private;
+	int loop = 5;
 
 	malidp->event = malidp->crtc.state->event;
 	malidp->crtc.state->event = NULL;
@@ -206,8 +207,18 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state)
 			drm_crtc_vblank_get(&malidp->crtc);
 
 		/* only set config_valid if the CRTC is enabled */
-		if (malidp_set_and_wait_config_valid(drm) < 0)
+		if (malidp_set_and_wait_config_valid(drm) < 0) {
+			/*
+			 * make a loop around the second CVAL setting and
+			 * try 5 times before giving up.
+			 */
+			while (loop--) {
+				if (!malidp_set_and_wait_config_valid(drm))
+					break;
+			}
 			DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n");
+		}
+
 	} else if (malidp->event) {
 		/* CRTC inactive means vblank IRQ is disabled, send event directly */
 		spin_lock_irq(&drm->event_lock);
-- 
2.17.1


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

* Re: [v1] drm/arm/mali-dp: Add a loop around the second set CVAL and try 5 times
  2019-05-08 10:58 [v1] drm/arm/mali-dp: Add a loop around the second set CVAL and try 5 times Wen He
@ 2019-05-09 15:27 ` liviu.dudau
  0 siblings, 0 replies; 3+ messages in thread
From: liviu.dudau @ 2019-05-09 15:27 UTC (permalink / raw)
  To: Wen He; +Cc: dri-devel, linux-kernel, brian.starkey, Leo Li

On Wed, May 08, 2019 at 10:58:18AM +0000, Wen He wrote:
> This patch trying to fix monitor freeze issue caused by drm error
> 'flip_done timed out' on LS1028A platform. this set try is make a loop
> around the second setting CVAL and try like 5 times before giveing up.
> 
> Signed-off-by: Liviu <liviu.Dudau@arm.com>
> Signed-off-by: Wen He <wen.he_1@nxp.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

I will pull this into my mali-dp tree and send it as fixes after v5.2-rc1.

Best regards,
Liviu

> ---
>  drivers/gpu/drm/arm/malidp_drv.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index 21725c9b9f5e..18cb7f134f4e 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -192,6 +192,7 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state)
>  {
>  	struct drm_device *drm = state->dev;
>  	struct malidp_drm *malidp = drm->dev_private;
> +	int loop = 5;
>  
>  	malidp->event = malidp->crtc.state->event;
>  	malidp->crtc.state->event = NULL;
> @@ -206,8 +207,18 @@ static void malidp_atomic_commit_hw_done(struct drm_atomic_state *state)
>  			drm_crtc_vblank_get(&malidp->crtc);
>  
>  		/* only set config_valid if the CRTC is enabled */
> -		if (malidp_set_and_wait_config_valid(drm) < 0)
> +		if (malidp_set_and_wait_config_valid(drm) < 0) {
> +			/*
> +			 * make a loop around the second CVAL setting and
> +			 * try 5 times before giving up.
> +			 */
> +			while (loop--) {
> +				if (!malidp_set_and_wait_config_valid(drm))
> +					break;
> +			}
>  			DRM_DEBUG_DRIVER("timed out waiting for updated configuration\n");
> +		}
> +
>  	} else if (malidp->event) {
>  		/* CRTC inactive means vblank IRQ is disabled, send event directly */
>  		spin_lock_irq(&drm->event_lock);
> -- 
> 2.17.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* RE: [v1] drm/arm/mali-dp: Add a loop around the second set CVAL and try 5 times
       [not found] <20190508094049.21658-1-wen.he_1@nxp.com>
@ 2019-05-08 10:33 ` Wen He
  0 siblings, 0 replies; 3+ messages in thread
From: Wen He @ 2019-05-08 10:33 UTC (permalink / raw)
  To: dri-devel, liviu.dudau, brian.starkey, linux-kernel; +Cc: Leo Li



> -----Original Message-----
> From: Wen He
> Sent: 2019年5月8日 17:39
> To: dri-devel@lists.freedesktop.org; liviu.dudau@arm.com;
> brian.starkey@arm.com
> Cc: Leo Li <leoyang.li@nxp.com>; Wen He <wen.he_1@nxp.com>
> Subject: [v1] drm/arm/mali-dp: Add a loop around the second set CVAL and try
> 5 times
> 
> This patch trying to fix monitor freeze issue caused by drm error 'flip_done
> timed out' on LS1028A platform. this set try is make a loop around the second
> setting CVAL and try like 5 times before giveing up.
> 
> Signed-off-by: Liviu <liviu.Dudau@arm.com>
> Signed-off-by: Wen He <wen.he_1@nxp.com>
> ---
>  drivers/gpu/drm/arm/malidp_drv.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c
> b/drivers/gpu/drm/arm/malidp_drv.c
> index 21725c9b9f5e..18cb7f134f4e 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -192,6 +192,7 @@ static void malidp_atomic_commit_hw_done(struct
> drm_atomic_state *state)  {
>  	struct drm_device *drm = state->dev;
>  	struct malidp_drm *malidp = drm->dev_private;
> +	int loop = 5;
> 
>  	malidp->event = malidp->crtc.state->event;
>  	malidp->crtc.state->event = NULL;
> @@ -206,8 +207,18 @@ static void malidp_atomic_commit_hw_done(struct
> drm_atomic_state *state)
>  			drm_crtc_vblank_get(&malidp->crtc);
> 
>  		/* only set config_valid if the CRTC is enabled */
> -		if (malidp_set_and_wait_config_valid(drm) < 0)
> +		if (malidp_set_and_wait_config_valid(drm) < 0) {
> +			/*
> +			 * make a loop around the second CVAL setting and
> +			 * try 5 times before giving up.
> +			 */
> +			while (loop--) {
> +				if (!malidp_set_and_wait_config_valid(drm))
> +					break;
> +			}
>  			DRM_DEBUG_DRIVER("timed out waiting for updated
> configuration\n");
> +		}
> +
>  	} else if (malidp->event) {
>  		/* CRTC inactive means vblank IRQ is disabled, send event directly */
>  		spin_lock_irq(&drm->event_lock);
> --
> 2.17.1


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

end of thread, other threads:[~2019-05-09 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 10:58 [v1] drm/arm/mali-dp: Add a loop around the second set CVAL and try 5 times Wen He
2019-05-09 15:27 ` liviu.dudau
     [not found] <20190508094049.21658-1-wen.he_1@nxp.com>
2019-05-08 10:33 ` Wen He

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).