Skip to contentSkip to conversation

drm/exynos: add check for the device power status

PATCH In review Shirish S 3 participants 3 messages Jan 23, 2013 – 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

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  | 3 +++
 drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +3 -0
index 2c46b6c..ae79688 100644
@@ -2170,6 +2170,9 @@ static void hdmi_commit(void *ctx)
 
 	DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
+	if (!hdata->powered)
+		return;
+
 	hdmi_conf_apply(hdata);
 }
 
drivers/gpu/drm/exynos/exynos_mixer.c +3 -0
index 21db895..4f5433f 100644
@@ -775,6 +775,9 @@ static void mixer_win_commit(void *ctx, int win)
 
 	DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
+	if (!mixer_ctx->powered)
+		return;
+
 	if (win > 1 && mixer_ctx->vp_enabled)
 		vp_video_buffer(mixer_ctx, win);
 	else
Signature · 1 line
1.8.0
#1 lore raw
Quoted 15 lines · Shirish S

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  | 3 +++
 drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
 2 files changed, 6 insertions(+)
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -0
index 2c46b6c..ae79688 100644

drivers/gpu/drm/exynos/exynos_hdmi.c static void hdmi_commit(void *ctx) · line 2173

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -0
@@ -2170,6 +2170,9 @@ static void hdmi_commit(void *ctx)
 
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
+       if (!hdata->powered)

The rest of the driver protects reads & writes to powered with hdmi_mutex

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +2 -0
+               return;
+
        hdmi_conf_apply(hdata);
 }
 
drivers/gpu/drm/exynos/exynos_mixer.c +0 -0
index 21db895..4f5433f 100644

drivers/gpu/drm/exynos/exynos_mixer.c static void mixer_win_commit(void *ctx, int win) · line 778

Quoted 4 lines
drivers/gpu/drm/exynos/exynos_mixer.c +1 -0
@@ -775,6 +775,9 @@ static void mixer_win_commit(void *ctx, int win)
 
        DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
+       if (!mixer_ctx->powered)

This is also protected everywhere else in the driver.

Quoted 12 lines
drivers/gpu/drm/exynos/exynos_mixer.c +2 -1
+               return;
+
        if (win > 1 && mixer_ctx->vp_enabled)
                vp_video_buffer(mixer_ctx, win);
        else
--

1.8.0

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

#2 lore raw
Quoted 52 lines · Sean Paul

Review

Quoted 11 lines · Shirish S

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  | 3 +++
 drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
 2 files changed, 6 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/exynos/exynos_hdmi.c

drivers/gpu/drm/exynos/exynos_hdmi.c static void hdmi_commit(void *ctx) · line 2173

Quoted 8 lines

index 2c46b6c..ae79688 100644

drivers/gpu/drm/exynos/exynos_hdmi.c +1 -0
@@ -2170,6 +2170,9 @@ static void hdmi_commit(void *ctx)
 
        DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
 
+       if (!hdata->powered)

The rest of the driver protects reads & writes to powered with hdmi_mutex

Review

Quoted 6 lines
drivers/gpu/drm/exynos/exynos_hdmi.c +2 -0
+               return;
+
        hdmi_conf_apply(hdata);
 }
 
(quoted diff) +0 -0

b/drivers/gpu/drm/exynos/exynos_mixer.c

drivers/gpu/drm/exynos/exynos_mixer.c static void mixer_win_commit(void *ctx, int win) · line 778

Quoted 8 lines

index 21db895..4f5433f 100644

drivers/gpu/drm/exynos/exynos_mixer.c +1 -0
@@ -775,6 +775,9 @@ static void mixer_win_commit(void *ctx, int win)
 
        DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win);
 
+       if (!mixer_ctx->powered)

This is also protected everywhere else in the driver.

Thanks Sean, have uploaded patch set 2.

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_mixer.c +2 -1
+               return;
+
        if (win > 1 && mixer_ctx->vp_enabled)
                vp_video_buffer(mixer_ctx, win);
        else
--

1.8.0

Quoted 9 lines
Quoted 4 lines

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

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

Regards,
Shirish S

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