aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-05-29 19:14:03 -0400
committerDave Airlie <airlied@redhat.com>2013-05-29 19:14:03 -0400
commite9a0a3adc2cd753d18c6a56e7d8210ab58819f32 (patch)
treeb26034a6a42ea58d952f87e83e51c5e55d653d1c
parentc89b65e7fffef745bdd36c372aa0dea778fecbab (diff)
parent7e0e41963740525af702bb23edede8ae9afc4ac0 (diff)
Merge branch 'drm-fixes-3.10' of git://people.freedesktop.org/~agd5f/linux into drm-next
just a few minor fixes for radeon. * 'drm-fixes-3.10' of git://people.freedesktop.org/~agd5f/linux: radeon: use max_bus_speed to activate gen2 speeds drm/radeon: narrow scope of Apple re-POST hack drm/radeon: don't check crtcs in card_posted() on cards without DCE drm/radeon: fix card_posted check for newer asics drm/radeon: fix typo in cu_per_sh on verde drm/radeon: UVD block on SUMO2 is the same as on SUMO
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c10
-rw-r--r--drivers/gpu/drm/radeon/r600.c9
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c27
-rw-r--r--drivers/gpu/drm/radeon/rv770.c13
-rw-r--r--drivers/gpu/drm/radeon/si.c2
5 files changed, 25 insertions, 36 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 8f9e2d31b255..8546e3b333b4 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -4999,8 +4999,7 @@ void evergreen_fini(struct radeon_device *rdev)
4999 4999
5000void evergreen_pcie_gen2_enable(struct radeon_device *rdev) 5000void evergreen_pcie_gen2_enable(struct radeon_device *rdev)
5001{ 5001{
5002 u32 link_width_cntl, speed_cntl, mask; 5002 u32 link_width_cntl, speed_cntl;
5003 int ret;
5004 5003
5005 if (radeon_pcie_gen2 == 0) 5004 if (radeon_pcie_gen2 == 0)
5006 return; 5005 return;
@@ -5015,11 +5014,8 @@ void evergreen_pcie_gen2_enable(struct radeon_device *rdev)
5015 if (ASIC_IS_X2(rdev)) 5014 if (ASIC_IS_X2(rdev))
5016 return; 5015 return;
5017 5016
5018 ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask); 5017 if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) &&
5019 if (ret != 0) 5018 (rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT))
5020 return;
5021
5022 if (!(mask & DRM_PCIE_SPEED_50))
5023 return; 5019 return;
5024 5020
5025 speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); 5021 speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 1a08008c978b..b45e64848677 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -4631,8 +4631,6 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
4631{ 4631{
4632 u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp; 4632 u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp;
4633 u16 link_cntl2; 4633 u16 link_cntl2;
4634 u32 mask;
4635 int ret;
4636 4634
4637 if (radeon_pcie_gen2 == 0) 4635 if (radeon_pcie_gen2 == 0)
4638 return; 4636 return;
@@ -4651,11 +4649,8 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
4651 if (rdev->family <= CHIP_R600) 4649 if (rdev->family <= CHIP_R600)
4652 return; 4650 return;
4653 4651
4654 ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask); 4652 if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) &&
4655 if (ret != 0) 4653 (rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT))
4656 return;
4657
4658 if (!(mask & DRM_PCIE_SPEED_50))
4659 return; 4654 return;
4660 4655
4661 speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); 4656 speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL);
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index c2c59fb1ea01..189973836cff 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -467,23 +467,27 @@ bool radeon_card_posted(struct radeon_device *rdev)
467{ 467{
468 uint32_t reg; 468 uint32_t reg;
469 469
470 /* required for EFI mode on macbook2,1 which uses an r5xx asic */
470 if (efi_enabled(EFI_BOOT) && 471 if (efi_enabled(EFI_BOOT) &&
471 rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) 472 (rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) &&
473 (rdev->family < CHIP_R600))
472 return false; 474 return false;
473 475
476 if (ASIC_IS_NODCE(rdev))
477 goto check_memsize;
478
474 /* first check CRTCs */ 479 /* first check CRTCs */
475 if (ASIC_IS_DCE41(rdev)) { 480 if (ASIC_IS_DCE4(rdev)) {
476 reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) | 481 reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |
477 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET); 482 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET);
478 if (reg & EVERGREEN_CRTC_MASTER_EN) 483 if (rdev->num_crtc >= 4) {
479 return true; 484 reg |= RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) |
480 } else if (ASIC_IS_DCE4(rdev)) { 485 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET);
481 reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) | 486 }
482 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET) | 487 if (rdev->num_crtc >= 6) {
483 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) | 488 reg |= RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) |
484 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET) | 489 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
485 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) | 490 }
486 RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
487 if (reg & EVERGREEN_CRTC_MASTER_EN) 491 if (reg & EVERGREEN_CRTC_MASTER_EN)
488 return true; 492 return true;
489 } else if (ASIC_IS_AVIVO(rdev)) { 493 } else if (ASIC_IS_AVIVO(rdev)) {
@@ -500,6 +504,7 @@ bool radeon_card_posted(struct radeon_device *rdev)
500 } 504 }
501 } 505 }
502 506
507check_memsize:
503 /* then check MEM_SIZE, in case the crtcs are off */ 508 /* then check MEM_SIZE, in case the crtcs are off */
504 if (rdev->family >= CHIP_R600) 509 if (rdev->family >= CHIP_R600)
505 reg = RREG32(R600_CONFIG_MEMSIZE); 510 reg = RREG32(R600_CONFIG_MEMSIZE);
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 83f612a9500b..08aef24afe40 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -862,10 +862,8 @@ int rv770_uvd_resume(struct radeon_device *rdev)
862 chip_id = 0x0100000b; 862 chip_id = 0x0100000b;
863 break; 863 break;
864 case CHIP_SUMO: 864 case CHIP_SUMO:
865 chip_id = 0x0100000c;
866 break;
867 case CHIP_SUMO2: 865 case CHIP_SUMO2:
868 chip_id = 0x0100000d; 866 chip_id = 0x0100000c;
869 break; 867 break;
870 case CHIP_PALM: 868 case CHIP_PALM:
871 chip_id = 0x0100000e; 869 chip_id = 0x0100000e;
@@ -2113,8 +2111,6 @@ static void rv770_pcie_gen2_enable(struct radeon_device *rdev)
2113{ 2111{
2114 u32 link_width_cntl, lanes, speed_cntl, tmp; 2112 u32 link_width_cntl, lanes, speed_cntl, tmp;
2115 u16 link_cntl2; 2113 u16 link_cntl2;
2116 u32 mask;
2117 int ret;
2118 2114
2119 if (radeon_pcie_gen2 == 0) 2115 if (radeon_pcie_gen2 == 0)
2120 return; 2116 return;
@@ -2129,11 +2125,8 @@ static void rv770_pcie_gen2_enable(struct radeon_device *rdev)
2129 if (ASIC_IS_X2(rdev)) 2125 if (ASIC_IS_X2(rdev))
2130 return; 2126 return;
2131 2127
2132 ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask); 2128 if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) &&
2133 if (ret != 0) 2129 (rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT))
2134 return;
2135
2136 if (!(mask & DRM_PCIE_SPEED_50))
2137 return; 2130 return;
2138 2131
2139 DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n"); 2132 DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n");
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 5ffade69af25..d1ba9d88f311 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2616,7 +2616,7 @@ static void si_gpu_init(struct radeon_device *rdev)
2616 default: 2616 default:
2617 rdev->config.si.max_shader_engines = 1; 2617 rdev->config.si.max_shader_engines = 1;
2618 rdev->config.si.max_tile_pipes = 4; 2618 rdev->config.si.max_tile_pipes = 4;
2619 rdev->config.si.max_cu_per_sh = 2; 2619 rdev->config.si.max_cu_per_sh = 5;
2620 rdev->config.si.max_sh_per_se = 2; 2620 rdev->config.si.max_sh_per_se = 2;
2621 rdev->config.si.max_backends_per_se = 4; 2621 rdev->config.si.max_backends_per_se = 4;
2622 rdev->config.si.max_texture_channel_caches = 4; 2622 rdev->config.si.max_texture_channel_caches = 4;