diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-12-12 14:49:35 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2024-12-12 14:49:35 +0100 |
commit | 7b26bc6582b13a52a42a4a9765e8f30d58a81198 (patch) | |
tree | 80737d9bb4abf42b8e2061a5edacdfbe5ac9b7d6 /drivers/gpu/drm/amd/display/modules/freesync/freesync.c | |
parent | b2e538a9827dd04ab5273bf4be8eb2edb84357b0 (diff) | |
parent | 255cc582e6e16191a20d54bcdbca6c91d3e90c5e (diff) | |
download | linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.tar.gz linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.tar.bz2 linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.zip |
Merge tag 'asoc-fix-v6.12-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.13
A small pile of driver specific fixes, all quite small and not
particularly major.
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/freesync/freesync.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index f980a84dceef..2b3964529539 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c @@ -122,6 +122,17 @@ static unsigned int calc_duration_in_us_from_v_total( return duration_in_us; } +static unsigned int calc_max_hardware_v_total(const struct dc_stream_state *stream) +{ + unsigned int max_hw_v_total = stream->ctx->dc->caps.max_v_total; + + if (stream->ctx->dc->caps.vtotal_limited_by_fp2) { + max_hw_v_total -= stream->timing.v_front_porch + 1; + } + + return max_hw_v_total; +} + unsigned int mod_freesync_calc_v_total_from_refresh( const struct dc_stream_state *stream, unsigned int refresh_in_uhz) @@ -1016,7 +1027,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, if (stream->ctx->dc->caps.max_v_total != 0 && stream->timing.h_total != 0) { min_hardware_refresh_in_uhz = div64_u64((stream->timing.pix_clk_100hz * 100000000ULL), - (stream->timing.h_total * (long long)stream->ctx->dc->caps.max_v_total)); + (stream->timing.h_total * (long long)calc_max_hardware_v_total(stream))); } /* Limit minimum refresh rate to what can be supported by hardware */ min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ? |