[PATCH 4/6] drm/amdgpu/dpm: add an implementation for get_vce_clock_table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Used by the non-powerplay dpm code.

Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 16 ++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h |  3 +++
 drivers/gpu/drm/amd/amdgpu/ci_dpm.c     |  1 +
 drivers/gpu/drm/amd/amdgpu/kv_dpm.c     |  1 +
 drivers/gpu/drm/amd/amdgpu/si_dpm.c     |  1 +
 5 files changed, 22 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
index fe36caf..a0ffd9b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
@@ -953,3 +953,19 @@ u8 amdgpu_encode_pci_lane_width(u32 lanes)
 
 	return encoded_lanes[lanes];
 }
+
+struct drm_amdgpu_info_vce_clock_table
+amdgpu_get_vce_clock_table(struct amdgpu_device *adev)
+{
+	struct drm_amdgpu_info_vce_clock_table vce_clk_table = {};
+	unsigned i;
+
+	/* fill in the vce power states */
+	for (i = 0; i < AMDGPU_VCE_CLOCK_TABLE_ENTRIES; i++) {
+		vce_clk_table.entries[i].sclk = adev->pm.dpm.vce_states[i].sclk;
+		vce_clk_table.entries[i].mclk = adev->pm.dpm.vce_states[i].mclk;
+		vce_clk_table.entries[i].eclk = adev->pm.dpm.vce_states[i].evclk;
+	}
+
+	return vce_clk_table;
+}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
index b0c800d..933e58e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
@@ -534,4 +534,7 @@ u16 amdgpu_get_pcie_lane_support(struct amdgpu_device *adev,
 				 u16 default_lanes);
 u8 amdgpu_encode_pci_lane_width(u32 lanes);
 
+struct drm_amdgpu_info_vce_clock_table
+amdgpu_get_vce_clock_table(struct amdgpu_device *adev);
+
 #endif
diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
index 1d8c375..b5030d3 100644
--- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c
@@ -6644,6 +6644,7 @@ static const struct amdgpu_dpm_funcs ci_dpm_funcs = {
 	.set_sclk_od = ci_dpm_set_sclk_od,
 	.get_mclk_od = ci_dpm_get_mclk_od,
 	.set_mclk_od = ci_dpm_set_mclk_od,
+	.get_vce_clock_table = amdgpu_get_vce_clock_table,
 };
 
 static void ci_dpm_set_dpm_funcs(struct amdgpu_device *adev)
diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
index f8618a3..c4e869d 100644
--- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
@@ -3273,6 +3273,7 @@ static const struct amdgpu_dpm_funcs kv_dpm_funcs = {
 	.force_performance_level = &kv_dpm_force_performance_level,
 	.powergate_uvd = &kv_dpm_powergate_uvd,
 	.enable_bapm = &kv_dpm_enable_bapm,
+	.get_vce_clock_table = amdgpu_get_vce_clock_table,
 };
 
 static void kv_dpm_set_dpm_funcs(struct amdgpu_device *adev)
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
index 8bd0892..e683980 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
@@ -7985,6 +7985,7 @@ static const struct amdgpu_dpm_funcs si_dpm_funcs = {
 	.get_fan_control_mode = &si_dpm_get_fan_control_mode,
 	.set_fan_speed_percent = &si_dpm_set_fan_speed_percent,
 	.get_fan_speed_percent = &si_dpm_get_fan_speed_percent,
+	.get_vce_clock_table = amdgpu_get_vce_clock_table,
 };
 
 static void si_dpm_set_dpm_funcs(struct amdgpu_device *adev)
-- 
2.5.5



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux