summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/pm/inc
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2022-01-07 17:57:33 -0500
committerAlex Deucher <alexander.deucher@amd.com>2022-01-27 15:50:08 -0500
commit8cda7a4f96e435be2fd074009d69521d973d7d31 (patch)
tree6660912b8a60aa25565ff4e183a0140edf258c23 /drivers/gpu/drm/amd/pm/inc
parente281d5940ae7f2ceff99d5e001a69b5f0884d2f0 (diff)
downloadlinux-8cda7a4f96e435be2fd074009d69521d973d7d31.tar.bz2
drm/amdgpu/UAPI: add new CTX OP to get/set stable pstates
Add a new CTX ioctl operation to set stable pstates for profiling. When creating traces for tools like RGP or using SPM or doing performance profiling, it's required to enable a special stable profiling power state on the GPU. These profiling states set fixed clocks and disable certain other power features like powergating which may impact the results. Historically, these profiling pstates were enabled via sysfs, but this adds an interface to enable it via the CTX ioctl from the application. Since the power state is global only one application can set it at a time, so if multiple applications try and use it only the first will get it, the ioctl will return -EBUSY for others. The sysfs interface will override whatever has been set by this interface. Mesa MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/207 v2: don't default r = 0; v3: rebase on Evan's PM cleanup Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/inc')
-rw-r--r--drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h b/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
index 2766b88ecf96..5cc05110cdae 100644
--- a/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
+++ b/drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
@@ -338,6 +338,9 @@ struct amdgpu_pm {
uint32_t smu_debug_mask;
bool pp_force_state_enabled;
+
+ struct mutex stable_pstate_ctx_lock;
+ struct amdgpu_ctx *stable_pstate_ctx;
};
u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev);