summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYongqiang Sun <yongqiang.sun@amd.com>2017-08-30 11:55:40 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 18:17:26 -0400
commit649e0c7679a5189dec1045329e36cfcf41919dc9 (patch)
tree29397b576c297c15beb1cf00c98d954187c1f958
parent6f54d0b1d82194116fcb8a3683827c9d8eb8cb9b (diff)
downloadlinux-stable-649e0c7679a5189dec1045329e36cfcf41919dc9.tar.gz
linux-stable-649e0c7679a5189dec1045329e36cfcf41919dc9.tar.bz2
linux-stable-649e0c7679a5189dec1045329e36cfcf41919dc9.zip
drm/amd/display: Added negative check for vertical line start.
In case of vstartup happens before vsync, set vertical line start to 0. Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
index 405f595f219a..2d3dd9a3a196 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_timing_generator.c
@@ -118,7 +118,7 @@ static void tgn10_program_timing(
uint32_t start_point = 0;
uint32_t field_num = 0;
uint32_t h_div_2;
- uint32_t vertial_line_start;
+ int32_t vertical_line_start;
struct dcn10_timing_generator *tgn10 = DCN10TG_FROM_TG(tg);
@@ -216,9 +216,13 @@ static void tgn10_program_timing(
/* Use OTG_VERTICAL_INTERRUPT2 replace VUPDATE interrupt,
* program the reg for interrupt postition.
*/
- vertial_line_start = asic_blank_end - tg->dlg_otg_param.vstartup_start + 1;
+ vertical_line_start = asic_blank_end - tg->dlg_otg_param.vstartup_start + 1;
+ if (vertical_line_start < 0) {
+ ASSERT(0);
+ vertical_line_start = 0;
+ }
REG_SET(OTG_VERTICAL_INTERRUPT2_POSITION, 0,
- OTG_VERTICAL_INTERRUPT2_LINE_START, vertial_line_start);
+ OTG_VERTICAL_INTERRUPT2_LINE_START, vertical_line_start);
/* v_sync polarity */
v_sync_polarity = patched_crtc_timing.flags.VSYNC_POSITIVE_POLARITY ?