summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2025-11-25 12:13:51 +0530
committerAlex Deucher <alexander.deucher@amd.com>2025-12-08 14:19:21 -0500
commit8c5c0ea2f9c01dad2f83f4c9a4a049004058ae38 (patch)
tree70434a2b36f57a9bbdb43972373f693745a11fc5 /drivers/gpu
parent448ee45353ef9fb1a34f5f26eb3f48923c6f0898 (diff)
drm/amd/pm: Add clock table structure
Add a common clock table structure to represent dpm levels for different clocks. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
index 8815fc70b63b..3d67d948eaff 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
+++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h
@@ -292,6 +292,28 @@ struct smu_clock_info {
uint32_t max_bus_bandwidth;
};
+#define SMU_MAX_DPM_LEVELS 16
+
+struct smu_dpm_clk_level {
+ bool enabled;
+ uint32_t value;
+};
+
+#define SMU_DPM_TABLE_FINE_GRAINED BIT(0)
+
+struct smu_dpm_table {
+ enum smu_clk_type clk_type;
+ uint32_t count;
+ uint32_t flags;
+ struct smu_dpm_clk_level dpm_levels[SMU_MAX_DPM_LEVELS];
+};
+
+#define SMU_DPM_TABLE_MIN(table) \
+ ((table)->count > 0 ? (table)->dpm_levels[0].value : 0)
+
+#define SMU_DPM_TABLE_MAX(table) \
+ ((table)->count > 0 ? (table)->dpm_levels[(table)->count - 1].value : 0)
+
struct smu_bios_boot_up_values {
uint32_t revision;
uint32_t gfxclk;