2019-05-27 12:00:30

by Benjamin GAIGNARD

[permalink] [raw]
Subject: [PATCH] drm/stm: ltdc: restore calls to clk_{enable/disable}

From: Benjamin Gaignard <[email protected]>

Restore calls to clk_{enable/disable} deleted after applying the wrong
version of the patch

Fixes: fd6905fca4f0 ("drm/stm: ltdc: remove clk_round_rate comment")

Signed-off-by: Benjamin Gaignard <[email protected]>
---
drivers/gpu/drm/stm/ltdc.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index ae2aaf2a62ee..ac29890edeb6 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -507,10 +507,12 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
struct ltdc_device *ldev = crtc_to_ltdc(crtc);
int rate = mode->clock * 1000;

+ clk_disable(ldev->pixel_clk);
if (clk_set_rate(ldev->pixel_clk, rate) < 0) {
DRM_ERROR("Cannot set rate (%dHz) for pixel clk\n", rate);
return false;
}
+ clk_enable(ldev->pixel_clk);

adjusted_mode->clock = clk_get_rate(ldev->pixel_clk) / 1000;

--
2.15.0


2019-05-27 12:29:46

by Philippe Cornu

[permalink] [raw]
Subject: Re: [PATCH] drm/stm: ltdc: restore calls to clk_{enable/disable}

Hi Benjamin,

Many thanks for this fix (and more generally for pushing STM patches on
misc :-)

Acked-by: Philippe Cornu <[email protected]>

Philippe :-)

On 5/27/19 1:58 PM, Benjamin Gaignard wrote:
> From: Benjamin Gaignard <[email protected]>
>
> Restore calls to clk_{enable/disable} deleted after applying the wrong
> version of the patch
>
> Fixes: fd6905fca4f0 ("drm/stm: ltdc: remove clk_round_rate comment")
>
> Signed-off-by: Benjamin Gaignard <[email protected]>
> ---
> drivers/gpu/drm/stm/ltdc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index ae2aaf2a62ee..ac29890edeb6 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -507,10 +507,12 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
> struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> int rate = mode->clock * 1000;
>
> + clk_disable(ldev->pixel_clk);
> if (clk_set_rate(ldev->pixel_clk, rate) < 0) {
> DRM_ERROR("Cannot set rate (%dHz) for pixel clk\n", rate);
> return false;
> }
> + clk_enable(ldev->pixel_clk);
>
> adjusted_mode->clock = clk_get_rate(ldev->pixel_clk) / 1000;
>
>

2019-05-28 07:33:06

by Benjamin Gaignard

[permalink] [raw]
Subject: Re: [PATCH] drm/stm: ltdc: restore calls to clk_{enable/disable}

Le lun. 27 mai 2019 à 14:28, Philippe CORNU <[email protected]> a écrit :
>
> Hi Benjamin,
>
> Many thanks for this fix (and more generally for pushing STM patches on
> misc :-)
>
> Acked-by: Philippe Cornu <[email protected]>

Applied on drm-misc-next,
sorry for the mistake.

Benjamin
>
> Philippe :-)
>
> On 5/27/19 1:58 PM, Benjamin Gaignard wrote:
> > From: Benjamin Gaignard <[email protected]>
> >
> > Restore calls to clk_{enable/disable} deleted after applying the wrong
> > version of the patch
> >
> > Fixes: fd6905fca4f0 ("drm/stm: ltdc: remove clk_round_rate comment")
> >
> > Signed-off-by: Benjamin Gaignard <[email protected]>
> > ---
> > drivers/gpu/drm/stm/ltdc.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> > index ae2aaf2a62ee..ac29890edeb6 100644
> > --- a/drivers/gpu/drm/stm/ltdc.c
> > +++ b/drivers/gpu/drm/stm/ltdc.c
> > @@ -507,10 +507,12 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
> > struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> > int rate = mode->clock * 1000;
> >
> > + clk_disable(ldev->pixel_clk);
> > if (clk_set_rate(ldev->pixel_clk, rate) < 0) {
> > DRM_ERROR("Cannot set rate (%dHz) for pixel clk\n", rate);
> > return false;
> > }
> > + clk_enable(ldev->pixel_clk);
> >
> > adjusted_mode->clock = clk_get_rate(ldev->pixel_clk) / 1000;
> >
> >
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel