1. 05 Jun, 2024 37 commits
  2. 29 May, 2024 3 commits
    • Arnd Bergmann's avatar
      drm/amd/display: Move 'struct scaler_data' off stack · f8718c48
      Arnd Bergmann authored
      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: 00c39110 ("drm/amd/display: Add misc DC changes for DCN401")
      Fixes: 7966f319 ("drm/amd/display: Introduce DML2")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      f8718c48
    • Arnd Bergmann's avatar
      drm/amd/display: avoid large on-stack structures · 669d6b07
      Arnd Bergmann authored
      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: e779f458 ("drm/amd/display: Add handling for DC power mode")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      669d6b07
    • Arnd Bergmann's avatar
      drm/amd/display: fix graphics_object_id size · 6d438caa
      Arnd Bergmann authored
      The graphics_object_id structure is meant to fit into 32 bits, as it's
      passed by value in and out of functions. A recent change increased
      the size to 128 bits, so it's now always passed by reference, which
      is clearly not intended and ends up producing a compile-time warning:
      
      drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c: In function 'construct_phy':
      drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_factory.c:743:1: error: the frame size of 1040 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      
      Add back the bitfields to revert to the original size, while keeping
      the 'enum' type change.
      
      Fixes: fec85f99 ("drm/amd/display: Fix compiler redefinition warnings for certain configs")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      6d438caa