diff mbox

[3/8] drm/sti: run gdp init sequence only once

Message ID 1473946905-4374-4-git-send-email-fabien.dessenne@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fabien DESSENNE Sept. 15, 2016, 1:41 p.m. UTC
Do not rely on plane->status to define whether this is the first update
but rather check for gdp->vtg.
This avoids multiple and unwanted calls to sti_vtg_register_client()
which breaks the kernel scheduler.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/gpu/drm/sti/sti_gdp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Vincent Abriou Sept. 15, 2016, 3:28 p.m. UTC | #1
Acked-by: Vincent Abriou <vincent.abriou@st.com>


On 09/15/2016 03:41 PM, Fabien Dessenne wrote:
> Do not rely on plane->status to define whether this is the first update
> but rather check for gdp->vtg.
> This avoids multiple and unwanted calls to sti_vtg_register_client()
> which breaks the kernel scheduler.
>
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> ---
>  drivers/gpu/drm/sti/sti_gdp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 3d48e5e..19052c4 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c
> @@ -463,6 +463,7 @@ static void sti_gdp_disable(struct sti_gdp *gdp)
>  		clk_disable_unprepare(gdp->clk_pix);
>
>  	gdp->plane.status = STI_PLANE_DISABLED;
> +	gdp->vtg = NULL;
>  }
>
>  /**
> @@ -614,7 +615,6 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
>  	struct drm_crtc *crtc = state->crtc;
>  	struct sti_compositor *compo = dev_get_drvdata(gdp->dev);
>  	struct drm_framebuffer *fb =  state->fb;
> -	bool first_prepare = plane->status == STI_PLANE_DISABLED ? true : false;
>  	struct drm_crtc_state *crtc_state;
>  	struct sti_mixer *mixer;
>  	struct drm_display_mode *mode;
> @@ -651,7 +651,7 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
>  		return -EINVAL;
>  	}
>
> -	if (first_prepare) {
> +	if (!gdp->vtg) {
>  		/* Register gdp callback */
>  		gdp->vtg = mixer->id == STI_MIXER_MAIN ?
>  					compo->vtg_main : compo->vtg_aux;
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
index 3d48e5e..19052c4 100644
--- a/drivers/gpu/drm/sti/sti_gdp.c
+++ b/drivers/gpu/drm/sti/sti_gdp.c
@@ -463,6 +463,7 @@  static void sti_gdp_disable(struct sti_gdp *gdp)
 		clk_disable_unprepare(gdp->clk_pix);
 
 	gdp->plane.status = STI_PLANE_DISABLED;
+	gdp->vtg = NULL;
 }
 
 /**
@@ -614,7 +615,6 @@  static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
 	struct drm_crtc *crtc = state->crtc;
 	struct sti_compositor *compo = dev_get_drvdata(gdp->dev);
 	struct drm_framebuffer *fb =  state->fb;
-	bool first_prepare = plane->status == STI_PLANE_DISABLED ? true : false;
 	struct drm_crtc_state *crtc_state;
 	struct sti_mixer *mixer;
 	struct drm_display_mode *mode;
@@ -651,7 +651,7 @@  static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
 		return -EINVAL;
 	}
 
-	if (first_prepare) {
+	if (!gdp->vtg) {
 		/* Register gdp callback */
 		gdp->vtg = mixer->id == STI_MIXER_MAIN ?
 					compo->vtg_main : compo->vtg_aux;