diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-07-27 19:24:31 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-07-29 15:50:36 -0400 |
commit | 0a90a0cff9f429f886f423967ae053150dce9259 (patch) | |
tree | 5435e747c8c4a56cbeb6ecd1dd6c0d6986529634 /drivers | |
parent | 7726e72b3d6879ee5fc743a230eb6f5afa12844b (diff) |
drm/radeon/combios: add some validation of lvds values
Fixes a broken hsync start value uncovered by:
abc0b1447d4974963548777a5ba4a4457c82c426
(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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 3e5f6b71f3ad..c097d3a82bda 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -1255,10 +1255,15 @@ struct radeon_encoder_lvds *radeon_combios_get_lvds_info(struct radeon_encoder | |||
1255 | 1255 | ||
1256 | if ((RBIOS16(tmp) == lvds->native_mode.hdisplay) && | 1256 | if ((RBIOS16(tmp) == lvds->native_mode.hdisplay) && |
1257 | (RBIOS16(tmp + 2) == lvds->native_mode.vdisplay)) { | 1257 | (RBIOS16(tmp + 2) == lvds->native_mode.vdisplay)) { |
1258 | u32 hss = (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8; | ||
1259 | |||
1260 | if (hss > lvds->native_mode.hdisplay) | ||
1261 | hss = (10 - 1) * 8; | ||
1262 | |||
1258 | lvds->native_mode.htotal = lvds->native_mode.hdisplay + | 1263 | lvds->native_mode.htotal = lvds->native_mode.hdisplay + |
1259 | (RBIOS16(tmp + 17) - RBIOS16(tmp + 19)) * 8; | 1264 | (RBIOS16(tmp + 17) - RBIOS16(tmp + 19)) * 8; |
1260 | lvds->native_mode.hsync_start = lvds->native_mode.hdisplay + | 1265 | lvds->native_mode.hsync_start = lvds->native_mode.hdisplay + |
1261 | (RBIOS16(tmp + 21) - RBIOS16(tmp + 19) - 1) * 8; | 1266 | hss; |
1262 | lvds->native_mode.hsync_end = lvds->native_mode.hsync_start + | 1267 | lvds->native_mode.hsync_end = lvds->native_mode.hsync_start + |
1263 | (RBIOS8(tmp + 23) * 8); | 1268 | (RBIOS8(tmp + 23) * 8); |
1264 | 1269 | ||