drm/radeon/dpm: implement vblank_too_short callback for evergreen
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2013 15:56:09 +0000 (11:56 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Jul 2013 21:40:42 +0000 (17:40 -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/cypress_dpm.c
drivers/gpu/drm/radeon/radeon_asic.c
drivers/gpu/drm/radeon/radeon_asic.h

index 9ef840807dd1e0ff73233ab3618a1d72b8de72fc..9bcdd174780f2a8ec618cf255ad2c37690a2237f 100644 (file)
@@ -2174,3 +2174,16 @@ void cypress_dpm_fini(struct radeon_device *rdev)
        kfree(rdev->pm.dpm.ps);
        kfree(rdev->pm.dpm.priv);
 }
+
+bool cypress_dpm_vblank_too_short(struct radeon_device *rdev)
+{
+       struct rv7xx_power_info *pi = rv770_get_pi(rdev);
+       u32 vblank_time = r600_dpm_get_vblank_time(rdev);
+       u32 switch_limit = pi->mem_gddr5 ? 450 : 300;
+
+       if (vblank_time < switch_limit)
+               return true;
+       else
+               return false;
+
+}
index c3b2f9605f6d47c3e4bcbf79b307e6e282980c63..e73026393a46cc1a05c3ff7f36f36cf045b1c782 100644 (file)
@@ -1519,6 +1519,7 @@ static struct radeon_asic evergreen_asic = {
                .print_power_state = &rv770_dpm_print_power_state,
                .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
                .force_performance_level = &rv770_dpm_force_performance_level,
+               .vblank_too_short = &cypress_dpm_vblank_too_short,
        },
        .pflip = {
                .pre_page_flip = &evergreen_pre_page_flip,
index ca219e9fc2b4ff7c9d7ef948b8d7901574547351..0ef8b4967b9c8ee98a3178f19feec5aabad8b792 100644 (file)
@@ -545,6 +545,7 @@ void cypress_dpm_disable(struct radeon_device *rdev);
 int cypress_dpm_set_power_state(struct radeon_device *rdev);
 void cypress_dpm_display_configuration_changed(struct radeon_device *rdev);
 void cypress_dpm_fini(struct radeon_device *rdev);
+bool cypress_dpm_vblank_too_short(struct radeon_device *rdev);
 int btc_dpm_init(struct radeon_device *rdev);
 void btc_dpm_setup_asic(struct radeon_device *rdev);
 int btc_dpm_enable(struct radeon_device *rdev);