[Freedreno] [PATCH RESEND 08/10] drm/msm: Sprinkle pm_runtime calls around

Sean Paul seanpaul at chromium.org
Wed Feb 21 15:18:36 UTC 2018


Adding missing pm_runtime references where appropriate.

Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c |  3 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c  | 10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
index f1642d72469e..df6cbeb15cf5 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
@@ -3497,6 +3497,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc)
 	/* disable clk & bw control until clk & bw properties are set */
 	cstate->bw_control = false;
 	cstate->bw_split_vote = false;
+	pm_runtime_put_sync(crtc->dev->dev);
 
 	mutex_unlock(&dpu_crtc->crtc_lock);
 }
@@ -3523,6 +3524,8 @@ static void dpu_crtc_enable(struct drm_crtc *crtc,
 	DPU_EVT32_VERBOSE(DRMID(crtc));
 	dpu_crtc = to_dpu_crtc(crtc);
 
+	pm_runtime_get_sync(crtc->dev->dev);
+
 	drm_for_each_encoder(encoder, crtc->dev) {
 		if (encoder->crtc != crtc)
 			continue;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index fb4de59d8ed1..b919c9a6a463 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -114,6 +114,7 @@ static int _dpu_danger_signal_status(struct seq_file *s,
 	priv = kms->dev->dev_private;
 	memset(&status, 0, sizeof(struct dpu_danger_safe_status));
 
+	pm_runtime_get_sync(kms->dev->dev);
 	dpu_power_resource_enable(&priv->phandle, kms->core_client, true);
 	if (danger_status) {
 		seq_puts(s, "\nDanger signal status:\n");
@@ -127,6 +128,7 @@ static int _dpu_danger_signal_status(struct seq_file *s,
 					&status);
 	}
 	dpu_power_resource_enable(&priv->phandle, kms->core_client, false);
+	pm_runtime_put_sync(kms->dev->dev);
 
 	seq_printf(s, "MDP     :  0x%x\n", status.mdp);
 
@@ -346,12 +348,14 @@ static void _dpu_debugfs_destroy(struct dpu_kms *dpu_kms)
 
 static int dpu_kms_enable_vblank(struct msm_kms *kms, struct drm_crtc *crtc)
 {
+	pm_runtime_get_sync(crtc->dev->dev);
 	return dpu_crtc_vblank(crtc, true);
 }
 
 static void dpu_kms_disable_vblank(struct msm_kms *kms, struct drm_crtc *crtc)
 {
 	dpu_crtc_vblank(crtc, false);
+	pm_runtime_put_sync(crtc->dev->dev);
 }
 
 static void dpu_kms_wait_for_frame_transfer_complete(struct msm_kms *kms,
@@ -413,6 +417,7 @@ static void dpu_kms_prepare_commit(struct msm_kms *kms,
 	if (!dev || !dev->dev_private)
 		return;
 	priv = dev->dev_private;
+	pm_runtime_get_sync(dev->dev);
 	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client, true);
 
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
@@ -471,6 +476,7 @@ static void dpu_kms_complete_commit(struct msm_kms *kms,
 	}
 
 	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client, false);
+	pm_runtime_put_sync(dpu_kms->dev->dev);
 
 	DPU_EVT32_VERBOSE(DPU_EVTLOG_FUNC_EXIT);
 }
@@ -1896,7 +1902,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
 		dpu_kms->core_client = NULL;
 		goto error;
 	}
-
+	pm_runtime_get_sync(dev->dev);
 	rc = dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client,
 		true);
 	if (rc) {
@@ -2030,6 +2036,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
 			dpu_kms_handle_power_event, dpu_kms, "kms");
 
 	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client, false);
+	pm_runtime_put_sync(dev->dev);
 
 	return 0;
 
@@ -2039,6 +2046,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms)
 perf_err:
 power_error:
 	dpu_power_resource_enable(&priv->phandle, dpu_kms->core_client, false);
+	pm_runtime_put_sync(dev->dev);
 error:
 	_dpu_kms_hw_destroy(dpu_kms, platformdev);
 end:
-- 
2.16.1.291.g4437f3f132-goog



More information about the Freedreno mailing list