Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a377e187 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie
Browse files

drm/radeon/kms/r6xx+: voltage fixes



0xff01 is not an actual voltage value, but a flag
for the driver.  If the power state as that value,
skip setting the voltage.

Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 4ee1c57f
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -140,11 +140,17 @@ void evergreen_pm_misc(struct radeon_device *rdev)
	struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
	struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;


	if (voltage->type == VOLTAGE_SW) {
	if (voltage->type == VOLTAGE_SW) {
		/* 0xff01 is a flag rather then an actual voltage */
		if (voltage->voltage == 0xff01)
			return;
		if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) {
		if (voltage->voltage && (voltage->voltage != rdev->pm.current_vddc)) {
			radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
			radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
			rdev->pm.current_vddc = voltage->voltage;
			rdev->pm.current_vddc = voltage->voltage;
			DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage);
			DRM_DEBUG("Setting: vddc: %d\n", voltage->voltage);
		}
		}
		/* 0xff01 is a flag rather then an actual voltage */
		if (voltage->vddci == 0xff01)
			return;
		if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) {
		if (voltage->vddci && (voltage->vddci != rdev->pm.current_vddci)) {
			radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI);
			radeon_atom_set_voltage(rdev, voltage->vddci, SET_VOLTAGE_TYPE_ASIC_VDDCI);
			rdev->pm.current_vddci = voltage->vddci;
			rdev->pm.current_vddci = voltage->vddci;
+3 −0
Original line number Original line Diff line number Diff line
@@ -590,6 +590,9 @@ void r600_pm_misc(struct radeon_device *rdev)
	struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
	struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;


	if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
	if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
		/* 0xff01 is a flag rather then an actual voltage */
		if (voltage->voltage == 0xff01)
			return;
		if (voltage->voltage != rdev->pm.current_vddc) {
		if (voltage->voltage != rdev->pm.current_vddc) {
			radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
			radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
			rdev->pm.current_vddc = voltage->voltage;
			rdev->pm.current_vddc = voltage->voltage;
+4 −0
Original line number Original line Diff line number Diff line
@@ -2607,6 +2607,10 @@ void radeon_atom_set_voltage(struct radeon_device *rdev, u16 voltage_level, u8 v
	if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
	if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
		return;
		return;


	/* 0xff01 is a flag rather then an actual voltage */
	if (voltage_level == 0xff01)
		return;

	switch (crev) {
	switch (crev) {
	case 1:
	case 1:
		args.v1.ucVoltageType = voltage_type;
		args.v1.ucVoltageType = voltage_type;
+3 −0
Original line number Original line Diff line number Diff line
@@ -105,6 +105,9 @@ void rv770_pm_misc(struct radeon_device *rdev)
	struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;
	struct radeon_voltage *voltage = &ps->clock_info[req_cm_idx].voltage;


	if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
	if ((voltage->type == VOLTAGE_SW) && voltage->voltage) {
		/* 0xff01 is a flag rather then an actual voltage */
		if (voltage->voltage == 0xff01)
			return;
		if (voltage->voltage != rdev->pm.current_vddc) {
		if (voltage->voltage != rdev->pm.current_vddc) {
			radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
			radeon_atom_set_voltage(rdev, voltage->voltage, SET_VOLTAGE_TYPE_ASIC_VDDC);
			rdev->pm.current_vddc = voltage->voltage;
			rdev->pm.current_vddc = voltage->voltage;