aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2009-10-06 13:04:29 -0400
committerDave Airlie <airlied@redhat.com>2009-10-07 19:40:04 -0400
commitb574f251f787c5b163da5ea345525569e51775bc (patch)
tree8adad6a3934898d8c71567729db0005e2189cd26 /drivers/gpu/drm/radeon/radeon_device.c
parent01ceae8edd7a0a6d8588dc103ad9f55e2c52cae9 (diff)
drm/radeon/kms: Fallback to non AGP when acceleration fails to initialize (v2)
When GPU acceleration is not working with AGP try to fallback to non AGP GART (either PCI or PCIE GART). This should make KMS failure on AGP less painfull. We still need to find out what is wrong when AGP fails but at least user have a lot of more chances to get a working configuration with acceleration. This patch also cleanup R600/RV770 fallback path so they use same code as others asics. Version 2 factorize agp disabling logic to avoid code duplication and bugs. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c51
1 files changed, 32 insertions, 19 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 2d07ccc03c43..a6b80eb236ee 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -476,6 +476,27 @@ void radeon_combios_fini(struct radeon_device *rdev)
476{ 476{
477} 477}
478 478
479void radeon_agp_disable(struct radeon_device *rdev)
480{
481 rdev->flags &= ~RADEON_IS_AGP;
482 if (rdev->family >= CHIP_R600) {
483 DRM_INFO("Forcing AGP to PCIE mode\n");
484 rdev->flags |= RADEON_IS_PCIE;
485 } else if (rdev->family >= CHIP_RV515 ||
486 rdev->family == CHIP_RV380 ||
487 rdev->family == CHIP_RV410 ||
488 rdev->family == CHIP_R423) {
489 DRM_INFO("Forcing AGP to PCIE mode\n");
490 rdev->flags |= RADEON_IS_PCIE;
491 rdev->asic->gart_tlb_flush = &rv370_pcie_gart_tlb_flush;
492 rdev->asic->gart_set_page = &rv370_pcie_gart_set_page;
493 } else {
494 DRM_INFO("Forcing AGP to PCI mode\n");
495 rdev->flags |= RADEON_IS_PCI;
496 rdev->asic->gart_tlb_flush = &r100_pci_gart_tlb_flush;
497 rdev->asic->gart_set_page = &r100_pci_gart_set_page;
498 }
499}
479 500
480/* 501/*
481 * Radeon device. 502 * Radeon device.
@@ -515,24 +536,7 @@ int radeon_device_init(struct radeon_device *rdev,
515 } 536 }
516 537
517 if (radeon_agpmode == -1) { 538 if (radeon_agpmode == -1) {
518 rdev->flags &= ~RADEON_IS_AGP; 539 radeon_agp_disable(rdev);
519 if (rdev->family >= CHIP_R600) {
520 DRM_INFO("Forcing AGP to PCIE mode\n");
521 rdev->flags |= RADEON_IS_PCIE;
522 } else if (rdev->family >= CHIP_RV515 ||
523 rdev->family == CHIP_RV380 ||
524 rdev->family == CHIP_RV410 ||
525 rdev->family == CHIP_R423) {
526 DRM_INFO("Forcing AGP to PCIE mode\n");
527 rdev->flags |= RADEON_IS_PCIE;
528 rdev->asic->gart_tlb_flush = &rv370_pcie_gart_tlb_flush;
529 rdev->asic->gart_set_page = &rv370_pcie_gart_set_page;
530 } else {
531 DRM_INFO("Forcing AGP to PCI mode\n");
532 rdev->flags |= RADEON_IS_PCI;
533 rdev->asic->gart_tlb_flush = &r100_pci_gart_tlb_flush;
534 rdev->asic->gart_set_page = &r100_pci_gart_set_page;
535 }
536 } 540 }
537 541
538 /* set DMA mask + need_dma32 flags. 542 /* set DMA mask + need_dma32 flags.
@@ -565,8 +569,17 @@ int radeon_device_init(struct radeon_device *rdev,
565 DRM_INFO("register mmio size: %u\n", (unsigned)rdev->rmmio_size); 569 DRM_INFO("register mmio size: %u\n", (unsigned)rdev->rmmio_size);
566 570
567 r = radeon_init(rdev); 571 r = radeon_init(rdev);
568 if (r) { 572 if (r)
569 return r; 573 return r;
574 if (rdev->flags & RADEON_IS_AGP && !rdev->accel_working) {
575 /* Acceleration not working on AGP card try again
576 * with fallback to PCI or PCIE GART
577 */
578 radeon_fini(rdev);
579 radeon_agp_disable(rdev);
580 r = radeon_init(rdev);
581 if (r)
582 return r;
570 } 583 }
571 if (radeon_testing) { 584 if (radeon_testing) {
572 radeon_test_moves(rdev); 585 radeon_test_moves(rdev);