aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 0d8bf2cb1956..9b0cab413677 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -2173,7 +2173,7 @@ static void gfx_v7_0_gpu_init(struct amdgpu_device *adev)
2173 2173
2174 adev->gfx.config.num_tile_pipes = adev->gfx.config.max_tile_pipes; 2174 adev->gfx.config.num_tile_pipes = adev->gfx.config.max_tile_pipes;
2175 adev->gfx.config.mem_max_burst_length_bytes = 256; 2175 adev->gfx.config.mem_max_burst_length_bytes = 256;
2176 if (adev->flags & AMDGPU_IS_APU) { 2176 if (adev->flags & AMD_IS_APU) {
2177 /* Get memory bank mapping mode. */ 2177 /* Get memory bank mapping mode. */
2178 tmp = RREG32(mmMC_FUS_DRAM0_BANK_ADDR_MAPPING); 2178 tmp = RREG32(mmMC_FUS_DRAM0_BANK_ADDR_MAPPING);
2179 dimm00_addr_map = REG_GET_FIELD(tmp, MC_FUS_DRAM0_BANK_ADDR_MAPPING, DIMM0ADDRMAP); 2179 dimm00_addr_map = REG_GET_FIELD(tmp, MC_FUS_DRAM0_BANK_ADDR_MAPPING, DIMM0ADDRMAP);
@@ -2648,6 +2648,7 @@ static int gfx_v7_0_ring_test_ib(struct amdgpu_ring *ring)
2648{ 2648{
2649 struct amdgpu_device *adev = ring->adev; 2649 struct amdgpu_device *adev = ring->adev;
2650 struct amdgpu_ib ib; 2650 struct amdgpu_ib ib;
2651 struct fence *f = NULL;
2651 uint32_t scratch; 2652 uint32_t scratch;
2652 uint32_t tmp = 0; 2653 uint32_t tmp = 0;
2653 unsigned i; 2654 unsigned i;
@@ -2662,26 +2663,23 @@ static int gfx_v7_0_ring_test_ib(struct amdgpu_ring *ring)
2662 r = amdgpu_ib_get(ring, NULL, 256, &ib); 2663 r = amdgpu_ib_get(ring, NULL, 256, &ib);
2663 if (r) { 2664 if (r) {
2664 DRM_ERROR("amdgpu: failed to get ib (%d).\n", r); 2665 DRM_ERROR("amdgpu: failed to get ib (%d).\n", r);
2665 amdgpu_gfx_scratch_free(adev, scratch); 2666 goto err1;
2666 return r;
2667 } 2667 }
2668 ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1); 2668 ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1);
2669 ib.ptr[1] = ((scratch - PACKET3_SET_UCONFIG_REG_START)); 2669 ib.ptr[1] = ((scratch - PACKET3_SET_UCONFIG_REG_START));
2670 ib.ptr[2] = 0xDEADBEEF; 2670 ib.ptr[2] = 0xDEADBEEF;
2671 ib.length_dw = 3; 2671 ib.length_dw = 3;
2672 r = amdgpu_ib_schedule(adev, 1, &ib, AMDGPU_FENCE_OWNER_UNDEFINED); 2672
2673 if (r) { 2673 r = amdgpu_sched_ib_submit_kernel_helper(adev, ring, &ib, 1, NULL,
2674 amdgpu_gfx_scratch_free(adev, scratch); 2674 AMDGPU_FENCE_OWNER_UNDEFINED,
2675 amdgpu_ib_free(adev, &ib); 2675 &f);
2676 DRM_ERROR("amdgpu: failed to schedule ib (%d).\n", r); 2676 if (r)
2677 return r; 2677 goto err2;
2678 } 2678
2679 r = amdgpu_fence_wait(ib.fence, false); 2679 r = fence_wait(f, false);
2680 if (r) { 2680 if (r) {
2681 DRM_ERROR("amdgpu: fence wait failed (%d).\n", r); 2681 DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
2682 amdgpu_gfx_scratch_free(adev, scratch); 2682 goto err2;
2683 amdgpu_ib_free(adev, &ib);
2684 return r;
2685 } 2683 }
2686 for (i = 0; i < adev->usec_timeout; i++) { 2684 for (i = 0; i < adev->usec_timeout; i++) {
2687 tmp = RREG32(scratch); 2685 tmp = RREG32(scratch);
@@ -2691,14 +2689,19 @@ static int gfx_v7_0_ring_test_ib(struct amdgpu_ring *ring)
2691 } 2689 }
2692 if (i < adev->usec_timeout) { 2690 if (i < adev->usec_timeout) {
2693 DRM_INFO("ib test on ring %d succeeded in %u usecs\n", 2691 DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
2694 ib.fence->ring->idx, i); 2692 ring->idx, i);
2693 goto err2;
2695 } else { 2694 } else {
2696 DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n", 2695 DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n",
2697 scratch, tmp); 2696 scratch, tmp);
2698 r = -EINVAL; 2697 r = -EINVAL;
2699 } 2698 }
2700 amdgpu_gfx_scratch_free(adev, scratch); 2699
2700err2:
2701 fence_put(f);
2701 amdgpu_ib_free(adev, &ib); 2702 amdgpu_ib_free(adev, &ib);
2703err1:
2704 amdgpu_gfx_scratch_free(adev, scratch);
2702 return r; 2705 return r;
2703} 2706}
2704 2707
@@ -3758,7 +3761,7 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev)
3758 int r; 3761 int r;
3759 3762
3760 /* allocate rlc buffers */ 3763 /* allocate rlc buffers */
3761 if (adev->flags & AMDGPU_IS_APU) { 3764 if (adev->flags & AMD_IS_APU) {
3762 if (adev->asic_type == CHIP_KAVERI) { 3765 if (adev->asic_type == CHIP_KAVERI) {
3763 adev->gfx.rlc.reg_list = spectre_rlc_save_restore_register_list; 3766 adev->gfx.rlc.reg_list = spectre_rlc_save_restore_register_list;
3764 adev->gfx.rlc.reg_list_size = 3767 adev->gfx.rlc.reg_list_size =