diff options
author | Monk Liu <Monk.Liu@amd.com> | 2016-03-17 13:57:09 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-03-17 11:54:53 -0400 |
commit | 676d8c24f3e825484085d10fc1768cab46ed5166 (patch) | |
tree | 642fb86a1a6d9b0f8b710dc6e994aaecd2e06c49 /drivers | |
parent | 73cfa5f5cec3f4b99185d3535928dee6d01ba2f6 (diff) | |
download | linux-676d8c24f3e825484085d10fc1768cab46ed5166.tar.bz2 |
drm/amdgpu: use sched fence if possible
when preemption feature lands, the SA bo should rely on sched
fence, because hw fence will be invalid after its job preempted
or skipped.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index 063064c9351f..9c9b19e2f353 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -70,9 +70,12 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size, void amdgpu_job_free(struct amdgpu_job *job) { unsigned i; + struct fence *f; + /* use sched fence if available */ + f = (job->base.s_fence)? &job->base.s_fence->base : job->fence; for (i = 0; i < job->num_ibs; ++i) - amdgpu_sa_bo_free(job->adev, &job->ibs[i].sa_bo, job->fence); + amdgpu_sa_bo_free(job->adev, &job->ibs[i].sa_bo, f); fence_put(job->fence); amdgpu_bo_unref(&job->uf.bo); |