]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
drm/amdgpu/dpm: add an implementation for get_vce_clock_state (v2)
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Oct 2016 16:38:04 +0000 (12:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 25 Oct 2016 18:38:41 +0000 (14:38 -0400)
Used by the non-powerplay dpm code.

v2: update to the new API

Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
drivers/gpu/drm/amd/amdgpu/kv_dpm.c
drivers/gpu/drm/amd/amdgpu/si_dpm.c

index 009ccb9615417437f84cb1d1f120a993d1c78e5a..6ca0333ca4c0f5398cfac5197c216164b39a49b2 100644 (file)
@@ -956,3 +956,12 @@ u8 amdgpu_encode_pci_lane_width(u32 lanes)
 
        return encoded_lanes[lanes];
 }
+
+struct amd_vce_state*
+amdgpu_get_vce_clock_state(struct amdgpu_device *adev, unsigned idx)
+{
+       if (idx < adev->pm.dpm.num_of_vce_states)
+               return &adev->pm.dpm.vce_states[idx];
+
+       return NULL;
+}
index fdcf9688e7aea6dd63ad84c74b6de9563b2c5672..4f25c030148eed5bc2847c20d6ca108fb749de24 100644 (file)
@@ -513,4 +513,7 @@ u16 amdgpu_get_pcie_lane_support(struct amdgpu_device *adev,
                                 u16 default_lanes);
 u8 amdgpu_encode_pci_lane_width(u32 lanes);
 
+struct amd_vce_state*
+amdgpu_get_vce_clock_state(struct amdgpu_device *adev, unsigned idx);
+
 #endif
index fa939df942f4fa1e93fb34305e84e95e1ff7ecc5..3f891076c07000d546e8acceca91ced12c917201 100644 (file)
@@ -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_state = amdgpu_get_vce_clock_state,
 };
 
 static void ci_dpm_set_dpm_funcs(struct amdgpu_device *adev)
index b23f643f6d0fa7fba6220a84d7ae9191cd79d7a7..c3367d6f311a322f7df4d12e5b2c445045f85cd8 100644 (file)
@@ -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_state = amdgpu_get_vce_clock_state,
 };
 
 static void kv_dpm_set_dpm_funcs(struct amdgpu_device *adev)
index dbfecc29f2a13016d8c05f57718add7c163e6ab0..38b4b9789584fab0d6792949b68ea067a6d1926c 100644 (file)
@@ -7991,6 +7991,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_state = amdgpu_get_vce_clock_state,
 };
 
 static void si_dpm_set_dpm_funcs(struct amdgpu_device *adev)