aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c73
1 files changed, 38 insertions, 35 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 1573202a641..5c1cc7ad9a1 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -387,15 +387,11 @@ static bool radeon_atom_apply_quirks(struct drm_device *dev,
387 *line_mux = 0x90; 387 *line_mux = 0x90;
388 } 388 }
389 389
390 /* mac rv630 */ 390 /* mac rv630, rv730, others */
391 if ((dev->pdev->device == 0x9588) && 391 if ((supported_device == ATOM_DEVICE_TV1_SUPPORT) &&
392 (dev->pdev->subsystem_vendor == 0x106b) && 392 (*connector_type == DRM_MODE_CONNECTOR_DVII)) {
393 (dev->pdev->subsystem_device == 0x00a6)) { 393 *connector_type = DRM_MODE_CONNECTOR_9PinDIN;
394 if ((supported_device == ATOM_DEVICE_TV1_SUPPORT) && 394 *line_mux = CONNECTOR_7PIN_DIN_ENUM_ID1;
395 (*connector_type == DRM_MODE_CONNECTOR_DVII)) {
396 *connector_type = DRM_MODE_CONNECTOR_9PinDIN;
397 *line_mux = CONNECTOR_7PIN_DIN_ENUM_ID1;
398 }
399 } 395 }
400 396
401 /* ASUS HD 3600 XT board lists the DVI port as HDMI */ 397 /* ASUS HD 3600 XT board lists the DVI port as HDMI */
@@ -1167,16 +1163,6 @@ bool radeon_atom_get_clock_info(struct drm_device *dev)
1167 p1pll->pll_out_min = 64800; 1163 p1pll->pll_out_min = 64800;
1168 else 1164 else
1169 p1pll->pll_out_min = 20000; 1165 p1pll->pll_out_min = 20000;
1170 } else if (p1pll->pll_out_min > 64800) {
1171 /* Limiting the pll output range is a good thing generally as
1172 * it limits the number of possible pll combinations for a given
1173 * frequency presumably to the ones that work best on each card.
1174 * However, certain duallink DVI monitors seem to like
1175 * pll combinations that would be limited by this at least on
1176 * pre-DCE 3.0 r6xx hardware. This might need to be adjusted per
1177 * family.
1178 */
1179 p1pll->pll_out_min = 64800;
1180 } 1166 }
1181 1167
1182 p1pll->pll_in_min = 1168 p1pll->pll_in_min =
@@ -1991,6 +1977,9 @@ static int radeon_atombios_parse_power_table_1_3(struct radeon_device *rdev)
1991 num_modes = power_info->info.ucNumOfPowerModeEntries; 1977 num_modes = power_info->info.ucNumOfPowerModeEntries;
1992 if (num_modes > ATOM_MAX_NUMBEROF_POWER_BLOCK) 1978 if (num_modes > ATOM_MAX_NUMBEROF_POWER_BLOCK)
1993 num_modes = ATOM_MAX_NUMBEROF_POWER_BLOCK; 1979 num_modes = ATOM_MAX_NUMBEROF_POWER_BLOCK;
1980 rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) * num_modes, GFP_KERNEL);
1981 if (!rdev->pm.power_state)
1982 return state_index;
1994 /* last mode is usually default, array is low to high */ 1983 /* last mode is usually default, array is low to high */
1995 for (i = 0; i < num_modes; i++) { 1984 for (i = 0; i < num_modes; i++) {
1996 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; 1985 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
@@ -2342,6 +2331,10 @@ static int radeon_atombios_parse_power_table_4_5(struct radeon_device *rdev)
2342 power_info = (union power_info *)(mode_info->atom_context->bios + data_offset); 2331 power_info = (union power_info *)(mode_info->atom_context->bios + data_offset);
2343 2332
2344 radeon_atombios_add_pplib_thermal_controller(rdev, &power_info->pplib.sThermalController); 2333 radeon_atombios_add_pplib_thermal_controller(rdev, &power_info->pplib.sThermalController);
2334 rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) *
2335 power_info->pplib.ucNumStates, GFP_KERNEL);
2336 if (!rdev->pm.power_state)
2337 return state_index;
2345 /* first mode is usually default, followed by low to high */ 2338 /* first mode is usually default, followed by low to high */
2346 for (i = 0; i < power_info->pplib.ucNumStates; i++) { 2339 for (i = 0; i < power_info->pplib.ucNumStates; i++) {
2347 mode_index = 0; 2340 mode_index = 0;
@@ -2422,6 +2415,10 @@ static int radeon_atombios_parse_power_table_6(struct radeon_device *rdev)
2422 non_clock_info_array = (struct NonClockInfoArray *) 2415 non_clock_info_array = (struct NonClockInfoArray *)
2423 (mode_info->atom_context->bios + data_offset + 2416 (mode_info->atom_context->bios + data_offset +
2424 power_info->pplib.usNonClockInfoArrayOffset); 2417 power_info->pplib.usNonClockInfoArrayOffset);
2418 rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state) *
2419 state_array->ucNumEntries, GFP_KERNEL);
2420 if (!rdev->pm.power_state)
2421 return state_index;
2425 for (i = 0; i < state_array->ucNumEntries; i++) { 2422 for (i = 0; i < state_array->ucNumEntries; i++) {
2426 mode_index = 0; 2423 mode_index = 0;
2427 power_state = (union pplib_power_state *)&state_array->states[i]; 2424 power_state = (union pplib_power_state *)&state_array->states[i];
@@ -2495,19 +2492,22 @@ void radeon_atombios_get_power_modes(struct radeon_device *rdev)
2495 break; 2492 break;
2496 } 2493 }
2497 } else { 2494 } else {
2498 /* add the default mode */ 2495 rdev->pm.power_state = kzalloc(sizeof(struct radeon_power_state), GFP_KERNEL);
2499 rdev->pm.power_state[state_index].type = 2496 if (rdev->pm.power_state) {
2500 POWER_STATE_TYPE_DEFAULT; 2497 /* add the default mode */
2501 rdev->pm.power_state[state_index].num_clock_modes = 1; 2498 rdev->pm.power_state[state_index].type =
2502 rdev->pm.power_state[state_index].clock_info[0].mclk = rdev->clock.default_mclk; 2499 POWER_STATE_TYPE_DEFAULT;
2503 rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk; 2500 rdev->pm.power_state[state_index].num_clock_modes = 1;
2504 rdev->pm.power_state[state_index].default_clock_mode = 2501 rdev->pm.power_state[state_index].clock_info[0].mclk = rdev->clock.default_mclk;
2505 &rdev->pm.power_state[state_index].clock_info[0]; 2502 rdev->pm.power_state[state_index].clock_info[0].sclk = rdev->clock.default_sclk;
2506 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE; 2503 rdev->pm.power_state[state_index].default_clock_mode =
2507 rdev->pm.power_state[state_index].pcie_lanes = 16; 2504 &rdev->pm.power_state[state_index].clock_info[0];
2508 rdev->pm.default_power_state_index = state_index; 2505 rdev->pm.power_state[state_index].clock_info[0].voltage.type = VOLTAGE_NONE;
2509 rdev->pm.power_state[state_index].flags = 0; 2506 rdev->pm.power_state[state_index].pcie_lanes = 16;
2510 state_index++; 2507 rdev->pm.default_power_state_index = state_index;
2508 rdev->pm.power_state[state_index].flags = 0;
2509 state_index++;
2510 }
2511 } 2511 }
2512 2512
2513 rdev->pm.num_power_states = state_index; 2513 rdev->pm.num_power_states = state_index;
@@ -2623,7 +2623,7 @@ void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev)
2623 bios_2_scratch &= ~ATOM_S2_VRI_BRIGHT_ENABLE; 2623 bios_2_scratch &= ~ATOM_S2_VRI_BRIGHT_ENABLE;
2624 2624
2625 /* tell the bios not to handle mode switching */ 2625 /* tell the bios not to handle mode switching */
2626 bios_6_scratch |= (ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH | ATOM_S6_ACC_MODE); 2626 bios_6_scratch |= ATOM_S6_ACC_BLOCK_DISPLAY_SWITCH;
2627 2627
2628 if (rdev->family >= CHIP_R600) { 2628 if (rdev->family >= CHIP_R600) {
2629 WREG32(R600_BIOS_2_SCRATCH, bios_2_scratch); 2629 WREG32(R600_BIOS_2_SCRATCH, bios_2_scratch);
@@ -2674,10 +2674,13 @@ void radeon_atom_output_lock(struct drm_encoder *encoder, bool lock)
2674 else 2674 else
2675 bios_6_scratch = RREG32(RADEON_BIOS_6_SCRATCH); 2675 bios_6_scratch = RREG32(RADEON_BIOS_6_SCRATCH);
2676 2676
2677 if (lock) 2677 if (lock) {
2678 bios_6_scratch |= ATOM_S6_CRITICAL_STATE; 2678 bios_6_scratch |= ATOM_S6_CRITICAL_STATE;
2679 else 2679 bios_6_scratch &= ~ATOM_S6_ACC_MODE;
2680 } else {
2680 bios_6_scratch &= ~ATOM_S6_CRITICAL_STATE; 2681 bios_6_scratch &= ~ATOM_S6_CRITICAL_STATE;
2682 bios_6_scratch |= ATOM_S6_ACC_MODE;
2683 }
2681 2684
2682 if (rdev->family >= CHIP_R600) 2685 if (rdev->family >= CHIP_R600)
2683 WREG32(R600_BIOS_6_SCRATCH, bios_6_scratch); 2686 WREG32(R600_BIOS_6_SCRATCH, bios_6_scratch);