Commit 97416d4c authored by Yongqiang Sun's avatar Yongqiang Sun Committed by Alex Deucher

drm/amd/display: set drr during program timing.

Signed-off-by: default avatarYongqiang Sun <yongqiang.sun@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7a8368e6
......@@ -629,6 +629,27 @@ void dce110_timing_generator_program_blanking(
CRTC_V_TOTAL);
dm_write_reg(ctx, addr, value);
/* In case of V_TOTAL_CONTROL is on, make sure V_TOTAL_MAX and
* V_TOTAL_MIN are equal to V_TOTAL.
*/
addr = CRTC_REG(mmCRTC_V_TOTAL_MAX);
value = dm_read_reg(ctx, addr);
set_reg_field_value(
value,
timing->v_total - 1,
CRTC_V_TOTAL_MAX,
CRTC_V_TOTAL_MAX);
dm_write_reg(ctx, addr, value);
addr = CRTC_REG(mmCRTC_V_TOTAL_MIN);
value = dm_read_reg(ctx, addr);
set_reg_field_value(
value,
timing->v_total - 1,
CRTC_V_TOTAL_MIN,
CRTC_V_TOTAL_MIN);
dm_write_reg(ctx, addr, value);
addr = CRTC_REG(mmCRTC_H_BLANK_START_END);
value = dm_read_reg(ctx, addr);
......
......@@ -450,6 +450,19 @@ void dce120_timing_generator_program_blanking(
CRTC_V_TOTAL,
timing->v_total - 1);
/* In case of V_TOTAL_CONTROL is on, make sure V_TOTAL_MAX and
* V_TOTAL_MIN are equal to V_TOTAL.
*/
CRTC_REG_UPDATE(
CRTC0_CRTC_V_TOTAL_MAX,
CRTC_V_TOTAL_MAX,
timing->v_total - 1);
CRTC_REG_UPDATE(
CRTC0_CRTC_V_TOTAL_MIN,
CRTC_V_TOTAL_MIN,
timing->v_total - 1);
tmp1 = timing->h_total -
(h_sync_start + timing->h_border_left);
tmp2 = tmp1 + timing->h_addressable +
......
......@@ -177,6 +177,14 @@ static void tgn10_program_timing(
REG_SET(OTG_V_TOTAL, 0,
OTG_V_TOTAL, v_total);
/* In case of V_TOTAL_CONTROL is on, make sure OTG_V_TOTAL_MAX and
* OTG_V_TOTAL_MIN are equal to V_TOTAL.
*/
REG_SET(OTG_V_TOTAL_MAX, 0,
OTG_V_TOTAL_MAX, v_total);
REG_SET(OTG_V_TOTAL_MIN, 0,
OTG_V_TOTAL_MIN, v_total);
/* v_sync_start = 0, v_sync_end = v_sync_width */
v_sync_end = patched_crtc_timing.v_sync_width * interlace_factor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment