summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-07-08 11:12:31 +0200
committerMichel Dänzer <michel@daenzer.net>2015-07-15 11:17:45 +0900
commit2b14aea8a62546bfa373f75e455700ea0296105d (patch)
tree783e63cb24136ae1fbf665e72a0ff6234e16bb1b
parent8d0f83967344b1bdcd849c2b996d9e84b398a219 (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> (cherry picked from commit 2078eb381a98ffcfac4a97d2938d31e6abe42092)
-rw-r--r--amdgpu/amdgpu_cs.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index b3f51700..15645274 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);