Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/smu13: fix profile reporting

The following 3 commits landed in parallel:
commit d7d2688bf4ea ("drm/amd/pm: update workload mask after the setting")
commit 7a1613e47e65 ("drm/amdgpu/smu13: always apply the powersave optimization")
commit 7c210ca5a2d7 ("drm/amdgpu: handle default profile on on devices without fullscreen 3D")
While everything is set correctly, this caused the profile to be
reported incorrectly because both the powersave and fullscreen3d bits
were set in the mask and when the driver prints the profile, it looks
for the first bit set.

Fixes: d7d2688bf4ea ("drm/amd/pm: update workload mask after the setting")
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+3 -3
+3 -3
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
··· 2473 2473 DpmActivityMonitorCoeffInt_t *activity_monitor = 2474 2474 &(activity_monitor_external.DpmActivityMonitorCoeffInt); 2475 2475 int workload_type, ret = 0; 2476 - u32 workload_mask; 2476 + u32 workload_mask, selected_workload_mask; 2477 2477 2478 2478 smu->power_profile_mode = input[size]; 2479 2479 ··· 2540 2540 if (workload_type < 0) 2541 2541 return -EINVAL; 2542 2542 2543 - workload_mask = 1 << workload_type; 2543 + selected_workload_mask = workload_mask = 1 << workload_type; 2544 2544 2545 2545 /* Add optimizations for SMU13.0.0/10. Reuse the power saving profile */ 2546 2546 if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0) && ··· 2560 2560 workload_mask, 2561 2561 NULL); 2562 2562 if (!ret) 2563 - smu->workload_mask = workload_mask; 2563 + smu->workload_mask = selected_workload_mask; 2564 2564 2565 2565 return ret; 2566 2566 }