aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 00a50cc5ec9a..af1b879a9ee9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -492,7 +492,7 @@ static int amdgpu_device_wb_init(struct amdgpu_device *adev)
492 memset(&adev->wb.used, 0, sizeof(adev->wb.used)); 492 memset(&adev->wb.used, 0, sizeof(adev->wb.used));
493 493
494 /* clear wb memory */ 494 /* clear wb memory */
495 memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t)); 495 memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t) * 8);
496 } 496 }
497 497
498 return 0; 498 return 0;
@@ -530,8 +530,9 @@ int amdgpu_device_wb_get(struct amdgpu_device *adev, u32 *wb)
530 */ 530 */
531void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb) 531void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb)
532{ 532{
533 wb >>= 3;
533 if (wb < adev->wb.num_wb) 534 if (wb < adev->wb.num_wb)
534 __clear_bit(wb >> 3, adev->wb.used); 535 __clear_bit(wb, adev->wb.used);
535} 536}
536 537
537/** 538/**
@@ -1455,11 +1456,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1455 for (i = adev->num_ip_blocks - 1; i >= 0; i--) { 1456 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
1456 if (!adev->ip_blocks[i].status.hw) 1457 if (!adev->ip_blocks[i].status.hw)
1457 continue; 1458 continue;
1458 if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
1459 amdgpu_free_static_csa(adev);
1460 amdgpu_device_wb_fini(adev);
1461 amdgpu_device_vram_scratch_fini(adev);
1462 }
1463 1459
1464 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && 1460 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
1465 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) { 1461 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
@@ -1486,6 +1482,13 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
1486 for (i = adev->num_ip_blocks - 1; i >= 0; i--) { 1482 for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
1487 if (!adev->ip_blocks[i].status.sw) 1483 if (!adev->ip_blocks[i].status.sw)
1488 continue; 1484 continue;
1485
1486 if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
1487 amdgpu_free_static_csa(adev);
1488 amdgpu_device_wb_fini(adev);
1489 amdgpu_device_vram_scratch_fini(adev);
1490 }
1491
1489 r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev); 1492 r = adev->ip_blocks[i].version->funcs->sw_fini((void *)adev);
1490 /* XXX handle errors */ 1493 /* XXX handle errors */
1491 if (r) { 1494 if (r) {
@@ -2284,14 +2287,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
2284 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON); 2287 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
2285 } 2288 }
2286 drm_modeset_unlock_all(dev); 2289 drm_modeset_unlock_all(dev);
2287 } else {
2288 /*
2289 * There is no equivalent atomic helper to turn on
2290 * display, so we defined our own function for this,
2291 * once suspend resume is supported by the atomic
2292 * framework this will be reworked
2293 */
2294 amdgpu_dm_display_resume(adev);
2295 } 2290 }
2296 } 2291 }
2297 2292
@@ -2726,7 +2721,6 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
2726 if (amdgpu_device_has_dc_support(adev)) { 2721 if (amdgpu_device_has_dc_support(adev)) {
2727 if (drm_atomic_helper_resume(adev->ddev, state)) 2722 if (drm_atomic_helper_resume(adev->ddev, state))
2728 dev_info(adev->dev, "drm resume failed:%d\n", r); 2723 dev_info(adev->dev, "drm resume failed:%d\n", r);
2729 amdgpu_dm_display_resume(adev);
2730 } else { 2724 } else {
2731 drm_helper_resume_force_mode(adev->ddev); 2725 drm_helper_resume_force_mode(adev->ddev);
2732 } 2726 }