diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-09-03 03:23:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-09-03 03:23:41 -0400 |
commit | ae1ad26388228048db6a5f1056bd569ed2bbc4ec (patch) | |
tree | 223f50677aa00eb6f2a6529099a1005c7e43c071 /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |
parent | c84b82dd3e593db217f23c60f7edae02c76a3c4c (diff) | |
parent | 089cf7f6ecb266b6a4164919a2e69bd2f938374a (diff) |
Merge tag 'v5.3-rc7' into x86/mm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index f539a2a92774..7398b4850649 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -534,21 +534,24 @@ int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, | |||
534 | struct drm_sched_entity *entity) | 534 | struct drm_sched_entity *entity) |
535 | { | 535 | { |
536 | struct amdgpu_ctx_entity *centity = to_amdgpu_ctx_entity(entity); | 536 | struct amdgpu_ctx_entity *centity = to_amdgpu_ctx_entity(entity); |
537 | unsigned idx = centity->sequence & (amdgpu_sched_jobs - 1); | 537 | struct dma_fence *other; |
538 | struct dma_fence *other = centity->fences[idx]; | 538 | unsigned idx; |
539 | long r; | ||
539 | 540 | ||
540 | if (other) { | 541 | spin_lock(&ctx->ring_lock); |
541 | signed long r; | 542 | idx = centity->sequence & (amdgpu_sched_jobs - 1); |
542 | r = dma_fence_wait(other, true); | 543 | other = dma_fence_get(centity->fences[idx]); |
543 | if (r < 0) { | 544 | spin_unlock(&ctx->ring_lock); |
544 | if (r != -ERESTARTSYS) | ||
545 | DRM_ERROR("Error (%ld) waiting for fence!\n", r); | ||
546 | 545 | ||
547 | return r; | 546 | if (!other) |
548 | } | 547 | return 0; |
549 | } | ||
550 | 548 | ||
551 | return 0; | 549 | r = dma_fence_wait(other, true); |
550 | if (r < 0 && r != -ERESTARTSYS) | ||
551 | DRM_ERROR("Error (%ld) waiting for fence!\n", r); | ||
552 | |||
553 | dma_fence_put(other); | ||
554 | return r; | ||
552 | } | 555 | } |
553 | 556 | ||
554 | void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr) | 557 | void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr) |