diff options
author | Marek Olšák <marek.olsak@amd.com> | 2015-07-08 11:12:31 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-05 13:47:52 -0400 |
commit | 8097d08ee46ea032c66ce9db0a4db585cd0c796b (patch) | |
tree | 4575b7a45d04f02b03bb4c4fef837f69456bc9d3 /amdgpu | |
parent | 67c994f057b9fd5a92f820a0f986d0bbba7848fc (diff) |
amdgpu: check the user fence only if the IP supports user fences
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r-- | amdgpu/amdgpu_cs.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index b3f51700fa16..15645274cf67 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -383,7 +383,6 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_query_fence *fence, uint32_t *expired) { amdgpu_context_handle context; - uint64_t *signaled_fence; uint64_t *expired_fence; unsigned ip_type, ip_instance; uint32_t ring; @@ -405,8 +404,6 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_query_fence *fence, ip_type = fence->ip_type; ip_instance = fence->ip_instance; ring = fence->ring; - signaled_fence = context->fence_cpu; - signaled_fence += amdgpu_cs_fence_index(ip_type, ring); expired_fence = &context->expired_fences[ip_type][ip_instance][ring]; *expired = false; @@ -418,17 +415,25 @@ int amdgpu_cs_query_fence_status(struct amdgpu_cs_query_fence *fence, return 0; } - if (fence->fence <= *signaled_fence) { - /* This fence value is signaled already. */ - *expired_fence = *signaled_fence; - pthread_mutex_unlock(&context->sequence_mutex); - *expired = true; - return 0; - } + /* Check the user fence only if the IP supports user fences. */ + if (fence->ip_type != AMDGPU_HW_IP_UVD && + fence->ip_type != AMDGPU_HW_IP_VCE) { + uint64_t *signaled_fence = context->fence_cpu; + signaled_fence += amdgpu_cs_fence_index(ip_type, ring); + + if (fence->fence <= *signaled_fence) { + /* This fence value is signaled already. */ + *expired_fence = *signaled_fence; + pthread_mutex_unlock(&context->sequence_mutex); + *expired = true; + return 0; + } - if (fence->timeout_ns == 0) { - pthread_mutex_unlock(&context->sequence_mutex); - return 0; + /* Checking the user fence is enough. */ + if (fence->timeout_ns == 0) { + pthread_mutex_unlock(&context->sequence_mutex); + return 0; + } } pthread_mutex_unlock(&context->sequence_mutex); |