Skip to contentSkip to conversation

drm/exynos: modify condition in mixer and hdmi resume

PATCH New Rahul Sharma 1 participant 1 message Feb 22, 2013

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

PATCH v2 1/1 drm/exynos: modify condition in mixer and hdmi resume

From: Prathyush K <[email protected]>

If mixer is runtime suspended (by DPMS OFF), mixer_suspend does not call mixer_poweroff and just returns. Similarily the mixer_resume should not resume the mixer if mixer is runtime_suspended. It should be done through DPMS ON.

The existing check is stopping the resume. This issue is fixed by reversing the condiftion. It also holds good for hdmi driver.

v2: updated the error messages.

---
It is based on exynos-drm-next-todo branch at
git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git

 drivers/gpu/drm/exynos/exynos_hdmi.c  | 9 ++++++---
 drivers/gpu/drm/exynos/exynos_mixer.c | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +6 -3
index 9e3c2ad..67030b1 100644
@@ -2365,7 +2365,8 @@ static int hdmi_suspend(struct device *dev)
 		drm_helper_hpd_irq_event(ctx->drm_dev);
 
 	if (pm_runtime_suspended(dev)) {
-		DRM_DEBUG_KMS("%s : Already suspended\n", __func__);
+		DRM_DEBUG_KMS("%s: already runtime-suspended.\n",
+			__func__);
 		return 0;
 	}
 
@@ -2386,8 +2387,10 @@ static int hdmi_resume(struct device *dev)
 	enable_irq(hdata->external_irq);
 	enable_irq(hdata->internal_irq);
 
-	if (!pm_runtime_suspended(dev)) {
-		DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
+	if (pm_runtime_suspended(dev)) {
+		/* dpms callback should resume the hdmi. */
+		DRM_DEBUG_KMS("%s: already runtime-suspended.\n",
+		__func__);
 		return 0;
 	}
 
drivers/gpu/drm/exynos/exynos_mixer.c +6 -3
index 5139a43..3c12518 100644
@@ -1249,7 +1249,8 @@ static int mixer_suspend(struct device *dev)
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
 	if (pm_runtime_suspended(dev)) {
-		DRM_DEBUG_KMS("%s : Already suspended\n", __func__);
+		DRM_DEBUG_KMS("%s: already runtime-suspended.\n",
+			__func__);
 		return 0;
 	}
 
@@ -1265,8 +1266,10 @@ static int mixer_resume(struct device *dev)
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
-	if (!pm_runtime_suspended(dev)) {
-		DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
+	if (pm_runtime_suspended(dev)) {
+		/* dpms callback should resume the mixer. */
+		DRM_DEBUG_KMS("%s: already runtime-suspended.\n",
+		__func__);
 		return 0;
 	}
 
Signature · 1 line
1.8.0