]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd/display: Fix logical vs bitwise bug in get_embedded_panel_info_v2_1()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 31 Oct 2025 13:02:25 +0000 (16:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:21 +0000 (14:03 +0100)
commit843bdaf0bfdd43b85b48f75845d5999c6e8a24ea
treef842b42547669bac0f47a2d235c41aff0364fc0f
parent2f4f72e580b5c90a4171a2055afcdd9676c68248
drm/amd/display: Fix logical vs bitwise bug in get_embedded_panel_info_v2_1()

[ Upstream commit 1a79482699b4d1e43948d14f0c7193dc1dcad858 ]

The .H_SYNC_POLARITY and .V_SYNC_POLARITY variables are 1 bit bitfields
of a u32.  The ATOM_HSYNC_POLARITY define is 0x2 and the
ATOM_VSYNC_POLARITY is 0x4.  When we do a bitwise negate of 0, 2, or 4
then the last bit is always 1 so this code always sets .H_SYNC_POLARITY
and .V_SYNC_POLARITY to true.

This code is instead intended to check if the ATOM_HSYNC_POLARITY or
ATOM_VSYNC_POLARITY flags are set and reverse the result.  In other
words, it's supposed to be a logical negate instead of a bitwise negate.

Fixes: ae79c310b1a6 ("drm/amd/display: Add DCE12 bios parser support")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c