From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Alex Deucher <alexander.deucher@amd.com>,
Anthony Koo <Anthony.Koo@amd.com>
Subject: [PATCH AUTOSEL 5.5 037/121] drm/amd/display: Only round InfoFrame refresh rates
Date: Sat, 11 Apr 2020 19:05:42 -0400 [thread overview]
Message-ID: <20200411230706.23855-37-sashal@kernel.org> (raw)
In-Reply-To: <20200411230706.23855-1-sashal@kernel.org>
From: Aric Cyr <aric.cyr@amd.com>
[ Upstream commit 3fc6376ed6f2f67bc9fb0c7a3cf07967d6aa6216 ]
[Why]
When calculating nominal refresh rates, don't round.
Only the VSIF needs to be rounded.
[How]
Revert rounding change for nominal and just round when forming the
FreeSync VSIF.
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index d9ea4ae690af6..592ad78f731fd 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -524,12 +524,12 @@ static void build_vrr_infopacket_data(const struct mod_vrr_params *vrr,
infopacket->sb[6] |= 0x04;
/* PB7 = FreeSync Minimum refresh rate (Hz) */
- infopacket->sb[7] = (unsigned char)(vrr->min_refresh_in_uhz / 1000000);
+ infopacket->sb[7] = (unsigned char)((vrr->min_refresh_in_uhz + 500000) / 1000000);
/* PB8 = FreeSync Maximum refresh rate (Hz)
* Note: We should never go above the field rate of the mode timing set.
*/
- infopacket->sb[8] = (unsigned char)(vrr->max_refresh_in_uhz / 1000000);
+ infopacket->sb[8] = (unsigned char)((vrr->max_refresh_in_uhz + 500000) / 1000000);
//FreeSync HDR
@@ -747,10 +747,6 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync,
nominal_field_rate_in_uhz =
mod_freesync_calc_nominal_field_rate(stream);
- /* Rounded to the nearest Hz */
- nominal_field_rate_in_uhz = 1000000ULL *
- div_u64(nominal_field_rate_in_uhz + 500000, 1000000);
-
min_refresh_in_uhz = in_config->min_refresh_in_uhz;
max_refresh_in_uhz = in_config->max_refresh_in_uhz;
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-04-11 23:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200411230706.23855-1-sashal@kernel.org>
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 013/121] drm/amd/display: Explicitly disable triplebuffer flips Sasha Levin
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 026/121] drm/tegra: dc: Release PM and RGB output when client's registration fails Sasha Levin
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 028/121] drm/amd/display: Stop if retimer is not available Sasha Levin
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 030/121] drm/amd/display: writing stereo polarity register if swapped Sasha Levin
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 033/121] drm/amd/display: Fix default logger mask definition Sasha Levin
2020-04-11 23:05 ` Sasha Levin [this message]
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 039/121] drm/panel: simple: fix osd070t1718_19ts sync drive edge Sasha Levin
2020-04-11 23:05 ` [PATCH AUTOSEL 5.5 048/121] drm/sun4i: dsi: Use NULL to signify "no panel" Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 056/121] drm/omap: fix possible object reference leak Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 059/121] drm/stm: ltdc: check crtc state before enabling LIE Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 060/121] fbdev: potential information leak in do_fb_ioctl() Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 061/121] drm/crc: Actually allow to change the crc source Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 062/121] drm/amdgpu: fix parentheses in amdgpu_vm_update_ptes Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 063/121] drm/amd/display: dc_get_vmid_use_vector() crashes when get called Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 069/121] drm/amd/display: dal_ddc_i2c_payloads_create can fail causing panic Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 070/121] drm/amd/display: System crashes when add_ptb_to_table() gets called Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 071/121] drm/omap: dss: Cleanup DSS ports on initialisation failure Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 084/121] drm/msm: fix leaks if initialization fails Sasha Levin
2020-04-11 23:06 ` [PATCH AUTOSEL 5.5 085/121] drm/msm/a5xx: Always set an OPP supported hardware value Sasha Levin
2020-04-11 23:07 ` [PATCH AUTOSEL 5.5 121/121] PCI: Use ioremap(), not phys_to_virt() for platform ROM Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200411230706.23855-37-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Anthony.Koo@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).