[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1ab1210048a4b485247cccba6721f1885c986331.1685342739.git.christophe.jaillet@wanadoo.fr>
Date: Mon, 29 May 2023 09:18:55 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Harry Wentland <harry.wentland@....com>,
Leo Li <sunpeng.li@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org
Subject: [PATCH 2/3] drm/amd/display: Simplify get_dmif_switch_time_us()
Thanks to the sanity check a few lines above:
if (!h_total || !v_total || !pix_clk_khz)
and the computation done afterwards on these non 0 values, we know that
'pixels_per_second', 'pixels_per_frame' and 'refresh_rate' are not 0
The code can be simplified accordingly.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
NOT compile tested. Because of some BROKEN in KConfig files.
---
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
index 091f0d68a045..eafe8561e55e 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c
@@ -690,21 +690,8 @@ static uint32_t get_dmif_switch_time_us(
pixels_per_second = pix_clk_khz * 1000;
pixels_per_frame = h_total * v_total;
- if (!pixels_per_second || !pixels_per_frame) {
- /* avoid division by zero */
- ASSERT(pixels_per_frame);
- ASSERT(pixels_per_second);
- return single_frame_time_multiplier * min_single_frame_time_us;
- }
-
refresh_rate = pixels_per_second / pixels_per_frame;
- if (!refresh_rate) {
- /* avoid division by zero*/
- ASSERT(refresh_rate);
- return single_frame_time_multiplier * min_single_frame_time_us;
- }
-
frame_time = us_in_sec / refresh_rate;
if (frame_time < min_single_frame_time_us)
--
2.34.1
Powered by blists - more mailing lists