drm/amdgpu/gfx: add ring helpers for setting workload profile
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 8 Jan 2025 22:15:56 +0000 (17:15 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 13 Feb 2025 02:02:55 +0000 (21:02 -0500)
commit8fdb3958e3965fcd11408e1cd5380895cdc96e06
treea99761a32a34e687ff6dda3171f1fc3068546859
parent8544374c0f82edb285779f21b149826fe2c2977c
drm/amdgpu/gfx: add ring helpers for setting workload profile

Add helpers to switch the workload profile dynamically when
commands are submitted.  This allows us to switch to
the FULLSCREEN3D or COMPUTE profile when work is submitted.
Add a delayed work handler to delay switching out of the
selected profile if additional work comes in.  This works
the same as the VIDEO profile for VCN.  This lets dynamically
enable workload profiles on the fly and then move back
to the default when there is no work.

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h