Skip to contentSkip to conversation

drm/exynos: add check for the device power status

PATCH New Shirish S 1 participant 1 message Jan 24, 2013

Subsystems (3)
lore
Share & tools
lore

Shirish S

author
#0 lore raw

PATCH 1/1 drm/exynos: add check for the device power status

V2: Add mutex protection, while read.

The hdmi and mixer win_commit calls currently are
not checking the status of IP before updating the
respective registers, this patch adds this check.

---
 drivers/gpu/drm/exynos/exynos_hdmi.c  | 7 +++++++
 drivers/gpu/drm/exynos/exynos_mixer.c | 7 +++++++
 2 files changed, 14 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +7 -0
index 2c46b6c..05335ae 100644
@@ -2170,6 +2170,13 @@ static void hdmi_commit(void *ctx)
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
+	mutex_lock(&hdata->hdmi_mutex);
+	if (!hdata->powered) {
+		mutex_unlock(&hdata->hdmi_mutex);
+		return;
+	}
+	mutex_unlock(&hdata->hdmi_mutex);
+
 	hdmi_conf_apply(hdata);
 }
 
drivers/gpu/drm/exynos/exynos_mixer.c +7 -0
index 21db895..9fba6bd 100644
@@ -775,6 +775,13 @@ static void mixer_win_commit(void *ctx, int win)
 
 	DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
+	mutex_lock(&mixer_ctx->mixer_mutex);
+	if (!mixer_ctx->powered) {
+		mutex_unlock(&mixer_ctx->mixer_mutex);
+		return;
+	}
+	mutex_unlock(&mixer_ctx->mixer_mutex);
+
 	if (win > 1 && mixer_ctx->vp_enabled)
 		vp_video_buffer(mixer_ctx, win);
 	else
Signature · 1 line
1.8.0