drm/amd/display: avoid large on-stack structures
authorArnd Bergmann <arnd@arndb.de>
Tue, 28 May 2024 11:51:20 +0000 (13:51 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 May 2024 18:48:31 +0000 (14:48 -0400)
commit669d6b078ed8991266da4c68c46ce7d2e942c474
treee0e9741678eb51f40be2b9543f9f48fa3d2adca1
parent6d438caaeaa1a7fae7b523e7bc4cee262b9f101a
drm/amd/display: avoid large on-stack structures

Putting excessively large objects on a function stack causes
a warning about possibly overflowing the 8KiB of kernel stack:

drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c: In function 'dcn401_update_bw_bounding_box':
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn401/dcn401_resource.c:1599:1: error: the frame size of 1196 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
 1599 | }
      | ^
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_state.c: In function 'dc_state_create':
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_state.c:221:1: error: the frame size of 1196 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
  221 | }
      | ^

Use dynamic allocation instead.

Fixes: e779f4587f61 ("drm/amd/display: Add handling for DC power mode")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_state.c
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c