mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-24 19:45:06 +08:00
drm/radeon/combios: add some validation of lvds values
Fixes a broken hsync start value uncovered by:
abc0b1447d
(drm: Perform basic sanity checks on probed modes)
The driver handled the bad hsync start elsewhere, but
the above commit prevented it from getting added.
bug:
https://bugs.freedesktop.org/show_bug.cgi?id=91401
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
This commit is contained in:
parent
7726e72b3d
commit
0a90a0cff9
@ -1255,10 +1255,15 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder
|
||||
|
||||
if ((RBIOS16(tmp) == lvds->native_mode.hdisplay) &&
|
||||
(RBIOS16(tmp + 2) == lvds->native_mode.vdisplay)) {
|
||||
u32 hss = (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8;
|
||||
|
||||
if (hss > lvds->native_mode.hdisplay)
|
||||
hss = (10 - 1) * 8;
|
||||
|
||||
lvds->native_mode.htotal = lvds->native_mode.hdisplay +
|
||||
(RBIOS16(tmp + 17) - RBIOS16(tmp + 19)) * 8;
|
||||
lvds->native_mode.hsync_start = lvds->native_mode.hdisplay +
|
||||
(RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8;
|
||||
hss;
|
||||
lvds->native_mode.hsync_end = lvds->native_mode.hsync_start +
|
||||
(RBIOS8(tmp + 23) * 8);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user