diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r600_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_hdmi.c | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index 06e273e36b12..834ca023b23d 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -421,40 +421,6 @@ void r600_hdmi_update_audio_settings(struct drm_encoder *encoder) | |||
421 | r600_hdmi_audio_workaround(encoder); | 421 | r600_hdmi_audio_workaround(encoder); |
422 | } | 422 | } |
423 | 423 | ||
424 | static int r600_hdmi_find_free_block(struct drm_device *dev) | ||
425 | { | ||
426 | struct radeon_device *rdev = dev->dev_private; | ||
427 | struct drm_encoder *encoder; | ||
428 | struct radeon_encoder *radeon_encoder; | ||
429 | bool free_blocks[3] = { true, true, true }; | ||
430 | |||
431 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | ||
432 | radeon_encoder = to_radeon_encoder(encoder); | ||
433 | switch (radeon_encoder->hdmi_offset) { | ||
434 | case R600_HDMI_BLOCK1: | ||
435 | free_blocks[0] = false; | ||
436 | break; | ||
437 | case R600_HDMI_BLOCK2: | ||
438 | free_blocks[1] = false; | ||
439 | break; | ||
440 | case R600_HDMI_BLOCK3: | ||
441 | free_blocks[2] = false; | ||
442 | break; | ||
443 | } | ||
444 | } | ||
445 | |||
446 | if (rdev->family == CHIP_RS600 || rdev->family == CHIP_RS690 || | ||
447 | rdev->family == CHIP_RS740) { | ||
448 | return free_blocks[0] ? R600_HDMI_BLOCK1 : 0; | ||
449 | } else if (rdev->family >= CHIP_R600) { | ||
450 | if (free_blocks[0]) | ||
451 | return R600_HDMI_BLOCK1; | ||
452 | else if (free_blocks[1]) | ||
453 | return R600_HDMI_BLOCK2; | ||
454 | } | ||
455 | return 0; | ||
456 | } | ||
457 | |||
458 | static void r600_hdmi_assign_block(struct drm_encoder *encoder) | 424 | static void r600_hdmi_assign_block(struct drm_encoder *encoder) |
459 | { | 425 | { |
460 | struct drm_device *dev = encoder->dev; | 426 | struct drm_device *dev = encoder->dev; |
@@ -488,9 +454,14 @@ static void r600_hdmi_assign_block(struct drm_encoder *encoder) | |||
488 | } else if (ASIC_IS_DCE3(rdev)) { | 454 | } else if (ASIC_IS_DCE3(rdev)) { |
489 | radeon_encoder->hdmi_offset = dig->dig_encoder ? | 455 | radeon_encoder->hdmi_offset = dig->dig_encoder ? |
490 | R600_HDMI_BLOCK3 : R600_HDMI_BLOCK1; | 456 | R600_HDMI_BLOCK3 : R600_HDMI_BLOCK1; |
491 | } else if (rdev->family >= CHIP_R600 || rdev->family == CHIP_RS600 || | 457 | } else if (rdev->family >= CHIP_R600) { |
492 | rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) { | 458 | /* 2 routable blocks, but using dig_encoder should be fine */ |
493 | radeon_encoder->hdmi_offset = r600_hdmi_find_free_block(dev); | 459 | radeon_encoder->hdmi_offset = dig->dig_encoder ? |
460 | R600_HDMI_BLOCK2 : R600_HDMI_BLOCK1; | ||
461 | } else if (rdev->family == CHIP_RS600 || rdev->family == CHIP_RS690 || | ||
462 | rdev->family == CHIP_RS740) { | ||
463 | /* Only 1 routable block */ | ||
464 | radeon_encoder->hdmi_offset = R600_HDMI_BLOCK1; | ||
494 | } | 465 | } |
495 | } | 466 | } |
496 | 467 | ||