diff mbox

drm/exynos: add check for the device power status

Message ID 1358935809-1250-1-git-send-email-s.shirish@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shirish S Jan. 23, 2013, 10:10 a.m. UTC
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>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c  | 3 +++
 drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
 2 files changed, 6 insertions(+)

Comments

Sean Paul Jan. 23, 2013, 2:48 p.m. UTC | #1
On Wed, Jan 23, 2013 at 5:10 AM, Shirish S <s.shirish@samsung.com> wrote:
> 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>
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c  | 3 +++
>  drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
>  2 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 2c46b6c..ae79688 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -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

> +               return;
> +
>         hdmi_conf_apply(hdata);
>  }
>
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 21db895..4f5433f 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -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.

> +               return;
> +
>         if (win > 1 && mixer_ctx->vp_enabled)
>                 vp_video_buffer(mixer_ctx, win);
>         else
> --
> 1.8.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Shirish S Jan. 24, 2013, 2:44 a.m. UTC | #2
On Wed, Jan 23, 2013 at 8:18 PM, Sean Paul <seanpaul@chromium.org> wrote:

> On Wed, Jan 23, 2013 at 5:10 AM, Shirish S <s.shirish@samsung.com> wrote:
> > 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>
> > ---
> >  drivers/gpu/drm/exynos/exynos_hdmi.c  | 3 +++
> >  drivers/gpu/drm/exynos/exynos_mixer.c | 3 +++
> >  2 files changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c
> b/drivers/gpu/drm/exynos/exynos_hdmi.c
> > index 2c46b6c..ae79688 100644
> > --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> > +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> > @@ -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
>
> > +               return;
> > +
> >         hdmi_conf_apply(hdata);
> >  }
> >
> > diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c
> b/drivers/gpu/drm/exynos/exynos_mixer.c
> > index 21db895..4f5433f 100644
> > --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> > +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> > @@ -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.

> > +               return;
> > +
> >         if (win > 1 && mixer_ctx->vp_enabled)
> >                 vp_video_buffer(mixer_ctx, win);
> >         else
> > --
> > 1.8.0
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

Regards,
Shirish S
diff mbox

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 2c46b6c..ae79688 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -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);
 }
 
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 21db895..4f5433f 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -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