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

index a6906d4ca734f62b08e2e987f042ada0c8ade3d0..c3b2f9605f6d47c3e4bcbf79b307e6e282980c63 100644 (file)
@@ -1394,6 +1394,7 @@ static struct radeon_asic rv770_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 = &rv770_dpm_vblank_too_short,
        },
        .pflip = {
                .pre_page_flip = &rs600_pre_page_flip,
index 4456f85a932e4652ce91b26dc6ec4a484d7e2c5d..ca219e9fc2b4ff7c9d7ef948b8d7901574547351 100644 (file)
@@ -480,6 +480,7 @@ void rv770_dpm_debugfs_print_current_performance_level(struct radeon_device *rde
                                                       struct seq_file *m);
 int rv770_dpm_force_performance_level(struct radeon_device *rdev,
                                      enum radeon_dpm_forced_level level);
+bool rv770_dpm_vblank_too_short(struct radeon_device *rdev);
 
 /*
  * evergreen
index 4de50c8118799f7ec6aa796bd548ad00adc33b59..d914e04ea39a19e3f2013dafdac2fddd3ec18837 100644 (file)
@@ -2508,3 +2508,14 @@ u32 rv770_dpm_get_mclk(struct radeon_device *rdev, bool low)
        else
                return requested_state->high.mclk;
 }
+
+bool rv770_dpm_vblank_too_short(struct radeon_device *rdev)
+{
+       u32 vblank_time = r600_dpm_get_vblank_time(rdev);
+
+       if (vblank_time < 300)
+               return true;
+       else
+               return false;
+
+}