aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/si.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/si.c')
-rw-r--r--drivers/gpu/drm/radeon/si.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index d325280e2f9f..daa8d2df8ec5 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -1663,9 +1663,13 @@ static int si_init_microcode(struct radeon_device *rdev)
1663 1663
1664 snprintf(fw_name, sizeof(fw_name), "radeon/%s_smc.bin", chip_name); 1664 snprintf(fw_name, sizeof(fw_name), "radeon/%s_smc.bin", chip_name);
1665 err = request_firmware(&rdev->smc_fw, fw_name, rdev->dev); 1665 err = request_firmware(&rdev->smc_fw, fw_name, rdev->dev);
1666 if (err) 1666 if (err) {
1667 goto out; 1667 printk(KERN_ERR
1668 if (rdev->smc_fw->size != smc_req_size) { 1668 "smc: error loading firmware \"%s\"\n",
1669 fw_name);
1670 release_firmware(rdev->smc_fw);
1671 rdev->smc_fw = NULL;
1672 } else if (rdev->smc_fw->size != smc_req_size) {
1669 printk(KERN_ERR 1673 printk(KERN_ERR
1670 "si_smc: Bogus length %zu in firmware \"%s\"\n", 1674 "si_smc: Bogus length %zu in firmware \"%s\"\n",
1671 rdev->smc_fw->size, fw_name); 1675 rdev->smc_fw->size, fw_name);
@@ -5215,14 +5219,12 @@ static void si_enable_mc_ls(struct radeon_device *rdev,
5215 5219
5216static void si_init_cg(struct radeon_device *rdev) 5220static void si_init_cg(struct radeon_device *rdev)
5217{ 5221{
5218 bool has_uvd = true;
5219
5220 si_enable_mgcg(rdev, true); 5222 si_enable_mgcg(rdev, true);
5221 si_enable_cgcg(rdev, true); 5223 si_enable_cgcg(rdev, false);
5222 /* disable MC LS on Tahiti */ 5224 /* disable MC LS on Tahiti */
5223 if (rdev->family == CHIP_TAHITI) 5225 if (rdev->family == CHIP_TAHITI)
5224 si_enable_mc_ls(rdev, false); 5226 si_enable_mc_ls(rdev, false);
5225 if (has_uvd) { 5227 if (rdev->has_uvd) {
5226 si_enable_uvd_mgcg(rdev, true); 5228 si_enable_uvd_mgcg(rdev, true);
5227 si_init_uvd_internal_cg(rdev); 5229 si_init_uvd_internal_cg(rdev);
5228 } 5230 }
@@ -5230,9 +5232,7 @@ static void si_init_cg(struct radeon_device *rdev)
5230 5232
5231static void si_fini_cg(struct radeon_device *rdev) 5233static void si_fini_cg(struct radeon_device *rdev)
5232{ 5234{
5233 bool has_uvd = true; 5235 if (rdev->has_uvd)
5234
5235 if (has_uvd)
5236 si_enable_uvd_mgcg(rdev, false); 5236 si_enable_uvd_mgcg(rdev, false);
5237 si_enable_cgcg(rdev, false); 5237 si_enable_cgcg(rdev, false);
5238 si_enable_mgcg(rdev, false); 5238 si_enable_mgcg(rdev, false);
@@ -5241,11 +5241,11 @@ static void si_fini_cg(struct radeon_device *rdev)
5241static void si_init_pg(struct radeon_device *rdev) 5241static void si_init_pg(struct radeon_device *rdev)
5242{ 5242{
5243 bool has_pg = false; 5243 bool has_pg = false;
5244 5244#if 0
5245 /* only cape verde supports PG */ 5245 /* only cape verde supports PG */
5246 if (rdev->family == CHIP_VERDE) 5246 if (rdev->family == CHIP_VERDE)
5247 has_pg = true; 5247 has_pg = true;
5248 5248#endif
5249 if (has_pg) { 5249 if (has_pg) {
5250 si_init_ao_cu_mask(rdev); 5250 si_init_ao_cu_mask(rdev);
5251 si_init_dma_pg(rdev); 5251 si_init_dma_pg(rdev);
@@ -6422,6 +6422,8 @@ static int si_startup(struct radeon_device *rdev)
6422 /* enable aspm */ 6422 /* enable aspm */
6423 si_program_aspm(rdev); 6423 si_program_aspm(rdev);
6424 6424
6425 si_mc_program(rdev);
6426
6425 if (!rdev->me_fw || !rdev->pfp_fw || !rdev->ce_fw || 6427 if (!rdev->me_fw || !rdev->pfp_fw || !rdev->ce_fw ||
6426 !rdev->rlc_fw || !rdev->mc_fw) { 6428 !rdev->rlc_fw || !rdev->mc_fw) {
6427 r = si_init_microcode(rdev); 6429 r = si_init_microcode(rdev);
@@ -6441,7 +6443,6 @@ static int si_startup(struct radeon_device *rdev)
6441 if (r) 6443 if (r)
6442 return r; 6444 return r;
6443 6445
6444 si_mc_program(rdev);
6445 r = si_pcie_gart_enable(rdev); 6446 r = si_pcie_gart_enable(rdev);
6446 if (r) 6447 if (r)
6447 return r; 6448 return r;
@@ -6625,7 +6626,7 @@ int si_suspend(struct radeon_device *rdev)
6625 si_cp_enable(rdev, false); 6626 si_cp_enable(rdev, false);
6626 cayman_dma_stop(rdev); 6627 cayman_dma_stop(rdev);
6627 if (rdev->has_uvd) { 6628 if (rdev->has_uvd) {
6628 r600_uvd_rbc_stop(rdev); 6629 r600_uvd_stop(rdev);
6629 radeon_uvd_suspend(rdev); 6630 radeon_uvd_suspend(rdev);
6630 } 6631 }
6631 si_irq_suspend(rdev); 6632 si_irq_suspend(rdev);
@@ -6767,8 +6768,10 @@ void si_fini(struct radeon_device *rdev)
6767 radeon_vm_manager_fini(rdev); 6768 radeon_vm_manager_fini(rdev);
6768 radeon_ib_pool_fini(rdev); 6769 radeon_ib_pool_fini(rdev);
6769 radeon_irq_kms_fini(rdev); 6770 radeon_irq_kms_fini(rdev);
6770 if (rdev->has_uvd) 6771 if (rdev->has_uvd) {
6772 r600_uvd_stop(rdev);
6771 radeon_uvd_fini(rdev); 6773 radeon_uvd_fini(rdev);
6774 }
6772 si_pcie_gart_fini(rdev); 6775 si_pcie_gart_fini(rdev);
6773 r600_vram_scratch_fini(rdev); 6776 r600_vram_scratch_fini(rdev);
6774 radeon_gem_fini(rdev); 6777 radeon_gem_fini(rdev);