* [PATCH] drm/stm: ltdc: remove call of pm-runtime functions
@ 2020-07-01 12:04 Yannick Fertre
2020-07-02 12:18 ` Philippe CORNU
0 siblings, 1 reply; 3+ messages in thread
From: Yannick Fertre @ 2020-07-01 12:04 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Benjamin Gaignard, David Airlie,
Daniel Vetter, Maxime Coquelin, Alexandre Torgue, dri-devel,
linux-stm32, linux-arm-kernel, linux-kernel
It is not necessary to suspend or stop the ltdc clocks
to modify the pixel clock.
Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
---
drivers/gpu/drm/stm/ltdc.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 3f590d916e91..6e28f707092f 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -506,15 +506,7 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
struct drm_display_mode *adjusted_mode)
{
struct ltdc_device *ldev = crtc_to_ltdc(crtc);
- struct drm_device *ddev = crtc->dev;
int rate = mode->clock * 1000;
- bool runtime_active;
- int ret;
-
- runtime_active = pm_runtime_active(ddev->dev);
-
- if (runtime_active)
- pm_runtime_put_sync(ddev->dev);
if (clk_set_rate(ldev->pixel_clk, rate) < 0) {
DRM_ERROR("Cannot set rate (%dHz) for pixel clk\n", rate);
@@ -523,14 +515,6 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
adjusted_mode->clock = clk_get_rate(ldev->pixel_clk) / 1000;
- if (runtime_active) {
- ret = pm_runtime_get_sync(ddev->dev);
- if (ret) {
- DRM_ERROR("Failed to fixup mode, cannot get sync\n");
- return false;
- }
- }
-
DRM_DEBUG_DRIVER("requested clock %dkHz, adjusted clock %dkHz\n",
mode->clock, adjusted_mode->clock);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/stm: ltdc: remove call of pm-runtime functions
2020-07-01 12:04 [PATCH] drm/stm: ltdc: remove call of pm-runtime functions Yannick Fertre
@ 2020-07-02 12:18 ` Philippe CORNU
2020-07-08 9:49 ` Benjamin Gaignard
0 siblings, 1 reply; 3+ messages in thread
From: Philippe CORNU @ 2020-07-02 12:18 UTC (permalink / raw)
To: Yannick FERTRE, Benjamin GAIGNARD, David Airlie, Daniel Vetter,
Maxime Coquelin, Alexandre TORGUE, dri-devel, linux-stm32,
linux-arm-kernel, linux-kernel
On 7/1/20 2:04 PM, Yannick Fertre wrote:
> It is not necessary to suspend or stop the ltdc clocks
> to modify the pixel clock.
>
> Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> ---
> drivers/gpu/drm/stm/ltdc.c | 16 ----------------
> 1 file changed, 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 3f590d916e91..6e28f707092f 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -506,15 +506,7 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
> struct drm_display_mode *adjusted_mode)
> {
> struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> - struct drm_device *ddev = crtc->dev;
> int rate = mode->clock * 1000;
> - bool runtime_active;
> - int ret;
> -
> - runtime_active = pm_runtime_active(ddev->dev);
> -
> - if (runtime_active)
> - pm_runtime_put_sync(ddev->dev);
>
> if (clk_set_rate(ldev->pixel_clk, rate) < 0) {
> DRM_ERROR("Cannot set rate (%dHz) for pixel clk\n", rate);
> @@ -523,14 +515,6 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
>
> adjusted_mode->clock = clk_get_rate(ldev->pixel_clk) / 1000;
>
> - if (runtime_active) {
> - ret = pm_runtime_get_sync(ddev->dev);
> - if (ret) {
> - DRM_ERROR("Failed to fixup mode, cannot get sync\n");
> - return false;
> - }
> - }
> -
> DRM_DEBUG_DRIVER("requested clock %dkHz, adjusted clock %dkHz\n",
> mode->clock, adjusted_mode->clock);
>
>
Hi Yannick,
Many thanks for your patch,
Acked-by: Philippe Cornu <philippe.cornu@st.com>
Philippe :-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/stm: ltdc: remove call of pm-runtime functions
2020-07-02 12:18 ` Philippe CORNU
@ 2020-07-08 9:49 ` Benjamin Gaignard
0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2020-07-08 9:49 UTC (permalink / raw)
To: Philippe CORNU
Cc: Yannick FERTRE, Benjamin GAIGNARD, David Airlie, Daniel Vetter,
Maxime Coquelin, Alexandre TORGUE, dri-devel, linux-stm32,
linux-arm-kernel, linux-kernel
Le jeu. 2 juil. 2020 à 14:18, Philippe CORNU <philippe.cornu@st.com> a écrit :
>
>
>
> On 7/1/20 2:04 PM, Yannick Fertre wrote:
> > It is not necessary to suspend or stop the ltdc clocks
> > to modify the pixel clock.
> >
> > Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> > ---
> > drivers/gpu/drm/stm/ltdc.c | 16 ----------------
> > 1 file changed, 16 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> > index 3f590d916e91..6e28f707092f 100644
> > --- a/drivers/gpu/drm/stm/ltdc.c
> > +++ b/drivers/gpu/drm/stm/ltdc.c
> > @@ -506,15 +506,7 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
> > struct drm_display_mode *adjusted_mode)
> > {
> > struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> > - struct drm_device *ddev = crtc->dev;
> > int rate = mode->clock * 1000;
> > - bool runtime_active;
> > - int ret;
> > -
> > - runtime_active = pm_runtime_active(ddev->dev);
> > -
> > - if (runtime_active)
> > - pm_runtime_put_sync(ddev->dev);
> >
> > if (clk_set_rate(ldev->pixel_clk, rate) < 0) {
> > DRM_ERROR("Cannot set rate (%dHz) for pixel clk\n", rate);
> > @@ -523,14 +515,6 @@ static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc,
> >
> > adjusted_mode->clock = clk_get_rate(ldev->pixel_clk) / 1000;
> >
> > - if (runtime_active) {
> > - ret = pm_runtime_get_sync(ddev->dev);
> > - if (ret) {
> > - DRM_ERROR("Failed to fixup mode, cannot get sync\n");
> > - return false;
> > - }
> > - }
> > -
> > DRM_DEBUG_DRIVER("requested clock %dkHz, adjusted clock %dkHz\n",
> > mode->clock, adjusted_mode->clock);
> >
> >
> Hi Yannick,
> Many thanks for your patch,
> Acked-by: Philippe Cornu <philippe.cornu@st.com>
> Philippe :-)
Applied on drm-misc-next.
Thanks,
Benjamin
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-07-08 9:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 12:04 [PATCH] drm/stm: ltdc: remove call of pm-runtime functions Yannick Fertre
2020-07-02 12:18 ` Philippe CORNU
2020-07-08 9:49 ` Benjamin Gaignard
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).