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 | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index be6a6c63b4cc..4887c888bbe7 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c | |||
@@ -613,7 +613,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, | |||
613 | { | 613 | { |
614 | struct core_freesync *core_freesync = NULL; | 614 | struct core_freesync *core_freesync = NULL; |
615 | unsigned long long nominal_field_rate_in_uhz = 0; | 615 | unsigned long long nominal_field_rate_in_uhz = 0; |
616 | bool nominal_field_rate_in_range = true; | ||
617 | unsigned int refresh_range = 0; | 616 | unsigned int refresh_range = 0; |
618 | unsigned int min_refresh_in_uhz = 0; | 617 | unsigned int min_refresh_in_uhz = 0; |
619 | unsigned int max_refresh_in_uhz = 0; | 618 | unsigned int max_refresh_in_uhz = 0; |
@@ -638,15 +637,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, | |||
638 | if (max_refresh_in_uhz > nominal_field_rate_in_uhz) | 637 | if (max_refresh_in_uhz > nominal_field_rate_in_uhz) |
639 | max_refresh_in_uhz = nominal_field_rate_in_uhz; | 638 | max_refresh_in_uhz = nominal_field_rate_in_uhz; |
640 | 639 | ||
641 | /* Allow for some rounding error of actual video timing by taking ceil. | ||
642 | * For example, 144 Hz mode timing may actually be 143.xxx Hz when | ||
643 | * calculated from pixel rate and vertical/horizontal totals, but | ||
644 | * this should be allowed instead of blocking FreeSync. | ||
645 | */ | ||
646 | if ((min_refresh_in_uhz / 1000000) > | ||
647 | ((nominal_field_rate_in_uhz + 1000000 - 1) / 1000000)) | ||
648 | nominal_field_rate_in_range = false; | ||
649 | |||
650 | // Full range may be larger than current video timing, so cap at nominal | 640 | // Full range may be larger than current video timing, so cap at nominal |
651 | if (min_refresh_in_uhz > nominal_field_rate_in_uhz) | 641 | if (min_refresh_in_uhz > nominal_field_rate_in_uhz) |
652 | min_refresh_in_uhz = nominal_field_rate_in_uhz; | 642 | min_refresh_in_uhz = nominal_field_rate_in_uhz; |
@@ -658,10 +648,14 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, | |||
658 | 648 | ||
659 | in_out_vrr->state = in_config->state; | 649 | in_out_vrr->state = in_config->state; |
660 | 650 | ||
661 | if ((in_config->state == VRR_STATE_UNSUPPORTED) || | 651 | if (in_config->state == VRR_STATE_UNSUPPORTED) { |
662 | (!nominal_field_rate_in_range)) { | ||
663 | in_out_vrr->state = VRR_STATE_UNSUPPORTED; | 652 | in_out_vrr->state = VRR_STATE_UNSUPPORTED; |
664 | in_out_vrr->supported = false; | 653 | in_out_vrr->supported = false; |
654 | in_out_vrr->adjust.v_total_min = stream->timing.v_total; | ||
655 | in_out_vrr->adjust.v_total_max = stream->timing.v_total; | ||
656 | |||
657 | return; | ||
658 | |||
665 | } else { | 659 | } else { |
666 | in_out_vrr->min_refresh_in_uhz = min_refresh_in_uhz; | 660 | in_out_vrr->min_refresh_in_uhz = min_refresh_in_uhz; |
667 | in_out_vrr->max_duration_in_us = | 661 | in_out_vrr->max_duration_in_us = |