mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +00:00
drm/amdgpu: remove usec timeout loop from IB tests
We already waited for the fence, so waiting for the registers is completely pointless and just copy & pasted from the ring test. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
22a77cf6d8
commit
6d44565d53
5 changed files with 17 additions and 56 deletions
|
@ -622,7 +622,6 @@ static int cik_sdma_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
struct amdgpu_ib ib;
|
struct amdgpu_ib ib;
|
||||||
struct fence *f = NULL;
|
struct fence *f = NULL;
|
||||||
unsigned i;
|
|
||||||
unsigned index;
|
unsigned index;
|
||||||
int r;
|
int r;
|
||||||
u32 tmp = 0;
|
u32 tmp = 0;
|
||||||
|
@ -644,7 +643,8 @@ static int cik_sdma_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
goto err0;
|
goto err0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ib.ptr[0] = SDMA_PACKET(SDMA_OPCODE_WRITE, SDMA_WRITE_SUB_OPCODE_LINEAR, 0);
|
ib.ptr[0] = SDMA_PACKET(SDMA_OPCODE_WRITE,
|
||||||
|
SDMA_WRITE_SUB_OPCODE_LINEAR, 0);
|
||||||
ib.ptr[1] = lower_32_bits(gpu_addr);
|
ib.ptr[1] = lower_32_bits(gpu_addr);
|
||||||
ib.ptr[2] = upper_32_bits(gpu_addr);
|
ib.ptr[2] = upper_32_bits(gpu_addr);
|
||||||
ib.ptr[3] = 1;
|
ib.ptr[3] = 1;
|
||||||
|
@ -659,16 +659,9 @@ static int cik_sdma_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < adev->usec_timeout; i++) {
|
|
||||||
tmp = le32_to_cpu(adev->wb.wb[index]);
|
tmp = le32_to_cpu(adev->wb.wb[index]);
|
||||||
if (tmp == 0xDEADBEEF)
|
if (tmp == 0xDEADBEEF) {
|
||||||
break;
|
DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
|
||||||
DRM_UDELAY(1);
|
|
||||||
}
|
|
||||||
if (i < adev->usec_timeout) {
|
|
||||||
DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
|
|
||||||
ring->idx, i);
|
|
||||||
goto err1;
|
|
||||||
} else {
|
} else {
|
||||||
DRM_ERROR("amdgpu: ib test failed (0x%08X)\n", tmp);
|
DRM_ERROR("amdgpu: ib test failed (0x%08X)\n", tmp);
|
||||||
r = -EINVAL;
|
r = -EINVAL;
|
||||||
|
|
|
@ -2112,7 +2112,6 @@ static int gfx_v7_0_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
struct fence *f = NULL;
|
struct fence *f = NULL;
|
||||||
uint32_t scratch;
|
uint32_t scratch;
|
||||||
uint32_t tmp = 0;
|
uint32_t tmp = 0;
|
||||||
unsigned i;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = amdgpu_gfx_scratch_get(adev, &scratch);
|
r = amdgpu_gfx_scratch_get(adev, &scratch);
|
||||||
|
@ -2141,16 +2140,9 @@ static int gfx_v7_0_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
for (i = 0; i < adev->usec_timeout; i++) {
|
|
||||||
tmp = RREG32(scratch);
|
tmp = RREG32(scratch);
|
||||||
if (tmp == 0xDEADBEEF)
|
if (tmp == 0xDEADBEEF) {
|
||||||
break;
|
DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
|
||||||
DRM_UDELAY(1);
|
|
||||||
}
|
|
||||||
if (i < adev->usec_timeout) {
|
|
||||||
DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
|
|
||||||
ring->idx, i);
|
|
||||||
goto err2;
|
|
||||||
} else {
|
} else {
|
||||||
DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n",
|
DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n",
|
||||||
scratch, tmp);
|
scratch, tmp);
|
||||||
|
|
|
@ -784,7 +784,6 @@ static int gfx_v8_0_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
struct fence *f = NULL;
|
struct fence *f = NULL;
|
||||||
uint32_t scratch;
|
uint32_t scratch;
|
||||||
uint32_t tmp = 0;
|
uint32_t tmp = 0;
|
||||||
unsigned i;
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = amdgpu_gfx_scratch_get(adev, &scratch);
|
r = amdgpu_gfx_scratch_get(adev, &scratch);
|
||||||
|
@ -813,16 +812,9 @@ static int gfx_v8_0_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
||||||
goto err2;
|
goto err2;
|
||||||
}
|
}
|
||||||
for (i = 0; i < adev->usec_timeout; i++) {
|
|
||||||
tmp = RREG32(scratch);
|
tmp = RREG32(scratch);
|
||||||
if (tmp == 0xDEADBEEF)
|
if (tmp == 0xDEADBEEF) {
|
||||||
break;
|
DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
|
||||||
DRM_UDELAY(1);
|
|
||||||
}
|
|
||||||
if (i < adev->usec_timeout) {
|
|
||||||
DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
|
|
||||||
ring->idx, i);
|
|
||||||
goto err2;
|
|
||||||
} else {
|
} else {
|
||||||
DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n",
|
DRM_ERROR("amdgpu: ib test failed (scratch(0x%04X)=0x%08X)\n",
|
||||||
scratch, tmp);
|
scratch, tmp);
|
||||||
|
|
|
@ -671,7 +671,6 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
struct amdgpu_ib ib;
|
struct amdgpu_ib ib;
|
||||||
struct fence *f = NULL;
|
struct fence *f = NULL;
|
||||||
unsigned i;
|
|
||||||
unsigned index;
|
unsigned index;
|
||||||
int r;
|
int r;
|
||||||
u32 tmp = 0;
|
u32 tmp = 0;
|
||||||
|
@ -713,16 +712,9 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < adev->usec_timeout; i++) {
|
|
||||||
tmp = le32_to_cpu(adev->wb.wb[index]);
|
tmp = le32_to_cpu(adev->wb.wb[index]);
|
||||||
if (tmp == 0xDEADBEEF)
|
if (tmp == 0xDEADBEEF) {
|
||||||
break;
|
DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
|
||||||
DRM_UDELAY(1);
|
|
||||||
}
|
|
||||||
if (i < adev->usec_timeout) {
|
|
||||||
DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
|
|
||||||
ring->idx, i);
|
|
||||||
goto err1;
|
|
||||||
} else {
|
} else {
|
||||||
DRM_ERROR("amdgpu: ib test failed (0x%08X)\n", tmp);
|
DRM_ERROR("amdgpu: ib test failed (0x%08X)\n", tmp);
|
||||||
r = -EINVAL;
|
r = -EINVAL;
|
||||||
|
|
|
@ -901,7 +901,6 @@ static int sdma_v3_0_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
struct amdgpu_ib ib;
|
struct amdgpu_ib ib;
|
||||||
struct fence *f = NULL;
|
struct fence *f = NULL;
|
||||||
unsigned i;
|
|
||||||
unsigned index;
|
unsigned index;
|
||||||
int r;
|
int r;
|
||||||
u32 tmp = 0;
|
u32 tmp = 0;
|
||||||
|
@ -943,16 +942,9 @@ static int sdma_v3_0_ring_test_ib(struct amdgpu_ring *ring)
|
||||||
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
DRM_ERROR("amdgpu: fence wait failed (%d).\n", r);
|
||||||
goto err1;
|
goto err1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < adev->usec_timeout; i++) {
|
|
||||||
tmp = le32_to_cpu(adev->wb.wb[index]);
|
tmp = le32_to_cpu(adev->wb.wb[index]);
|
||||||
if (tmp == 0xDEADBEEF)
|
if (tmp == 0xDEADBEEF) {
|
||||||
break;
|
DRM_INFO("ib test on ring %d succeeded\n", ring->idx);
|
||||||
DRM_UDELAY(1);
|
|
||||||
}
|
|
||||||
if (i < adev->usec_timeout) {
|
|
||||||
DRM_INFO("ib test on ring %d succeeded in %u usecs\n",
|
|
||||||
ring->idx, i);
|
|
||||||
goto err1;
|
|
||||||
} else {
|
} else {
|
||||||
DRM_ERROR("amdgpu: ib test failed (0x%08X)\n", tmp);
|
DRM_ERROR("amdgpu: ib test failed (0x%08X)\n", tmp);
|
||||||
r = -EINVAL;
|
r = -EINVAL;
|
||||||
|
|
Loading…
Reference in a new issue