diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-04-27 02:09:30 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 14:44:19 -0400 |
commit | 51d45cbc9196b07f3fc66df5dafd3010c04913a3 (patch) | |
tree | 65956997c14bbc83c1ae10297a4cb73c8c5d699b /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
parent | fc5a136ddad944d2f909d3ffcde924b7afa792f4 (diff) |
drm/amdgpu: Fix display corruption on CI with dpm enabled
with dpm enabled, need to get active crtcs in dc/no-dc mode.
caused by
'commit ebb649667a31 ("drm/amdgpu: Set pm_display_cfg in non-dc mode")'
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 2c821262e262..b455da487782 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -1878,26 +1878,26 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev) | |||
1878 | amdgpu_fence_wait_empty(ring); | 1878 | amdgpu_fence_wait_empty(ring); |
1879 | } | 1879 | } |
1880 | 1880 | ||
1881 | if (!amdgpu_device_has_dc_support(adev)) { | ||
1882 | mutex_lock(&adev->pm.mutex); | ||
1883 | amdgpu_dpm_get_active_displays(adev); | ||
1884 | adev->pm.pm_display_cfg.num_display = adev->pm.dpm.new_active_crtcs; | ||
1885 | adev->pm.pm_display_cfg.vrefresh = amdgpu_dpm_get_vrefresh(adev); | ||
1886 | adev->pm.pm_display_cfg.min_vblank_time = amdgpu_dpm_get_vblank_time(adev); | ||
1887 | /* we have issues with mclk switching with refresh rates over 120 hz on the non-DC code. */ | ||
1888 | if (adev->pm.pm_display_cfg.vrefresh > 120) | ||
1889 | adev->pm.pm_display_cfg.min_vblank_time = 0; | ||
1890 | if (adev->powerplay.pp_funcs->display_configuration_change) | ||
1891 | adev->powerplay.pp_funcs->display_configuration_change( | ||
1892 | adev->powerplay.pp_handle, | ||
1893 | &adev->pm.pm_display_cfg); | ||
1894 | mutex_unlock(&adev->pm.mutex); | ||
1895 | } | ||
1896 | |||
1897 | if (adev->powerplay.pp_funcs->dispatch_tasks) { | 1881 | if (adev->powerplay.pp_funcs->dispatch_tasks) { |
1882 | if (!amdgpu_device_has_dc_support(adev)) { | ||
1883 | mutex_lock(&adev->pm.mutex); | ||
1884 | amdgpu_dpm_get_active_displays(adev); | ||
1885 | adev->pm.pm_display_cfg.num_display = adev->pm.dpm.new_active_crtcs; | ||
1886 | adev->pm.pm_display_cfg.vrefresh = amdgpu_dpm_get_vrefresh(adev); | ||
1887 | adev->pm.pm_display_cfg.min_vblank_time = amdgpu_dpm_get_vblank_time(adev); | ||
1888 | /* we have issues with mclk switching with refresh rates over 120 hz on the non-DC code. */ | ||
1889 | if (adev->pm.pm_display_cfg.vrefresh > 120) | ||
1890 | adev->pm.pm_display_cfg.min_vblank_time = 0; | ||
1891 | if (adev->powerplay.pp_funcs->display_configuration_change) | ||
1892 | adev->powerplay.pp_funcs->display_configuration_change( | ||
1893 | adev->powerplay.pp_handle, | ||
1894 | &adev->pm.pm_display_cfg); | ||
1895 | mutex_unlock(&adev->pm.mutex); | ||
1896 | } | ||
1898 | amdgpu_dpm_dispatch_task(adev, AMD_PP_TASK_DISPLAY_CONFIG_CHANGE, NULL); | 1897 | amdgpu_dpm_dispatch_task(adev, AMD_PP_TASK_DISPLAY_CONFIG_CHANGE, NULL); |
1899 | } else { | 1898 | } else { |
1900 | mutex_lock(&adev->pm.mutex); | 1899 | mutex_lock(&adev->pm.mutex); |
1900 | amdgpu_dpm_get_active_displays(adev); | ||
1901 | /* update battery/ac status */ | 1901 | /* update battery/ac status */ |
1902 | if (power_supply_is_system_supplied() > 0) | 1902 | if (power_supply_is_system_supplied() > 0) |
1903 | adev->pm.dpm.ac_power = true; | 1903 | adev->pm.dpm.ac_power = true; |