Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/meson: fix primary plane disabling

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

+3 -5
-4
drivers/gpu/drm/meson/meson_crtc.c
··· 107 107 priv->io_base + _REG(VPP_OUT_H_V_SIZE)); 108 108 109 109 drm_crtc_vblank_on(crtc); 110 - 111 - priv->viu.osd1_enabled = true; 112 110 } 113 111 114 112 static void meson_crtc_atomic_enable(struct drm_crtc *crtc, ··· 135 137 priv->io_base + _REG(VPP_MISC)); 136 138 137 139 drm_crtc_vblank_on(crtc); 138 - 139 - priv->viu.osd1_enabled = true; 140 140 } 141 141 142 142 static void meson_g12a_crtc_atomic_disable(struct drm_crtc *crtc,
+3 -1
drivers/gpu/drm/meson/meson_plane.c
··· 305 305 meson_plane->enabled = true; 306 306 } 307 307 308 + priv->viu.osd1_enabled = true; 309 + 308 310 spin_unlock_irqrestore(&priv->drm->event_lock, flags); 309 311 } 310 312 ··· 325 323 priv->io_base + _REG(VPP_MISC)); 326 324 327 325 meson_plane->enabled = false; 328 - 326 + priv->viu.osd1_enabled = false; 329 327 } 330 328 331 329 static const struct drm_plane_helper_funcs meson_plane_helper_funcs = {