From 9dc9821653564e892bf3be02018fe259939ac2cf Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 12 Aug 2010 19:14:12 -0400 Subject: [PATCH] drm/radeon/kms/pm: bail early if nothing's changing If we aren't changing the power state, no need to take locks and schedule fences, etc. The driver locking in general needs a review. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=29140 Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_pm.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index a3d25f4..9a8031b 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -226,6 +226,11 @@ static void radeon_pm_set_clocks(struct radeon_device *rdev) { int i; + /* no need to take locks, etc. if nothing's going to change */ + if ((rdev->pm.requested_clock_mode_index == rdev->pm.current_clock_mode_index) && + (rdev->pm.requested_power_state_index == rdev->pm.current_power_state_index)) + return; + mutex_lock(&rdev->ddev->struct_mutex); mutex_lock(&rdev->vram_mutex); mutex_lock(&rdev->cp.mutex); -- 1.7.1.1