Commit 7cc9e7a6 authored by Eric Cook's avatar Eric Cook Committed by Alex Deucher

drm/amd/display: Check for Zero Range in FreeSync Calc

-check for min/max range in freesync calculation and handle it accordingly
Signed-off-by: default avatarEric <eric.cook@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Reviewed-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1c29313b
...@@ -363,6 +363,21 @@ static void calc_freesync_range(struct core_freesync *core_freesync, ...@@ -363,6 +363,21 @@ static void calc_freesync_range(struct core_freesync *core_freesync,
unsigned int index = map_index_from_stream(core_freesync, stream); unsigned int index = map_index_from_stream(core_freesync, stream);
uint32_t vtotal = stream->timing.v_total; uint32_t vtotal = stream->timing.v_total;
if ((min_refresh_in_uhz == 0) || (max_refresh_in_uhz == 0)) {
state->freesync_range.min_refresh =
state->nominal_refresh_rate_in_micro_hz;
state->freesync_range.max_refresh =
state->nominal_refresh_rate_in_micro_hz;
state->freesync_range.max_frame_duration = 0;
state->freesync_range.min_frame_duration = 0;
state->freesync_range.vmax = vtotal;
state->freesync_range.vmin = vtotal;
return;
}
min_frame_duration_in_ns = ((unsigned int) (div64_u64( min_frame_duration_in_ns = ((unsigned int) (div64_u64(
(1000000000ULL * 1000000), (1000000000ULL * 1000000),
max_refresh_in_uhz))); max_refresh_in_uhz)));
......
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