From: Arun Iyengar <[email protected]>

On RK3588 the gamma LUT update writes the whole LUT_PORT_SEL register to
select the write port, which clears the dclk source selection of video
ports 0 and 2 and the VP0/VP1 merge enable held in the same register.

Only update the write select field.

Fixes: 4f537776340d ("rockchip/drm: vop2: add support for gamma LUT")
Reviewed-by: Chaoyi Chen <[email protected]>
Reviewed-by: Damon Ding <[email protected]>
Signed-off-by: Arun Iyengar <[email protected]>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c 
b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
index 1408b539c311..d4103e02f37f 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
@@ -1625,8 +1625,9 @@ static void vop2_crtc_atomic_set_gamma_seamless(struct 
vop2 *vop2,
                                                struct vop2_video_port *vp,
                                                struct drm_crtc *crtc)
 {
-       vop2_writel(vop2, RK3568_LUT_PORT_SEL,
-                   FIELD_PREP(RK3588_LUT_PORT_SEL__GAMMA_AHB_WRITE_SEL, 
vp->id));
+       regmap_update_bits(vop2->map, RK3568_LUT_PORT_SEL,
+                          RK3588_LUT_PORT_SEL__GAMMA_AHB_WRITE_SEL,
+                          FIELD_PREP(RK3588_LUT_PORT_SEL__GAMMA_AHB_WRITE_SEL, 
vp->id));
        vop2_vp_dsp_lut_enable(vp);
        vop2_crtc_write_gamma_lut(vop2, crtc);
        vop2_vp_dsp_lut_update_enable(vp);

-- 
2.55.0


Reply via email to