diff options
author | Christian König <christian.koenig@amd.com> | 2015-06-19 11:00:19 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-29 15:52:49 -0400 |
commit | 03507c4f2f63d8d98c2455cf4d192589fac553c7 (patch) | |
tree | 866a2e509f2de7bf285e8a74be0b323028cb4f53 /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
parent | 7cebc728174424d67df91dfb14f8b6dc13bed993 (diff) |
drm/amdgpu: recreate fence from user seq
And use common fence infrastructure for the wait.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 86b78c799176..84ba1d1bf327 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -739,9 +739,9 @@ int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data, | |||
739 | { | 739 | { |
740 | union drm_amdgpu_wait_cs *wait = data; | 740 | union drm_amdgpu_wait_cs *wait = data; |
741 | struct amdgpu_device *adev = dev->dev_private; | 741 | struct amdgpu_device *adev = dev->dev_private; |
742 | uint64_t seq[AMDGPU_MAX_RINGS] = {0}; | ||
743 | struct amdgpu_ring *ring = NULL; | ||
744 | unsigned long timeout = amdgpu_gem_timeout(wait->in.timeout); | 742 | unsigned long timeout = amdgpu_gem_timeout(wait->in.timeout); |
743 | struct amdgpu_fence *fence = NULL; | ||
744 | struct amdgpu_ring *ring = NULL; | ||
745 | struct amdgpu_ctx *ctx; | 745 | struct amdgpu_ctx *ctx; |
746 | long r; | 746 | long r; |
747 | 747 | ||
@@ -754,9 +754,12 @@ int amdgpu_cs_wait_ioctl(struct drm_device *dev, void *data, | |||
754 | if (r) | 754 | if (r) |
755 | return r; | 755 | return r; |
756 | 756 | ||
757 | seq[ring->idx] = wait->in.handle; | 757 | r = amdgpu_fence_recreate(ring, filp, wait->in.handle, &fence); |
758 | if (r) | ||
759 | return r; | ||
758 | 760 | ||
759 | r = amdgpu_fence_wait_seq_timeout(adev, seq, true, timeout); | 761 | r = fence_wait_timeout(&fence->base, true, timeout); |
762 | amdgpu_fence_unref(&fence); | ||
760 | amdgpu_ctx_put(ctx); | 763 | amdgpu_ctx_put(ctx); |
761 | if (r < 0) | 764 | if (r < 0) |
762 | return r; | 765 | return r; |