Subversion Repositories Kolibri OS

Rev

Rev 1963 | Rev 2997 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1963 Rev 1986
Line 2318... Line 2318...
2318
			VOLTAGE_SW;
2318
			VOLTAGE_SW;
2319
		rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
2319
		rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage =
2320
			le16_to_cpu(clock_info->r600.usVDDC);
2320
			le16_to_cpu(clock_info->r600.usVDDC);
2321
	}
2321
	}
Line -... Line 2322...
-
 
2322
 
-
 
2323
	/* patch up vddc if necessary */
-
 
2324
	if (rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage == 0xff01) {
-
 
2325
		u16 vddc;
-
 
2326
 
-
 
2327
		if (radeon_atom_get_max_vddc(rdev, &vddc) == 0)
-
 
2328
			rdev->pm.power_state[state_index].clock_info[mode_index].voltage.voltage = vddc;
-
 
2329
	}
2322
 
2330
 
2323
	if (rdev->flags & RADEON_IS_IGP) {
2331
	if (rdev->flags & RADEON_IS_IGP) {
2324
		/* skip invalid modes */
2332
		/* skip invalid modes */
2325
		if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
2333
		if (rdev->pm.power_state[state_index].clock_info[mode_index].sclk == 0)
2326
			return false;
2334
			return false;
Line 2605... Line 2613...
2605
	u8 frev, crev, volt_index = voltage_level;
2613
	u8 frev, crev, volt_index = voltage_level;
Line 2606... Line 2614...
2606
 
2614
 
2607
	if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
2615
	if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
Line -... Line 2616...
-
 
2616
		return;
-
 
2617
 
-
 
2618
	/* 0xff01 is a flag rather then an actual voltage */
-
 
2619
	if (voltage_level == 0xff01)
2608
		return;
2620
		return;
2609
 
2621
 
2610
	switch (crev) {
2622
	switch (crev) {
2611
	case 1:
2623
	case 1:
2612
		args.v1.ucVoltageType = voltage_type;
2624
		args.v1.ucVoltageType = voltage_type;
Line 2624... Line 2636...
2624
	}
2636
	}
Line 2625... Line 2637...
2625
 
2637
 
2626
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
2638
	atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
Line -... Line 2639...
-
 
2639
}
-
 
2640
 
-
 
2641
int radeon_atom_get_max_vddc(struct radeon_device *rdev,
-
 
2642
			     u16 *voltage)
-
 
2643
{
-
 
2644
	union set_voltage args;
-
 
2645
	int index = GetIndexIntoMasterTable(COMMAND, SetVoltage);
-
 
2646
	u8 frev, crev;
-
 
2647
 
Line -... Line 2648...
-
 
2648
	if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
-
 
2649
		return -EINVAL;
-
 
2650
 
-
 
2651
	switch (crev) {
-
 
2652
	case 1:
-
 
2653
		return -EINVAL;
-
 
2654
	case 2:
-
 
2655
		args.v2.ucVoltageType = SET_VOLTAGE_GET_MAX_VOLTAGE;
-
 
2656
		args.v2.ucVoltageMode = 0;
-
 
2657
		args.v2.usVoltageLevel = 0;
-
 
2658
 
-
 
2659
		atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
-
 
2660
 
-
 
2661
		*voltage = le16_to_cpu(args.v2.usVoltageLevel);
-
 
2662
		break;
-
 
2663
	default:
-
 
2664
		DRM_ERROR("Unknown table version %d, %d\n", frev, crev);
-
 
2665
		return -EINVAL;
-
 
2666
	}
Line 2627... Line 2667...
2627
}
2667
 
2628
 
2668
	return 0;
2629
 
2669
}
2630
 
2670