Re: [PATCH v3 4/8] drm/rockchip: vop2: Fix the HDMI sync polarity bit order on RK3588

From: Damon Ding

Date: Wed Nov 18 2026 - 04:48:42 EST


Hi Arun,

On 11/14/2026 12:39 AM, Arun Iyengar via B4 Relay wrote:
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>

In GRF_VO1_CON0 the HDMI vsync polarity bit comes before the hsync one
(bits 5 and 6 for HDMI0, 7 and 8 for HDMI1), but rk3588_get_hdmi_pol()
puts hsync first. Modes with mixed sync polarities go out with both
syncs inverted: the HDMI controller sees 1920x1080@144 +HSync -VSync
as -HSync +VSync in VIDEO_INTERFACE_STATUS0.

Fixes: 5a028e8f062f ("drm/rockchip: vop2: Add support for rk3588")
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/gpu/drm/rockchip/rockchip_vop2_reg.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
index 3e654cb99ddf..6d08988d7007 100644
--- a/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
+++ b/drivers/gpu/drm/rockchip/rockchip_vop2_reg.c
@@ -1683,13 +1683,13 @@ static u32 rk3588_get_mipi_port_mux(int vp_id)
return 0;
}
-/* The sync polarity bits in GRF_VO1_CON0 are set for a negative sync */
+/* GRF_VO1_CON0: vsync bit below the hsync bit, each set for a negative sync */
static u32 rk3588_get_hdmi_pol(u32 polflags)
{
u32 val;
- val = (polflags & BIT(HSYNC_POSITIVE)) ? 0 : BIT(HSYNC_POSITIVE);
- val |= (polflags & BIT(VSYNC_POSITIVE)) ? 0 : BIT(VSYNC_POSITIVE);
+ val = (polflags & BIT(VSYNC_POSITIVE)) ? 0 : BIT(0);
+ val |= (polflags & BIT(HSYNC_POSITIVE)) ? 0 : BIT(1);
return val;
}


Oh, this is a good catch. I verified the RK3588 HDMI sync polarity bits are arranged differently from other interfaces.

Would it make sense to add two macros for these bits under RK3588_GRF_VO1_CON0 in rockchip_drm_vop2.h:

#define RK3588_HDMI_VSYNC_INVERT BIT(0)
#define RK3588_HDMI_HSYNC_INVERT BIT(1)

rather than using raw BIT(0) and BIT(1)?

Best regards,
Damon