diff options
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/freesync/freesync.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index 94566c0a0e62..5c6de723da5d 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c | |||
@@ -347,6 +347,7 @@ static void calc_vmin_vmax(struct core_freesync *core_freesync, | |||
347 | { | 347 | { |
348 | unsigned int min_frame_duration_in_ns = 0, max_frame_duration_in_ns = 0; | 348 | unsigned int min_frame_duration_in_ns = 0, max_frame_duration_in_ns = 0; |
349 | unsigned int index = map_index_from_stream(core_freesync, stream); | 349 | unsigned int index = map_index_from_stream(core_freesync, stream); |
350 | uint32_t vtotal = stream->timing.v_total; | ||
350 | 351 | ||
351 | min_frame_duration_in_ns = ((unsigned int) (div64_u64( | 352 | min_frame_duration_in_ns = ((unsigned int) (div64_u64( |
352 | (1000000000ULL * 1000000), | 353 | (1000000000ULL * 1000000), |
@@ -362,6 +363,17 @@ static void calc_vmin_vmax(struct core_freesync *core_freesync, | |||
362 | *vmin = div64_u64(div64_u64(((unsigned long long)( | 363 | *vmin = div64_u64(div64_u64(((unsigned long long)( |
363 | min_frame_duration_in_ns) * stream->timing.pix_clk_khz), | 364 | min_frame_duration_in_ns) * stream->timing.pix_clk_khz), |
364 | stream->timing.h_total), 1000000); | 365 | stream->timing.h_total), 1000000); |
366 | |||
367 | /* In case of 4k free sync monitor, vmin or vmax cannot be less than vtotal */ | ||
368 | if (*vmin < vtotal) { | ||
369 | ASSERT(false); | ||
370 | *vmin = vtotal; | ||
371 | } | ||
372 | |||
373 | if (*vmax < vtotal) { | ||
374 | ASSERT(false); | ||
375 | *vmax = vtotal; | ||
376 | } | ||
365 | } | 377 | } |
366 | 378 | ||
367 | static void calc_v_total_from_duration(const struct dc_stream *stream, | 379 | static void calc_v_total_from_duration(const struct dc_stream *stream, |