linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/stm: ltdc: check crtc state before enabling LIE
@ 2020-01-21 10:14 Yannick Fertre
  2020-01-23  9:50 ` Philippe CORNU
  0 siblings, 1 reply; 3+ messages in thread
From: Yannick Fertre @ 2020-01-21 10:14 UTC (permalink / raw)
  To: Yannick Fertre, Philippe Cornu, Benjamin Gaignard, David Airlie,
	Daniel Vetter, Maxime Coquelin, Alexandre Torgue, dri-devel,
	linux-stm32, linux-arm-kernel, linux-kernel

Following investigations of a hardware bug, the LIE interrupt
can occur while the display controller is not activated.
LIE interrupt (vblank) don't have to be set if the CRTC is not
enabled.

Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
---
 drivers/gpu/drm/stm/ltdc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index c2815e8..ea654c7 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -648,9 +648,14 @@ static const struct drm_crtc_helper_funcs ltdc_crtc_helper_funcs = {
 static int ltdc_crtc_enable_vblank(struct drm_crtc *crtc)
 {
 	struct ltdc_device *ldev = crtc_to_ltdc(crtc);
+	struct drm_crtc_state *state = crtc->state;
 
 	DRM_DEBUG_DRIVER("\n");
-	reg_set(ldev->regs, LTDC_IER, IER_LIE);
+
+	if (state->enable)
+		reg_set(ldev->regs, LTDC_IER, IER_LIE);
+	else
+		return -EPERM;
 
 	return 0;
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/stm: ltdc: check crtc state before enabling LIE
  2020-01-21 10:14 [PATCH] drm/stm: ltdc: check crtc state before enabling LIE Yannick Fertre
@ 2020-01-23  9:50 ` Philippe CORNU
  2020-02-04 10:58   ` Benjamin Gaignard
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe CORNU @ 2020-01-23  9:50 UTC (permalink / raw)
  To: Yannick FERTRE, Benjamin GAIGNARD, David Airlie, Daniel Vetter,
	Maxime Coquelin, Alexandre TORGUE, dri-devel, linux-stm32,
	linux-arm-kernel, linux-kernel

Dear Yannick,
Thank you for your patch,

Acked-by: Philippe Cornu <philippe.cornu@st.com>

Philippe :-)

On 1/21/20 11:14 AM, Yannick Fertre wrote:
> Following investigations of a hardware bug, the LIE interrupt
> can occur while the display controller is not activated.
> LIE interrupt (vblank) don't have to be set if the CRTC is not
> enabled.
> 
> Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> ---
>   drivers/gpu/drm/stm/ltdc.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index c2815e8..ea654c7 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -648,9 +648,14 @@ static const struct drm_crtc_helper_funcs ltdc_crtc_helper_funcs = {
>   static int ltdc_crtc_enable_vblank(struct drm_crtc *crtc)
>   {
>   	struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> +	struct drm_crtc_state *state = crtc->state;
>   
>   	DRM_DEBUG_DRIVER("\n");
> -	reg_set(ldev->regs, LTDC_IER, IER_LIE);
> +
> +	if (state->enable)
> +		reg_set(ldev->regs, LTDC_IER, IER_LIE);
> +	else
> +		return -EPERM;
>   
>   	return 0;
>   }
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/stm: ltdc: check crtc state before enabling LIE
  2020-01-23  9:50 ` Philippe CORNU
@ 2020-02-04 10:58   ` Benjamin Gaignard
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2020-02-04 10:58 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Yannick FERTRE, Benjamin GAIGNARD, David Airlie, Daniel Vetter,
	Maxime Coquelin, Alexandre TORGUE, dri-devel, linux-stm32,
	linux-arm-kernel, linux-kernel

Le jeu. 23 janv. 2020 à 10:50, Philippe CORNU <philippe.cornu@st.com> a écrit :
>
> Dear Yannick,
> Thank you for your patch,
>
> Acked-by: Philippe Cornu <philippe.cornu@st.com>
>
> Philippe :-)
>
> On 1/21/20 11:14 AM, Yannick Fertre wrote:
> > Following investigations of a hardware bug, the LIE interrupt
> > can occur while the display controller is not activated.
> > LIE interrupt (vblank) don't have to be set if the CRTC is not
> > enabled.
> >

Applied on drm-misc-next.

Thanks
Benjamin

> > Signed-off-by: Yannick Fertre <yannick.fertre@st.com>
> > ---
> >   drivers/gpu/drm/stm/ltdc.c | 7 ++++++-
> >   1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> > index c2815e8..ea654c7 100644
> > --- a/drivers/gpu/drm/stm/ltdc.c
> > +++ b/drivers/gpu/drm/stm/ltdc.c
> > @@ -648,9 +648,14 @@ static const struct drm_crtc_helper_funcs ltdc_crtc_helper_funcs = {
> >   static int ltdc_crtc_enable_vblank(struct drm_crtc *crtc)
> >   {
> >       struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> > +     struct drm_crtc_state *state = crtc->state;
> >
> >       DRM_DEBUG_DRIVER("\n");
> > -     reg_set(ldev->regs, LTDC_IER, IER_LIE);
> > +
> > +     if (state->enable)
> > +             reg_set(ldev->regs, LTDC_IER, IER_LIE);
> > +     else
> > +             return -EPERM;
> >
> >       return 0;
> >   }
> >
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-04 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21 10:14 [PATCH] drm/stm: ltdc: check crtc state before enabling LIE Yannick Fertre
2020-01-23  9:50 ` Philippe CORNU
2020-02-04 10:58   ` Benjamin Gaignard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).