Skip to content

Commit 7f6721b

Browse files
Andy Yanmmind
authored andcommitted
drm/rockchip: vop2: Only wait for changed layer cfg done when there is pending cfgdone bits
The write of cfgdone bits always done at .atomic_flush. When userspace makes plane zpos changes of two crtc within one commit, at the .atomic_begin stage, crtcN will never receive the "layer change cfg done" event of crtcM because crtcM has not yet written "cfgdone". So only wait when there is pending cfgdone bits to avoid long timeout. Fixes: 3e89a8c ("drm/rockchip: vop2: Fix the update of LAYER/PORT select registers when there are multi display output on rk3588/rk3568") Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patch.msgid.link/20250718064120.8811-2-andyshrk@163.com
1 parent 9fae824 commit 7f6721b

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/gpu/drm/rockchip/rockchip_vop2_reg.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,7 @@ static void rk3568_vop2_setup_layer_mixer(struct vop2_video_port *vp)
21442144
u8 layer_sel_id;
21452145
unsigned int ofs;
21462146
u32 ovl_ctrl;
2147+
u32 cfg_done;
21472148
int i;
21482149
struct vop2_video_port *vp0 = &vop2->vps[0];
21492150
struct vop2_video_port *vp1 = &vop2->vps[1];
@@ -2298,8 +2299,16 @@ static void rk3568_vop2_setup_layer_mixer(struct vop2_video_port *vp)
22982299
rk3568_vop2_wait_for_port_mux_done(vop2);
22992300
}
23002301

2301-
if (layer_sel != old_layer_sel && atv_layer_sel != old_layer_sel)
2302-
rk3568_vop2_wait_for_layer_cfg_done(vop2, vop2->old_layer_sel);
2302+
if (layer_sel != old_layer_sel && atv_layer_sel != old_layer_sel) {
2303+
cfg_done = vop2_readl(vop2, RK3568_REG_CFG_DONE);
2304+
cfg_done &= (BIT(vop2->data->nr_vps) - 1);
2305+
cfg_done &= ~BIT(vp->id);
2306+
/*
2307+
* Changes of other VPs' overlays have not taken effect
2308+
*/
2309+
if (cfg_done)
2310+
rk3568_vop2_wait_for_layer_cfg_done(vop2, vop2->old_layer_sel);
2311+
}
23032312

23042313
vop2_writel(vop2, RK3568_OVL_LAYER_SEL, layer_sel);
23052314
mutex_unlock(&vop2->ovl_lock);

0 commit comments

Comments
 (0)