]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/amd/display: Move 'struct scaler_data' off stack
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 May 2024 11:51:21 +0000 (13:51 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 May 2024 18:48:31 +0000 (14:48 -0400)
commitf8718c482572181ca364ffca3c27365cc83cfe9e
tree74e97eba419890ac2ba8c9c6817c3599fd098138
parent669d6b078ed8991266da4c68c46ce7d2e942c474
drm/amd/display: Move 'struct scaler_data' off stack

The scaler_data structure is implicitly copied onto the stack twice by
being returned from a function. This is usually a bad idea, but it
was not flagged by the compiler until a recent addition that pushed
it over the 1024 byte function stack limit:

drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_translation_helper.c: In function 'populate_dml_plane_cfg_from_plane_state':
drivers/gpu/drm/amd/amdgpu/../display/dc/dml2/dml2_translation_helper.c:1075:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Use an explicit kzalloc() and memcpy() instead here to keep it off the
stack.

Fixes: 00c391102abc ("drm/amd/display: Add misc DC changes for DCN401")
Fixes: 7966f319c66d ("drm/amd/display: Introduce DML2")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c