diff options
| author | Perry Yuan <perry.yuan@amd.com> | 2026-02-09 00:42:09 +0800 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-05-11 15:55:56 -0400 |
| commit | 950688d2417085f30feb6ec48c85eeda53841ea2 (patch) | |
| tree | e7ceecd0e36872b6c0fc59ebc546a8eddeda6e45 /drivers/gpu/drm/amd/include | |
| parent | 022f071db5eb4434824e52790542e648c9bcd77d (diff) | |
drm/amdgpu: Track PTL disable requests by source
Use a bitmap to track PTL disable requests from sysfs and profiler.
PTL is only re-enabled once all sources have released their disable
requests, avoiding premature enablement.
Signed-off-by: Perry Yuan <perry.yuan@amd.com>
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/include')
| -rw-r--r-- | drivers/gpu/drm/amd/include/amdgpu_ptl.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/include/amdgpu_ptl.h b/drivers/gpu/drm/amd/include/amdgpu_ptl.h index 9e63a9a9680a..568b6944e1ad 100644 --- a/drivers/gpu/drm/amd/include/amdgpu_ptl.h +++ b/drivers/gpu/drm/amd/include/amdgpu_ptl.h @@ -34,6 +34,11 @@ enum amdgpu_ptl_fmt { AMDGPU_PTL_FMT_INVALID = 7, }; +enum amdgpu_ptl_disable_source { + AMDGPU_PTL_DISABLE_SYSFS = 0, + AMDGPU_PTL_DISABLE_PROFILER, + AMDGPU_PTL_DISABLE_MAX, +}; struct amdgpu_ptl { enum amdgpu_ptl_fmt fmt1; enum amdgpu_ptl_fmt fmt2; @@ -42,6 +47,7 @@ struct amdgpu_ptl { /* PTL disable reference counting */ atomic_t disable_ref; struct mutex mutex; + DECLARE_BITMAP(disable_bitmap, AMDGPU_PTL_DISABLE_MAX); }; int amdgpu_ptl_perf_monitor_ctrl(struct amdgpu_device *adev, u32 req_code, |
