Skip to content

Commit

Permalink
drm/exynos: add check for the device power status
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Shirish S <s.shirish@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Shirish S authored and Inki Dae committed Jan 25, 2013
1 parent 428982e commit dda9012
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/exynos/exynos_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2163,6 +2163,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);
}

Expand Down
7 changes: 7 additions & 0 deletions drivers/gpu/drm/exynos/exynos_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,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
Expand Down

0 comments on commit dda9012

Please sign in to comment.