* [PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables
@ 2023-03-30 23:43 Tom Rix
0 siblings, 0 replies; 3+ messages in thread
From: Tom Rix @ 2023-03-30 23:43 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
christian.koenig, Xinhui.Pan, airlied, daniel, nathan,
ndesaulniers, HaoPing.Liu, aric.cyr, chiahsuan.chung,
felipe.clark, Angus.Wang, hanghong.ma, lv.ruyi, Dillon.Varone
Cc: amd-gfx, dri-devel, linux-kernel, llvm, Tom Rix
clang with W=1 reports
drivers/gpu/drm/amd/amdgpu/../display/modules/freesync/freesync.c:1132:15: error: variable
'average_render_time_in_us' set but not used [-Werror,-Wunused-but-set-variable]
unsigned int average_render_time_in_us = 0;
^
This variable is not used so remove it, which caused i to be unused so remove that as well.
Signed-off-by: Tom Rix <trix@redhat.com>
---
.../drm/amd/display/modules/freesync/freesync.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 315da61ee897..5c41a4751db4 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1129,7 +1129,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
{
struct core_freesync *core_freesync = NULL;
unsigned int last_render_time_in_us = 0;
- unsigned int average_render_time_in_us = 0;
if (mod_freesync == NULL)
return;
@@ -1138,7 +1137,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
if (in_out_vrr->supported &&
in_out_vrr->state == VRR_STATE_ACTIVE_VARIABLE) {
- unsigned int i = 0;
unsigned int oldest_index = plane->time.index + 1;
if (oldest_index >= DC_PLANE_UPDATE_TIMES_MAX)
@@ -1147,18 +1145,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
last_render_time_in_us = curr_time_stamp_in_us -
plane->time.prev_update_time_in_us;
- /* Sum off all entries except oldest one */
- for (i = 0; i < DC_PLANE_UPDATE_TIMES_MAX; i++) {
- average_render_time_in_us +=
- plane->time.time_elapsed_in_us[i];
- }
- average_render_time_in_us -=
- plane->time.time_elapsed_in_us[oldest_index];
-
- /* Add render time for current flip */
- average_render_time_in_us += last_render_time_in_us;
- average_render_time_in_us /= DC_PLANE_UPDATE_TIMES_MAX;
-
if (in_out_vrr->btr.btr_enabled) {
apply_below_the_range(core_freesync,
stream,
--
2.27.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables
2023-03-31 0:10 Tom Rix
@ 2023-03-31 15:01 ` Hamza Mahfooz
0 siblings, 0 replies; 3+ messages in thread
From: Hamza Mahfooz @ 2023-03-31 15:01 UTC (permalink / raw)
To: Tom Rix, harry.wentland, sunpeng.li, Rodrigo.Siqueira,
alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
nathan, ndesaulniers, aric.cyr, HaoPing.Liu, Anthony.Koo,
hanghong.ma, Angus.Wang, Dillon.Varone
Cc: llvm, dri-devel, amd-gfx, linux-kernel
On 3/30/23 20:10, Tom Rix wrote:
> clang with W=1 reports
> drivers/gpu/drm/amd/amdgpu/../display/modules/freesync/freesync.c:1132:15: error: variable
> 'average_render_time_in_us' set but not used [-Werror,-Wunused-but-set-variable]
> unsigned int average_render_time_in_us = 0;
> ^
> This variable is not used so remove it, which caused i to be unused so remove that as well.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
Applied, thanks!
> ---
> .../drm/amd/display/modules/freesync/freesync.c | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
> index 315da61ee897..5c41a4751db4 100644
> --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
> +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
> @@ -1129,7 +1129,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
> {
> struct core_freesync *core_freesync = NULL;
> unsigned int last_render_time_in_us = 0;
> - unsigned int average_render_time_in_us = 0;
>
> if (mod_freesync == NULL)
> return;
> @@ -1138,7 +1137,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
>
> if (in_out_vrr->supported &&
> in_out_vrr->state == VRR_STATE_ACTIVE_VARIABLE) {
> - unsigned int i = 0;
> unsigned int oldest_index = plane->time.index + 1;
>
> if (oldest_index >= DC_PLANE_UPDATE_TIMES_MAX)
> @@ -1147,18 +1145,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
> last_render_time_in_us = curr_time_stamp_in_us -
> plane->time.prev_update_time_in_us;
>
> - /* Sum off all entries except oldest one */
> - for (i = 0; i < DC_PLANE_UPDATE_TIMES_MAX; i++) {
> - average_render_time_in_us +=
> - plane->time.time_elapsed_in_us[i];
> - }
> - average_render_time_in_us -=
> - plane->time.time_elapsed_in_us[oldest_index];
> -
> - /* Add render time for current flip */
> - average_render_time_in_us += last_render_time_in_us;
> - average_render_time_in_us /= DC_PLANE_UPDATE_TIMES_MAX;
> -
> if (in_out_vrr->btr.btr_enabled) {
> apply_below_the_range(core_freesync,
> stream,
--
Hamza
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables
@ 2023-03-31 0:10 Tom Rix
2023-03-31 15:01 ` Hamza Mahfooz
0 siblings, 1 reply; 3+ messages in thread
From: Tom Rix @ 2023-03-31 0:10 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher,
christian.koenig, Xinhui.Pan, airlied, daniel, nathan,
ndesaulniers, aric.cyr, HaoPing.Liu, Anthony.Koo, hanghong.ma,
Angus.Wang, Dillon.Varone
Cc: amd-gfx, dri-devel, linux-kernel, llvm, Tom Rix
clang with W=1 reports
drivers/gpu/drm/amd/amdgpu/../display/modules/freesync/freesync.c:1132:15: error: variable
'average_render_time_in_us' set but not used [-Werror,-Wunused-but-set-variable]
unsigned int average_render_time_in_us = 0;
^
This variable is not used so remove it, which caused i to be unused so remove that as well.
Signed-off-by: Tom Rix <trix@redhat.com>
---
.../drm/amd/display/modules/freesync/freesync.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 315da61ee897..5c41a4751db4 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1129,7 +1129,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
{
struct core_freesync *core_freesync = NULL;
unsigned int last_render_time_in_us = 0;
- unsigned int average_render_time_in_us = 0;
if (mod_freesync == NULL)
return;
@@ -1138,7 +1137,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
if (in_out_vrr->supported &&
in_out_vrr->state == VRR_STATE_ACTIVE_VARIABLE) {
- unsigned int i = 0;
unsigned int oldest_index = plane->time.index + 1;
if (oldest_index >= DC_PLANE_UPDATE_TIMES_MAX)
@@ -1147,18 +1145,6 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
last_render_time_in_us = curr_time_stamp_in_us -
plane->time.prev_update_time_in_us;
- /* Sum off all entries except oldest one */
- for (i = 0; i < DC_PLANE_UPDATE_TIMES_MAX; i++) {
- average_render_time_in_us +=
- plane->time.time_elapsed_in_us[i];
- }
- average_render_time_in_us -=
- plane->time.time_elapsed_in_us[oldest_index];
-
- /* Add render time for current flip */
- average_render_time_in_us += last_render_time_in_us;
- average_render_time_in_us /= DC_PLANE_UPDATE_TIMES_MAX;
-
if (in_out_vrr->btr.btr_enabled) {
apply_below_the_range(core_freesync,
stream,
--
2.27.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-31 15:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 23:43 [PATCH] drm/amd/display: remove unused average_render_time_in_us and i variables Tom Rix
2023-03-31 0:10 Tom Rix
2023-03-31 15:01 ` Hamza Mahfooz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®