]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/rockchip: vop2: Make overlay layer select register configuration take effect...
authorAndy Yan <andy.yan@rock-chips.com>
Tue, 18 Mar 2025 06:20:17 +0000 (14:20 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Thu, 10 Apr 2025 08:27:38 +0000 (10:27 +0200)
Because the layer/window enable/disable is take effect by vsync, if the
overlay configuration of these layers does not follow vsync and
takes effect immediately instead, when multiple layers are dynamically
enable/disable, inconsistent display contents may be seen on the screen.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20250318062024.4555-1-andyshrk@163.com
drivers/gpu/drm/rockchip/rockchip_drm_vop2.h
drivers/gpu/drm/rockchip/rockchip_vop2_reg.c

index 680bedbb770e6f2deedbd593af49f1f2092ca51e..fc3ecb9fcd9576d20c0fdfa8df469dfbff6605da 100644 (file)
@@ -710,6 +710,7 @@ enum dst_factor_mode {
 
 #define VOP2_COLOR_KEY_MASK                            BIT(31)
 
+#define RK3568_OVL_CTRL__LAYERSEL_REGDONE_SEL          GENMASK(31, 30)
 #define RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD          BIT(28)
 #define RK3568_OVL_CTRL__YUV_MODE(vp)                  BIT(vp)
 
index 14958d6b3d2e707161f2baf999ea01bef9a15734..c5bcf8e2f30ebd45c4bdfbc83626e2c266832048 100644 (file)
@@ -2070,7 +2070,10 @@ static void rk3568_vop2_setup_layer_mixer(struct vop2_video_port *vp)
        struct rockchip_crtc_state *vcstate = to_rockchip_crtc_state(vp->crtc.state);
 
        ovl_ctrl = vop2_readl(vop2, RK3568_OVL_CTRL);
-       ovl_ctrl |= RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD;
+       ovl_ctrl &= ~RK3568_OVL_CTRL__LAYERSEL_REGDONE_IMD;
+       ovl_ctrl &= ~RK3568_OVL_CTRL__LAYERSEL_REGDONE_SEL;
+       ovl_ctrl |= FIELD_PREP(RK3568_OVL_CTRL__LAYERSEL_REGDONE_SEL, vp->id);
+
        if (vcstate->yuv_overlay)
                ovl_ctrl |= RK3568_OVL_CTRL__YUV_MODE(vp->id);
        else