drm/meson: fix primary plane disabling
authorNeil Armstrong <narmstrong@baylibre.com>
Wed, 5 Jun 2019 14:12:52 +0000 (16:12 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Fri, 7 Jun 2019 08:04:21 +0000 (10:04 +0200)
The primary plane disable logic is flawed, when the primary plane is
disabled, it is re-enabled in the vsync irq when another plane is updated.

Handle the plane disabling correctly by handling the primary plane
enable flag in the primary plane update & disable callbacks.

Fixes: 490f50c109d1 ("drm/meson: Add G12A support for OSD1 Plane")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190605141253.24165-2-narmstrong@baylibre.com
drivers/gpu/drm/meson/meson_crtc.c
drivers/gpu/drm/meson/meson_plane.c

index 6857151441568b4935618b6e0f6a7bd23eade9e3..50a9a96720b96c8ba94a07fbab5fc0cb840ab6ea 100644 (file)
@@ -107,8 +107,6 @@ static void meson_g12a_crtc_atomic_enable(struct drm_crtc *crtc,
                        priv->io_base + _REG(VPP_OUT_H_V_SIZE));
 
        drm_crtc_vblank_on(crtc);
-
-       priv->viu.osd1_enabled = true;
 }
 
 static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
@@ -137,8 +135,6 @@ static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
                            priv->io_base + _REG(VPP_MISC));
 
        drm_crtc_vblank_on(crtc);
-
-       priv->viu.osd1_enabled = true;
 }
 
 static void meson_g12a_crtc_atomic_disable(struct drm_crtc *crtc,
index 22490047932ec11a7f199cf653100a11b21d56b1..b788280895c65d0825ad4521a5b1c41178e8f856 100644 (file)
@@ -305,6 +305,8 @@ static void meson_plane_atomic_update(struct drm_plane *plane,
                meson_plane->enabled = true;
        }
 
+       priv->viu.osd1_enabled = true;
+
        spin_unlock_irqrestore(&priv->drm->event_lock, flags);
 }
 
@@ -323,7 +325,7 @@ static void meson_plane_atomic_disable(struct drm_plane *plane,
                                    priv->io_base + _REG(VPP_MISC));
 
        meson_plane->enabled = false;
-
+       priv->viu.osd1_enabled = false;
 }
 
 static const struct drm_plane_helper_funcs meson_plane_helper_funcs = {