diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-07-27 19:24:31 -0400 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-08-19 13:17:29 -0400 |
commit | 82fbf139b01c499a7d175d8a152c36d616d29630 (patch) | |
tree | aba3eb8eb85d97ee4a688a3f74441b02d087d826 /drivers/gpu/drm/radeon/radeon_combios.c | |
parent | 89cc013797bc47c50ebf5b4a89ead3d19b1ac2e3 (diff) | |
download | lwn-82fbf139b01c499a7d175d8a152c36d616d29630.tar.gz lwn-82fbf139b01c499a7d175d8a152c36d616d29630.zip |
drm/radeon/combios: add some validation of lvds values
[ Upstream commit 0a90a0cff9f429f886f423967ae053150dce9259 ]
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
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_combios.c')
-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 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); |