aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2016-06-19 01:59:07 -0400
committerOlof Johansson <olof@lixom.net>2016-06-19 01:59:07 -0400
commit8fd0976702f05042c776848819e5fd2a835f23c9 (patch)
tree8a87b0e33bf39adcc53b3ee4be61155dab86417b /drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
parent58935f24a996cb55595c29dd5303bd9b778c8b00 (diff)
parent8f50b8e57442d28e41bb736c173d8a2490549a82 (diff)
Merge tag 'gpmc-omap-fixes-for-v4.7' of https://github.com/rogerq/linux into fixes
OMAP-GPMC: Fixes for for v4.7-rc cycle: - Fix omap gpmc EXTRADELAY timing. The DT provided timings were wrongly used causing devices requiring extra delay timing to fail. * tag 'gpmc-omap-fixes-for-v4.7' of https://github.com/rogerq/linux: memory: omap-gpmc: Fix omap gpmc EXTRADELAY timing + Linux 4.7-rc3 Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index f4c3130d3fdb..b556bd0a8797 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -105,6 +105,15 @@ static void sdma_v2_4_init_golden_registers(struct amdgpu_device *adev)
105 } 105 }
106} 106}
107 107
108static void sdma_v2_4_free_microcode(struct amdgpu_device *adev)
109{
110 int i;
111 for (i = 0; i < adev->sdma.num_instances; i++) {
112 release_firmware(adev->sdma.instance[i].fw);
113 adev->sdma.instance[i].fw = NULL;
114 }
115}
116
108/** 117/**
109 * sdma_v2_4_init_microcode - load ucode images from disk 118 * sdma_v2_4_init_microcode - load ucode images from disk
110 * 119 *
@@ -461,6 +470,8 @@ static int sdma_v2_4_gfx_resume(struct amdgpu_device *adev)
461 /* Initialize the ring buffer's read and write pointers */ 470 /* Initialize the ring buffer's read and write pointers */
462 WREG32(mmSDMA0_GFX_RB_RPTR + sdma_offsets[i], 0); 471 WREG32(mmSDMA0_GFX_RB_RPTR + sdma_offsets[i], 0);
463 WREG32(mmSDMA0_GFX_RB_WPTR + sdma_offsets[i], 0); 472 WREG32(mmSDMA0_GFX_RB_WPTR + sdma_offsets[i], 0);
473 WREG32(mmSDMA0_GFX_IB_RPTR + sdma_offsets[i], 0);
474 WREG32(mmSDMA0_GFX_IB_OFFSET + sdma_offsets[i], 0);
464 475
465 /* set the wb address whether it's enabled or not */ 476 /* set the wb address whether it's enabled or not */
466 WREG32(mmSDMA0_GFX_RB_RPTR_ADDR_HI + sdma_offsets[i], 477 WREG32(mmSDMA0_GFX_RB_RPTR_ADDR_HI + sdma_offsets[i],
@@ -489,7 +500,11 @@ static int sdma_v2_4_gfx_resume(struct amdgpu_device *adev)
489 WREG32(mmSDMA0_GFX_IB_CNTL + sdma_offsets[i], ib_cntl); 500 WREG32(mmSDMA0_GFX_IB_CNTL + sdma_offsets[i], ib_cntl);
490 501
491 ring->ready = true; 502 ring->ready = true;
503 }
492 504
505 sdma_v2_4_enable(adev, true);
506 for (i = 0; i < adev->sdma.num_instances; i++) {
507 ring = &adev->sdma.instance[i].ring;
493 r = amdgpu_ring_test_ring(ring); 508 r = amdgpu_ring_test_ring(ring);
494 if (r) { 509 if (r) {
495 ring->ready = false; 510 ring->ready = false;
@@ -580,8 +595,8 @@ static int sdma_v2_4_start(struct amdgpu_device *adev)
580 return -EINVAL; 595 return -EINVAL;
581 } 596 }
582 597
583 /* unhalt the MEs */ 598 /* halt the engine before programing */
584 sdma_v2_4_enable(adev, true); 599 sdma_v2_4_enable(adev, false);
585 600
586 /* start the gfx rings and rlc compute queues */ 601 /* start the gfx rings and rlc compute queues */
587 r = sdma_v2_4_gfx_resume(adev); 602 r = sdma_v2_4_gfx_resume(adev);
@@ -1012,6 +1027,7 @@ static int sdma_v2_4_sw_fini(void *handle)
1012 for (i = 0; i < adev->sdma.num_instances; i++) 1027 for (i = 0; i < adev->sdma.num_instances; i++)
1013 amdgpu_ring_fini(&adev->sdma.instance[i].ring); 1028 amdgpu_ring_fini(&adev->sdma.instance[i].ring);
1014 1029
1030 sdma_v2_4_free_microcode(adev);
1015 return 0; 1031 return 0;
1016} 1032}
1017 1033