diff mbox

drm/radeon/kms: add PM quirk for Asus Radeon HD 3200

Message ID 1267816969-30572-1-git-send-email-zajec5@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rafał Miłecki March 5, 2010, 7:22 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 6b65f15..a2ea0be 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -79,6 +79,23 @@  static void radeon_print_power_mode_info(struct radeon_device *rdev)
 	}
 }
 
+static void radeon_apply_pm_quirks(struct radeon_device *rdev)
+{
+	/* Asus Radeon HD 3200 contains power states with reversed types */
+	/* We received single report like this so far. See FDO bug #26347.
+	   In case of more reports we may consider some detecting algorithm */
+	if ((rdev->pdev->device == 0x9610) &&
+	    (rdev->pdev->subsystem_vendor == 0x1043) &&
+	    (rdev->pdev->subsystem_device == 0x82f1)) {
+		rdev->pm.power_state[0].type = POWER_STATE_TYPE_PERFORMANCE;
+		rdev->pm.power_state[1].type = POWER_STATE_TYPE_DEFAULT;
+		rdev->pm.default_power_state = &rdev->pm.power_state[1];
+		rdev->pm.current_power_state = rdev->pm.default_power_state;
+		rdev->pm.current_clock_mode =
+			rdev->pm.default_power_state->default_clock_mode;
+	}
+}
+
 static struct radeon_power_state * radeon_pick_power_state(struct radeon_device *rdev,
 							   enum radeon_pm_state_type type)
 {
@@ -235,6 +252,7 @@  int radeon_pm_init(struct radeon_device *rdev)
 			radeon_atombios_get_power_modes(rdev);
 		else
 			radeon_combios_get_power_modes(rdev);
+		radeon_apply_pm_quirks(rdev);
 		radeon_print_power_mode_info(rdev);
 	}