[PATCH 14/40] drm/amd/display/dc/calcs/dce_calcs: Remove some large variables from the stack

Lee Jones lee.jones at linaro.org
Tue Jan 12 13:43:27 UTC 2021


On Mon, 11 Jan 2021, Lee Jones wrote:

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c: In function ‘bw_calcs_init’:
>  drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:2726:1: warning: the frame size of 1336 bytes is larger than 1024 bytes [-Wframe-larger-than=]
> 
> Cc: Harry Wentland <harry.wentland at amd.com>
> Cc: Leo Li <sunpeng.li at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: "Christian König" <christian.koenig at amd.com>
> Cc: David Airlie <airlied at linux.ie>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: amd-gfx at lists.freedesktop.org
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Lee Jones <lee.jones at linaro.org>
> ---
>  .../gpu/drm/amd/display/dc/calcs/dce_calcs.c  | 1115 +++++++++--------
>  1 file changed, 560 insertions(+), 555 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> index a0c69fae40ced..f69c2b84d432b 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
> @@ -2035,707 +2035,712 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
>  	struct bw_calcs_vbios *bw_vbios,
>  	struct hw_asic_id asic_id)
>  {
> -	struct bw_calcs_dceip dceip = { 0 };
> -	struct bw_calcs_vbios vbios = { 0 };
> +	struct bw_calcs_dceip *dceip;
> +	struct bw_calcs_vbios *vbios;
>  
>  	enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id);
>  
> -	dceip.version = version;
> +	dceip = kzalloc(sizeof(dceip), GFP_KERNEL);
> +	vbios = kzalloc(sizeof(vbios), GFP_KERNEL);

Please don't review/merge this yet.  I missed some error checking.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog


More information about the amd-gfx mailing list