Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 676d8c24 authored by Monk Liu's avatar Monk Liu Committed by Alex Deucher
Browse files

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: default avatarMonk Liu <Monk.Liu@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 73cfa5f5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);