summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/include
diff options
context:
space:
mode:
authorVictor Zhao <Victor.Zhao@amd.com>2025-12-18 18:42:04 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-07-28 18:52:30 -0400
commit6085f8289ef1f8ee1409992aa4e8fa7331192e58 (patch)
tree8cae2eba47c2cf9467611fa682ce1fdba0b2d94b /drivers/gpu/drm/amd/include
parent1c760249a5011b91ffb42fc23926a956a1936d71 (diff)
downloadlinux-next-6085f8289ef1f8ee1409992aa4e8fa7331192e58.tar.gz
linux-next-6085f8289ef1f8ee1409992aa4e8fa7331192e58.zip
drm/amdgpu: convert ptl_hw_supported to enum
Convert ptl_hw_supported to enum with three states: - AMDGPU_PTL_HW_UNINIT: not yet initialized - AMDGPU_PTL_HW_SUPPORTED: initialized and supported - AMDGPU_PTL_HW_NOT_SUPPORTED: initialized and not supported This allows skipping PTL initialization attempts when hardware is known to not support it, avoiding repeated initialization failures after GPU resets. v2:move ptl_hw_supported_state to AMDGPU_PTL_HW_NOT_SUPPORTED regardless of error code during first time initialization. Print init fail log when error code is not EOPNOTSUPP. Signed-off-by: Victor Zhao <Victor.Zhao@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@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.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/include/amdgpu_ptl.h b/drivers/gpu/drm/amd/include/amdgpu_ptl.h
index 154b8da3bfa9..eead62b4b327 100644
--- a/drivers/gpu/drm/amd/include/amdgpu_ptl.h
+++ b/drivers/gpu/drm/amd/include/amdgpu_ptl.h
@@ -39,11 +39,18 @@ enum amdgpu_ptl_disable_source {
AMDGPU_PTL_DISABLE_PROFILER,
AMDGPU_PTL_DISABLE_MAX,
};
+
+enum amdgpu_ptl_hw_supported_state {
+ AMDGPU_PTL_HW_UNINIT = 0, /* Not yet initialized */
+ AMDGPU_PTL_HW_SUPPORTED, /* Initialized and supported */
+ AMDGPU_PTL_HW_NOT_SUPPORTED, /* Initialized and not supported */
+};
+
struct amdgpu_ptl {
enum amdgpu_ptl_fmt fmt1;
enum amdgpu_ptl_fmt fmt2;
bool enabled;
- bool hw_supported;
+ enum amdgpu_ptl_hw_supported_state hw_supported_state;
bool permanently_disabled;
/* PTL disable reference counting */
atomic_t disable_ref;