diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2018-10-19 16:22:48 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-05 14:21:23 -0500 |
commit | c66ed765a0a97b8900f37d4a71f1d75f52f56eeb (patch) | |
tree | cfed66df4fc6088c761e1d5cce16a300af57c0df /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
parent | faf6e1a87e07423a729e04fb2e8188742e89ea4c (diff) |
drm/amdgpu: Retire amdgpu_ring.ready flag v4
Start using drm_gpu_scheduler.ready isntead.
v3:
Add helper function to run ring test and set
sched.ready flag status accordingly, clean explicit
sched.ready sets from the IP specific files.
v4: Add kerneldoc and rebase.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index b70e85ec147d..3c89c8aa33d8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |||
@@ -338,7 +338,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, | |||
338 | */ | 338 | */ |
339 | void amdgpu_ring_fini(struct amdgpu_ring *ring) | 339 | void amdgpu_ring_fini(struct amdgpu_ring *ring) |
340 | { | 340 | { |
341 | ring->ready = false; | 341 | ring->sched.ready = false; |
342 | 342 | ||
343 | /* Not to finish a ring which is not initialized */ | 343 | /* Not to finish a ring which is not initialized */ |
344 | if (!(ring->adev) || !(ring->adev->rings[ring->idx])) | 344 | if (!(ring->adev) || !(ring->adev->rings[ring->idx])) |
@@ -500,3 +500,23 @@ static void amdgpu_debugfs_ring_fini(struct amdgpu_ring *ring) | |||
500 | debugfs_remove(ring->ent); | 500 | debugfs_remove(ring->ent); |
501 | #endif | 501 | #endif |
502 | } | 502 | } |
503 | |||
504 | /** | ||
505 | * amdgpu_ring_test_helper - tests ring and set sched readiness status | ||
506 | * | ||
507 | * @ring: ring to try the recovery on | ||
508 | * | ||
509 | * Tests ring and set sched readiness status | ||
510 | * | ||
511 | * Returns 0 on success, error on failure. | ||
512 | */ | ||
513 | int amdgpu_ring_test_helper(struct amdgpu_ring *ring) | ||
514 | { | ||
515 | int r; | ||
516 | |||
517 | r = amdgpu_ring_test_ring(ring); | ||
518 | |||
519 | ring->sched.ready = !r; | ||
520 | |||
521 | return r; | ||
522 | } | ||