]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/stm: ltdc: check crtc state before enabling LIE
authorYannick Fertre <yannick.fertre@st.com>
Tue, 21 Jan 2020 10:14:10 +0000 (11:14 +0100)
committerBenjamin Gaignard <benjamin.gaignard@st.com>
Tue, 4 Feb 2020 10:40:32 +0000 (11:40 +0100)
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>
Acked-by: Philippe Cornu <philippe.cornu@st.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1579601650-7055-1-git-send-email-yannick.fertre@st.com
drivers/gpu/drm/stm/ltdc.c

index 58092b0b888543ea39a19ca9bf9cadbcb7a6fb1b..8750ee831beabb5f735511e8d9fea56f64f27caa 100644 (file)
@@ -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;
 }