[PATCH] drm/amd/display: Fix guarding of 'if (dc->debug.visual_confirm)'

SHANMUGAM, SRINIVASAN SRINIVASAN.SHANMUGAM at amd.com
Tue Jun 6 15:07:02 UTC 2023


[AMD Official Use Only - General]

-----Original Message-----
From: Mahfooz, Hamza <Hamza.Mahfooz at amd.com>
Sent: Tuesday, June 6, 2023 8:30 PM
To: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Pillai, Aurabindo <Aurabindo.Pillai at amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira at amd.com>; Wang, Chao-kai (Stylon) <Stylon.Wang at amd.com>; Lee, Alvin <Alvin.Lee2 at amd.com>; Lei, Jun <Jun.Lei at amd.com>
Cc: amd-gfx at lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Fix guarding of 'if (dc->debug.visual_confirm)'

On 6/6/23 08:35, Srinivasan Shanmugam wrote:
> Presumably the author intended to guard both the for loops with
> condition 'dc->res_pool->pipe_count' & 'surface_count' under 'if
> (dc->debug.visual_confirm)' so that's what I'm changing the code to.
> Hopefully to do the right thing.
>
> Fixes the below compilation error:
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3546:3: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
>                  for (i = 0; i < surface_count; i++) {
>                  ^
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:3538:2: note: previous statement is here
>          if (dc->debug.visual_confirm)
>          ^
>
> 'Fixes: 25e1a6115fc2e ("drm/amd/display: Refactor fast update to use
> new HWSS build sequence")'
> Cc: Stylon Wang <stylon.wang at amd.com>
> Cc: Alvin Lee <alvin.lee2 at amd.com>
> Cc: Jun Lei <jun.lei at amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>

NACK, only the for loop towards the top of patch should be contained within the if statement. The rest of the lines should have their indentation fixed, see commit d118b28aefcb ("drm/amd/display: Clean FPGA code in dc") for context.

Thanks a lot for your feedbacks, I had submitted v2: https://patchwork.freedesktop.org/patch/541312/

> ---
>   drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c
> b/drivers/gpu/drm/amd/display/dc/core/dc.c
> index 5e18fc0c79d6..abab9ae5e07c 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
> @@ -3534,7 +3534,7 @@ static void commit_planes_for_stream_fast(struct dc *dc,
>               }
>       }
>
> -     if (dc->debug.visual_confirm)
> +     if (dc->debug.visual_confirm) {
>               for (i = 0; i < dc->res_pool->pipe_count; i++) {
>                       struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
>
> @@ -3560,6 +3560,8 @@ static void commit_planes_for_stream_fast(struct dc *dc,
>                               }
>                       }
>               }
> +     }
> +
>       build_dmub_cmd_list(dc,
>                       srf_updates,
>                       surface_count,
--
Hamza



More information about the amd-gfx mailing list