amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: clean-up dead code in dml2_mall_phantom
@ 2025-08-19 20:42 Brahmajit Das
  2025-08-20 17:54 ` Deucher, Alexander
  0 siblings, 1 reply; 3+ messages in thread
From: Brahmajit Das @ 2025-08-19 20:42 UTC (permalink / raw)
  To: Christian König, Alex Deucher, Jun Lei, Qingqing Zhuo,
	Alex Deucher
  Cc: linux-kernel, amd-gfx, listout

pipe_idx in function dml2_svp_validate_static_schedulabilit, although
set is never actually used. While building with GCC 16 this gives a
warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_mall_phantom.c: In function ‘set_phantom_stream_timing’:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_mall_phantom.c:657:25: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=]
  657 |         unsigned int i, pipe_idx;
      |                         ^~~~~~~~

Signed-off-by: Brahmajit Das <listout@listout.xyz>
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
index a56e75cdf712..1d0af0f8ffa1 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
@@ -654,14 +654,13 @@ static void set_phantom_stream_timing(struct dml2_context *ctx, struct dc_state
 				     unsigned int svp_height,
 				     unsigned int svp_vstartup)
 {
-	unsigned int i, pipe_idx;
 	double line_time, fp_and_sync_width_time;
 	struct pipe_ctx *pipe;
 	uint32_t phantom_vactive, phantom_bp, pstate_width_fw_delay_lines;
 	static const double cvt_rb_vblank_max = ((double) 460 / (1000 * 1000));
 
 	// Find DML pipe index (pipe_idx) using dc_pipe_idx
-	for (i = 0, pipe_idx = 0; i < ctx->config.dcn_pipe_count; i++) {
+	for (unsigned int i = 0; i < ctx->config.dcn_pipe_count; i++) {
 		pipe = &state->res_ctx.pipe_ctx[i];
 
 		if (!pipe->stream)
@@ -669,8 +668,6 @@ static void set_phantom_stream_timing(struct dml2_context *ctx, struct dc_state
 
 		if (i == dc_pipe_idx)
 			break;
-
-		pipe_idx++;
 	}
 
 	// Calculate lines required for pstate allow width and FW processing delays
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amd/display: clean-up dead code in dml2_mall_phantom
  2025-08-19 20:42 [PATCH] drm/amd/display: clean-up dead code in dml2_mall_phantom Brahmajit Das
@ 2025-08-20 17:54 ` Deucher, Alexander
  2025-08-21 13:09   ` [PATCH v2] " Brahmajit Das
  0 siblings, 1 reply; 3+ messages in thread
From: Deucher, Alexander @ 2025-08-20 17:54 UTC (permalink / raw)
  To: Brahmajit Das, Koenig, Christian, Alex Deucher, Lei, Jun,
	Zhuo, Lillian
  Cc: linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org

[Public]

> -----Original Message-----
> From: Brahmajit Das <listout@listout.xyz>
> Sent: Tuesday, August 19, 2025 4:42 PM
> To: Koenig, Christian <Christian.Koenig@amd.com>; Alex Deucher
> <alexdeucher@gmail.com>; Lei, Jun <Jun.Lei@amd.com>; Zhuo, Lillian
> <Qingqing.Zhuo@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>
> Cc: linux-kernel@vger.kernel.org; amd-gfx@lists.freedesktop.org;
> listout@listout.xyz
> Subject: [PATCH] drm/amd/display: clean-up dead code in dml2_mall_phantom
>
> pipe_idx in function dml2_svp_validate_static_schedulabilit, although set is never
> actually used. While building with GCC 16 this gives a
> warning:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_mall_phantom.c: In function
> ‘set_phantom_stream_timing’:
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_mall_phantom.c:657:25:
> warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=]
>   657 |         unsigned int i, pipe_idx;
>       |                         ^~~~~~~~
>
> Signed-off-by: Brahmajit Das <listout@listout.xyz>
> ---
>  drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
> b/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
> index a56e75cdf712..1d0af0f8ffa1 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
> @@ -654,14 +654,13 @@ static void set_phantom_stream_timing(struct
> dml2_context *ctx, struct dc_state
>                                    unsigned int svp_height,
>                                    unsigned int svp_vstartup)
>  {
> -     unsigned int i, pipe_idx;
>       double line_time, fp_and_sync_width_time;
>       struct pipe_ctx *pipe;
>       uint32_t phantom_vactive, phantom_bp, pstate_width_fw_delay_lines;
>       static const double cvt_rb_vblank_max = ((double) 460 / (1000 * 1000));
>
>       // Find DML pipe index (pipe_idx) using dc_pipe_idx
> -     for (i = 0, pipe_idx = 0; i < ctx->config.dcn_pipe_count; i++) {
> +     for (unsigned int i = 0; i < ctx->config.dcn_pipe_count; i++) {

Better to leave this declaration above otherwise other compilers may complain about mixed code and declarations.

Alex

>               pipe = &state->res_ctx.pipe_ctx[i];
>
>               if (!pipe->stream)
> @@ -669,8 +668,6 @@ static void set_phantom_stream_timing(struct
> dml2_context *ctx, struct dc_state
>
>               if (i == dc_pipe_idx)
>                       break;
> -
> -             pipe_idx++;
>       }
>
>       // Calculate lines required for pstate allow width and FW processing delays
> --
> 2.51.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] drm/amd/display: clean-up dead code in dml2_mall_phantom
  2025-08-20 17:54 ` Deucher, Alexander
@ 2025-08-21 13:09   ` Brahmajit Das
  0 siblings, 0 replies; 3+ messages in thread
From: Brahmajit Das @ 2025-08-21 13:09 UTC (permalink / raw)
  To: alexander.deucher
  Cc: Christian.Koenig, Jun.Lei, Qingqing.Zhuo, alexdeucher, amd-gfx,
	linux-kernel, listout

pipe_idx in funtion dml2_svp_validate_static_schedulabilit, although set
is never actually used. While building with GCC 16 this gives a warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_mall_phantom.c: In function ‘set_phantom_stream_timing’:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_mall_phantom.c:657:25: warning: variable ‘pipe_idx’ set but not used [-Wunused-but-set-variable=]
  657 |         unsigned int i, pipe_idx;
      |                         ^~~~~~~~

Signed-off-by: Brahmajit Das <listout@listout.xyz>
---
v1 -> v2: leaving declaration above
---
 drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
index a56e75cdf712..c59f825cfae9 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_mall_phantom.c
@@ -654,14 +654,14 @@ static void set_phantom_stream_timing(struct dml2_context *ctx, struct dc_state
 				     unsigned int svp_height,
 				     unsigned int svp_vstartup)
 {
-	unsigned int i, pipe_idx;
+	unsigned int i;
 	double line_time, fp_and_sync_width_time;
 	struct pipe_ctx *pipe;
 	uint32_t phantom_vactive, phantom_bp, pstate_width_fw_delay_lines;
 	static const double cvt_rb_vblank_max = ((double) 460 / (1000 * 1000));
 
 	// Find DML pipe index (pipe_idx) using dc_pipe_idx
-	for (i = 0, pipe_idx = 0; i < ctx->config.dcn_pipe_count; i++) {
+	for (i = 0; i < ctx->config.dcn_pipe_count; i++) {
 		pipe = &state->res_ctx.pipe_ctx[i];
 
 		if (!pipe->stream)
@@ -669,8 +669,6 @@ static void set_phantom_stream_timing(struct dml2_context *ctx, struct dc_state
 
 		if (i == dc_pipe_idx)
 			break;
-
-		pipe_idx++;
 	}
 
 	// Calculate lines required for pstate allow width and FW processing delays
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-22 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 20:42 [PATCH] drm/amd/display: clean-up dead code in dml2_mall_phantom Brahmajit Das
2025-08-20 17:54 ` Deucher, Alexander
2025-08-21 13:09   ` [PATCH v2] " Brahmajit Das

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).