diff mbox

drm/exynos/decon5433: set STANDALONE_UPDATE_F also if planes are disabled

Message ID 1484295026-16435-1-git-send-email-a.hajda@samsung.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Andrzej Hajda Jan. 13, 2017, 8:10 a.m. UTC
STANDALONE_UPDATE_F should be set if something changed in plane configurations,
including plane disable.
The patch fixes page-faults bugs, caused by decon still using framebuffers
of disabled planes.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Joonyoung Shim Jan. 13, 2017, 8:37 a.m. UTC | #1
Hi Andrzej,

On 01/13/2017 05:10 PM, Andrzej Hajda wrote:
> STANDALONE_UPDATE_F should be set if something changed in plane configurations,
> including plane disable.
> The patch fixes page-faults bugs, caused by decon still using framebuffers
> of disabled planes.
> 
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index ef7fcb5..3999e88 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -46,7 +46,8 @@ enum decon_flag_bits {
>  	BIT_CLKS_ENABLED,
>  	BIT_IRQS_ENABLED,
>  	BIT_WIN_UPDATED,
> -	BIT_SUSPENDED
> +	BIT_SUSPENDED,
> +	BIT_REQUEST_UPDATE
>  };
>  
>  struct decon_context {
> @@ -313,6 +314,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
>  
>  	/* window enable */
>  	decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, ~0);
> +	set_bit(BIT_REQUEST_UPDATE, &ctx->flags);
>  }
>  
>  static void decon_disable_plane(struct exynos_drm_crtc *crtc,
> @@ -325,6 +327,7 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc,
>  		return;
>  
>  	decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0);
> +	set_bit(BIT_REQUEST_UPDATE, &ctx->flags);
>  }
>  
>  static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
> @@ -339,8 +342,10 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
>  		decon_shadow_protect_win(ctx, i, false);
>  
>  	/* update iff there are active windows */
> -	if (crtc->base.state->plane_mask)
> +	if (test_bit(BIT_REQUEST_UPDATE, &ctx->flags)) {
>  		decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0);
> +		set_bit(BIT_REQUEST_UPDATE, &ctx->flags);
> +	}

There is no code to clear BIT_REQUEST_UPDATE, is it right?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrzej Hajda Jan. 13, 2017, 8:44 a.m. UTC | #2
On 13.01.2017 09:37, Joonyoung Shim wrote:
>
> There is no code to clear BIT_REQUEST_UPDATE, is it right?

Marek has already pointed it out, v2 sent.

Regards
Andrzej

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index ef7fcb5..3999e88 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -46,7 +46,8 @@  enum decon_flag_bits {
 	BIT_CLKS_ENABLED,
 	BIT_IRQS_ENABLED,
 	BIT_WIN_UPDATED,
-	BIT_SUSPENDED
+	BIT_SUSPENDED,
+	BIT_REQUEST_UPDATE
 };
 
 struct decon_context {
@@ -313,6 +314,7 @@  static void decon_update_plane(struct exynos_drm_crtc *crtc,
 
 	/* window enable */
 	decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, ~0);
+	set_bit(BIT_REQUEST_UPDATE, &ctx->flags);
 }
 
 static void decon_disable_plane(struct exynos_drm_crtc *crtc,
@@ -325,6 +327,7 @@  static void decon_disable_plane(struct exynos_drm_crtc *crtc,
 		return;
 
 	decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0);
+	set_bit(BIT_REQUEST_UPDATE, &ctx->flags);
 }
 
 static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
@@ -339,8 +342,10 @@  static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
 		decon_shadow_protect_win(ctx, i, false);
 
 	/* update iff there are active windows */
-	if (crtc->base.state->plane_mask)
+	if (test_bit(BIT_REQUEST_UPDATE, &ctx->flags)) {
 		decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0);
+		set_bit(BIT_REQUEST_UPDATE, &ctx->flags);
+	}
 
 	if (ctx->out_type & IFTYPE_I80)
 		set_bit(BIT_WIN_UPDATED, &ctx->flags);