Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Fix logical vs bitwise bug in get_embedded_panel_info_v2_1()

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>

authored by

Dan Carpenter and committed by
Alex Deucher
1a794826 621e55f1

+4 -4
+4 -4
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c
··· 1480 1480 /* not provided by VBIOS */ 1481 1481 info->lcd_timing.misc_info.HORIZONTAL_CUT_OFF = 0; 1482 1482 1483 - info->lcd_timing.misc_info.H_SYNC_POLARITY = ~(uint32_t) (lvds->lcd_timing.miscinfo 1484 - & ATOM_HSYNC_POLARITY); 1485 - info->lcd_timing.misc_info.V_SYNC_POLARITY = ~(uint32_t) (lvds->lcd_timing.miscinfo 1486 - & ATOM_VSYNC_POLARITY); 1483 + info->lcd_timing.misc_info.H_SYNC_POLARITY = !(lvds->lcd_timing.miscinfo & 1484 + ATOM_HSYNC_POLARITY); 1485 + info->lcd_timing.misc_info.V_SYNC_POLARITY = !(lvds->lcd_timing.miscinfo & 1486 + ATOM_VSYNC_POLARITY); 1487 1487 1488 1488 /* not provided by VBIOS */ 1489 1489 info->lcd_timing.misc_info.VERTICAL_CUT_OFF = 0;