diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2020-06-02 21:08:39 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-01 07:59:16 +0200 |
commit | eb0b5d6fdb0b000fac3446b6ad7ac744e9114cab (patch) | |
tree | 7ccf956b0b998b7c6fc8d1432622d766799005b2 /drivers/gpu/drm/radeon | |
parent | drm/amd/display: Only actually breakpoint if DEBUG_KERNEL_DC is enabled (diff) | |
download | linux-eb0b5d6fdb0b000fac3446b6ad7ac744e9114cab.tar.xz linux-eb0b5d6fdb0b000fac3446b6ad7ac744e9114cab.zip |
Revert "drm/[radeon|amdgpu]: Replace one-element array and use struct_size() helper"
This reverts commit 4541ea81edde6ce9a1d9be082489aca7e8e7e1dc.
This changes structs used by the hardware and breaks dpm on some cards.
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/si_dpm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index bab01ca864c6..a167e1c36d24 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c @@ -5253,9 +5253,10 @@ static int si_upload_sw_state(struct radeon_device *rdev, int ret; u32 address = si_pi->state_table_start + offsetof(SISLANDS_SMC_STATETABLE, driverState); + u32 state_size = sizeof(SISLANDS_SMC_SWSTATE) + + ((new_state->performance_level_count - 1) * + sizeof(SISLANDS_SMC_HW_PERFORMANCE_LEVEL)); SISLANDS_SMC_SWSTATE *smc_state = &si_pi->smc_statetable.driverState; - size_t state_size = struct_size(smc_state, levels, - new_state->performance_level_count); memset(smc_state, 0, state_size); |