drm/radeon/dpm: implement vblank_too_short callback for si
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2013 16:15:11 +0000 (12:15 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2013 21:41:11 +0000 (17:41 -0400)
Check if we can switch the mclk during the vblank time otherwise
we may get artifacts on the screen when the mclk changes.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/ni_dpm.h
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/si_dpm.c

index ac1c7abf2c6750e509c87d42fdd7146480d760f0..6bbee9180909e790df17772ea10f8f6a0f8ae6e0 100644 (file)
@@ -245,4 +245,6 @@ void ni_set_uvd_clock_after_set_eng_clock(struct radeon_device *rdev,
                                          struct radeon_ps *new_ps,
                                          struct radeon_ps *old_ps);
 
+bool ni_dpm_vblank_too_short(struct radeon_device *rdev);
+
 #endif
index c62428be9bed0890a9fffb2fa0458c0049cf8644..097077499cc643751211a989449468a93dc1fa36 100644 (file)
@@ -2294,6 +2294,7 @@ static struct radeon_asic si_asic = {
                .print_power_state = &ni_dpm_print_power_state,
                .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
                .force_performance_level = &si_dpm_force_performance_level,
+               .vblank_too_short = &ni_dpm_vblank_too_short,
        },
        .pflip = {
                .pre_page_flip = &evergreen_pre_page_flip,
index 700a167be369886d89c1c04db1c2e9c78a2bc9dd..73aaa2e4c31272b6f4a28341f05e700e0c7bf42c 100644 (file)
@@ -2906,7 +2906,8 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
        u16 vddc, vddci;
        int i;
 
-       if (rdev->pm.dpm.new_active_crtc_count > 1)
+       if ((rdev->pm.dpm.new_active_crtc_count > 1) ||
+           ni_dpm_vblank_too_short(rdev))
                disable_mclk_switching = true;
        else
                disable_mclk_switching = false;