drm/amdgpu: remove amdgpu_sync_wait
authorChristian König <christian.koenig@amd.com>
Fri, 20 May 2016 11:06:09 +0000 (13:06 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 7 Jul 2016 18:51:21 +0000 (14:51 -0400)
Stop hiding bugs, instead print a proper error when the scheduler
doesn't handle all dependencies.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c

index 7ed7c256934f897ea70499804295da7b5e3b9bbb..0c6c6c99bfd286b077c5bb5c40cf0323952a3707 100644 (file)
@@ -601,7 +601,6 @@ bool amdgpu_sync_is_idle(struct amdgpu_sync *sync);
 int amdgpu_sync_cycle_fences(struct amdgpu_sync *dst, struct amdgpu_sync *src,
                             struct fence *fence);
 struct fence *amdgpu_sync_get_fence(struct amdgpu_sync *sync);
-int amdgpu_sync_wait(struct amdgpu_sync *sync);
 void amdgpu_sync_free(struct amdgpu_sync *sync);
 int amdgpu_sync_init(void);
 void amdgpu_sync_fini(void);
index ddfed939c893785da00b1e618607f2e9e45f773b..009e9051803848518ddfbca7b42cfebbba0b9884 100644 (file)
@@ -166,11 +166,7 @@ static struct fence *amdgpu_job_run(struct amd_sched_job *sched_job)
        }
        job = to_amdgpu_job(sched_job);
 
-       r = amdgpu_sync_wait(&job->sync);
-       if (r) {
-               DRM_ERROR("failed to sync wait (%d)\n", r);
-               return NULL;
-       }
+       BUG_ON(!amdgpu_sync_is_idle(&job->sync));
 
        trace_amdgpu_sched_run_job(job);
        r = amdgpu_ib_schedule(job->ring, job->num_ibs, job->ibs,
index e0ff1a1a6051bf01c9b572abdd70f279f679f2a5..c0ed5b9c1649fb3281b3e7abb575281e1145fc15 100644 (file)
@@ -326,25 +326,6 @@ struct fence *amdgpu_sync_get_fence(struct amdgpu_sync *sync)
        return NULL;
 }
 
-int amdgpu_sync_wait(struct amdgpu_sync *sync)
-{
-       struct amdgpu_sync_entry *e;
-       struct hlist_node *tmp;
-       int i, r;
-
-       hash_for_each_safe(sync->fences, i, tmp, e, node) {
-               r = fence_wait(e->fence, false);
-               if (r)
-                       return r;
-
-               hash_del(&e->node);
-               fence_put(e->fence);
-               kmem_cache_free(amdgpu_sync_slab, e);
-       }
-
-       return 0;
-}
-
 /**
  * amdgpu_sync_free - free the sync object
  *