Commit dc4a9049 authored by Mario Kleiner's avatar Mario Kleiner Committed by Alex Deucher

drm/amd/display: Fix and simplify apply_below_the_range()

The comparison of inserted_frame_duration_in_us against a
duration calculated from max_refresh_in_uhz is both wrong
in its math and not needed, as the min_duration_in_us value
is already cached in in_out_vrr for reuse. No need to
recalculate it wrongly at each invocation.
Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7267a1a9
...@@ -437,10 +437,8 @@ static void apply_below_the_range(struct core_freesync *core_freesync, ...@@ -437,10 +437,8 @@ static void apply_below_the_range(struct core_freesync *core_freesync,
inserted_frame_duration_in_us = last_render_time_in_us / inserted_frame_duration_in_us = last_render_time_in_us /
frames_to_insert; frames_to_insert;
if (inserted_frame_duration_in_us < if (inserted_frame_duration_in_us < in_out_vrr->min_duration_in_us)
(1000000 / in_out_vrr->max_refresh_in_uhz)) inserted_frame_duration_in_us = in_out_vrr->min_duration_in_us;
inserted_frame_duration_in_us =
(1000000 / in_out_vrr->max_refresh_in_uhz);
/* Cache the calculated variables */ /* Cache the calculated variables */
in_out_vrr->btr.inserted_duration_in_us = in_out_vrr->btr.inserted_duration_in_us =
......
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