Skip to content

Commit e1ec77b

Browse files
JungerBoyogregkh
authored andcommitted
drm/rockchip: vop2: make vp registers nonvolatile
[ Upstream commit a52dffa ] Make video port registers nonvolatile. As DSP_CTRL register is written to twice due to gamma LUT enable bit which is set outside of the main DSP_CTRL initialization within atomic_enable (for rk356x case it is also necessary to always disable gamma LUT before writing a new LUT) there is a chance that DSP_CTRL value read-out in gamma LUT init/update code is not the one which was written by the preceding DSP_CTRL initialization code within atomic_enable. This might result in misconfigured DSP_CTRL which leads to no visual output[1]. Since DSP_CTRL write takes effect after VSYNC[1] the issue is not always present. When tested on Pinetab2 with kernel 6.14 it happenes only when DRM is compiled as a module[1]. In order to confirm that it is a timing issue I inserted 18ms udelay before vop2_crtc_atomic_try_set_gamma in atomic enable and compiled DRM as module - this has also fixed the issue. [1] https://lore.kernel.org/linux-rockchip/562b38e5.a496.1975f09f983.Coremail.andyshrk@163.com/ Reported-by: Diederik de Haas <didi.debian@cknow.org> Closes: https://lore.kernel.org/linux-rockchip/DAEVDSTMWI1E.J454VZN0R9MA@cknow.org/ Suggested-by: Andy Yan <andy.yan@rock-chips.com> Signed-off-by: Piotr Zalewski <pZ010001011111@proton.me> Tested-by: Diederik de Haas <didi.debian@cknow.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20250706083629.140332-2-pZ010001011111@proton.me Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3322443 commit e1ec77b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,12 +2579,13 @@ static int vop2_win_init(struct vop2 *vop2)
25792579
}
25802580

25812581
/*
2582-
* The window registers are only updated when config done is written.
2583-
* Until that they read back the old value. As we read-modify-write
2584-
* these registers mark them as non-volatile. This makes sure we read
2585-
* the new values from the regmap register cache.
2582+
* The window and video port registers are only updated when config
2583+
* done is written. Until that they read back the old value. As we
2584+
* read-modify-write these registers mark them as non-volatile. This
2585+
* makes sure we read the new values from the regmap register cache.
25862586
*/
25872587
static const struct regmap_range vop2_nonvolatile_range[] = {
2588+
regmap_reg_range(RK3568_VP0_CTRL_BASE, RK3588_VP3_CTRL_BASE + 255),
25882589
regmap_reg_range(0x1000, 0x23ff),
25892590
};
25902591

0 commit comments

Comments
 (0)