[PATCH 03/13] drm/amd/display: Reduce stack size

Paul Menzel pmenzel at molgen.mpg.de
Sat Mar 19 06:52:21 UTC 2022


Dear Alex, dear Rodrigo,


Thank you for the patch.

Am 18.03.22 um 22:47 schrieb Alex Hung:
> From: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> 
> Linux kernel enabled more compilation restrictions related to the stack
> size,

Could you please reference the commit, where that was introduced.

> which caused compilation failures in our code.

Please give one example failure message.

> This commit reduces the allocation size by allocating the required
> memory dynamically.
Did you do measurements how much the stack size was reduced in the end? 
If so, it’d be great if you documented that in the commit message.

> Reviewed-by: Harry Wentland <Harry.Wentland at amd.com>
> Reviewed-by: Aric Cyr <Aric.Cyr at amd.com>
> Acked-by: Alex Hung <alex.hung at amd.com>
> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
> ---
>   drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> index c3e141c19a77..ad757b59e00e 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> @@ -2056,7 +2056,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size,
>   {
>   	struct dc_context *dc_ctx = dc->ctx;
>   	int i, master = -1, embedded = -1;
> -	struct dc_crtc_timing hw_crtc_timing[MAX_PIPES] = {0};
> +	struct dc_crtc_timing *hw_crtc_timing;
>   	uint64_t phase[MAX_PIPES];
>   	uint64_t modulo[MAX_PIPES];
>   	unsigned int pclk;
> @@ -2067,6 +2067,10 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size,
>   	uint32_t dp_ref_clk_100hz =
>   		dc->res_pool->dp_clock_source->ctx->dc->clk_mgr->dprefclk_khz*10;
>   
> +	hw_crtc_timing = kcalloc(MAX_PIPES, sizeof(*hw_crtc_timing), GFP_KERNEL);
> +	if (!hw_crtc_timing)
> +		return master;
> +
>   	if (dc->config.vblank_alignment_dto_params &&
>   		dc->res_pool->dp_clock_source->funcs->override_dp_pix_clk) {
>   		embedded_h_total =
> @@ -2130,6 +2134,8 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size,
>   		}
>   
>   	}
> +
> +	kfree(hw_crtc_timing);
>   	return master;
>   }
>   


Kind regards,

Paul


More information about the amd-gfx mailing list