summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/amd
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-06-22 09:58:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-06-22 09:58:18 +0000
commit49ee897cd6d056ed7f9f3f0e659ae062bddabb45 (patch)
tree1c65730115978ab01424a58f946c36c7daf90744 /sys/dev/pci/drm/amd
parentea4e6ce523541cfec9583e0573812fbd73a0e582 (diff)
drm/amd/display: Revert to old formula in set_vtg_params
From Alvin Lee 719bdc4363637fa45b67c80259c6a72967cb4947 in linux 5.7.y/5.7.5 a1a0e61f3c43c610f0a3c109348c14ce930c1977 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd')
-rw-r--r--sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_optc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_optc.c b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_optc.c
index 366eea95afd..7c4874ea6aa 100644
--- a/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_optc.c
+++ b/sys/dev/pci/drm/amd/display/dc/dcn10/dcn10_optc.c
@@ -299,6 +299,7 @@ void optc1_set_vtg_params(struct timing_generator *optc,
uint32_t asic_blank_end;
uint32_t v_init;
uint32_t v_fp2 = 0;
+ int32_t vertical_line_start;
struct optc *optc1 = DCN10TG_FROM_TG(optc);
@@ -315,8 +316,9 @@ void optc1_set_vtg_params(struct timing_generator *optc,
patched_crtc_timing.v_border_top;
/* if VSTARTUP is before VSYNC, FP2 is the offset, otherwise 0 */
- if (optc1->vstartup_start > asic_blank_end)
- v_fp2 = optc1->vstartup_start - asic_blank_end;
+ vertical_line_start = asic_blank_end - optc1->vstartup_start + 1;
+ if (vertical_line_start < 0)
+ v_fp2 = -vertical_line_start;
/* Interlace */
if (REG(OTG_INTERLACE_CONTROL)) {