Skip to contentSkip to conversation

drm/stm: ltdc: remove call of pm-runtime functions

PATCH In review Yannick Fertre 3 participants 3 messages Jul 1, 2020 – Jul 8, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/stm: ltdc: remove call of pm-runtime functions

It is not necessary to suspend or stop the ltdc clocks to modify the pixel clock.

---
 drivers/gpu/drm/stm/ltdc.c | 16 ----------------
 1 file changed, 16 deletions(-)
drivers/gpu/drm/stm/ltdc.c +0 -16
index 3f590d916e91..6e28f707092f 100644
@@ -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);
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 34 lines · Yannick Fertre

It is not necessary to suspend or stop the ltdc clocks to modify the pixel clock.

---
  drivers/gpu/drm/stm/ltdc.c | 16 ----------------
  1 file changed, 16 deletions(-)
drivers/gpu/drm/stm/ltdc.c +0 -9
index 3f590d916e91..6e28f707092f 100644
@@ -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) {

drivers/gpu/drm/stm/ltdc.c static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc, · line 520

Quoted 10 lines
drivers/gpu/drm/stm/ltdc.c +0 -7
-		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,

Philippe :-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
Quoted 50 lines · Philippe CORNU
Quoted 34 lines · Yannick Fertre

It is not necessary to suspend or stop the ltdc clocks to modify the pixel clock.

---
  drivers/gpu/drm/stm/ltdc.c | 16 ----------------
  1 file changed, 16 deletions(-)
drivers/gpu/drm/stm/ltdc.c +0 -9
index 3f590d916e91..6e28f707092f 100644
@@ -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) {

drivers/gpu/drm/stm/ltdc.c static bool ltdc_crtc_mode_fixup(struct drm_crtc *crtc, · line 520

Quoted 10 lines
drivers/gpu/drm/stm/ltdc.c +0 -7
-             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,

Quoted 2 lines

Philippe :-)

Applied on drm-misc-next.

Thanks,
Benjamin

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel