[PATCH] Revert "drm/amdgpu: add dep_sync for amdgpu job"

Chunming Zhou zhoucm1 at amd.com
Mon Nov 13 02:45:59 UTC 2017


NAK, you will find the performance drop with this change.

dep_sync should be used by CS dependency/syncobj, I thought which 
already be handled.

I will make a patch for using dep_sync in a minute.

Thanks for reminder.

David Zhou


On 2017年11月04日 01:51, Andrey Grodzovsky wrote:
> This reverts commit a340c7bcf1ea01f8bee82d62b521f0c5e4653425.
>
> This is a cleanp of dep_sync in amdgpu_job. The origianl patch
> never calls amdgpu_sync_fence on dep_sync, only
> amdgpu_sync_get_fence in amdgpu_job_dependency, so dep_sync is never
> filled and hence the change has no effect.
>
> Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h     |  1 -
>   drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 18 ++++++------------
>   2 files changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 4f919d3..597109d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -1121,7 +1121,6 @@ struct amdgpu_job {
>   	struct amdgpu_vm	*vm;
>   	struct amdgpu_ring	*ring;
>   	struct amdgpu_sync	sync;
> -	struct amdgpu_sync	dep_sync;
>   	struct amdgpu_sync	sched_sync;
>   	struct amdgpu_ib	*ibs;
>   	struct dma_fence	*fence; /* the hw fence */
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 18770a8..90cde23 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -60,7 +60,6 @@ int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs,
>   	(*job)->num_ibs = num_ibs;
>   
>   	amdgpu_sync_create(&(*job)->sync);
> -	amdgpu_sync_create(&(*job)->dep_sync);
>   	amdgpu_sync_create(&(*job)->sched_sync);
>   	(*job)->vram_lost_counter = atomic_read(&adev->vram_lost_counter);
>   
> @@ -104,7 +103,6 @@ static void amdgpu_job_free_cb(struct amd_sched_job *s_job)
>   	amdgpu_ring_priority_put(job->ring, s_job->s_priority);
>   	dma_fence_put(job->fence);
>   	amdgpu_sync_free(&job->sync);
> -	amdgpu_sync_free(&job->dep_sync);
>   	amdgpu_sync_free(&job->sched_sync);
>   	kfree(job);
>   }
> @@ -115,7 +113,6 @@ void amdgpu_job_free(struct amdgpu_job *job)
>   
>   	dma_fence_put(job->fence);
>   	amdgpu_sync_free(&job->sync);
> -	amdgpu_sync_free(&job->dep_sync);
>   	amdgpu_sync_free(&job->sched_sync);
>   	kfree(job);
>   }
> @@ -149,17 +146,9 @@ static struct dma_fence *amdgpu_job_dependency(struct amd_sched_job *sched_job,
>   {
>   	struct amdgpu_job *job = to_amdgpu_job(sched_job);
>   	struct amdgpu_vm *vm = job->vm;
> -
> -	struct dma_fence *fence = amdgpu_sync_get_fence(&job->dep_sync);
>   	int r;
> +	struct dma_fence *fence = amdgpu_sync_get_fence(&job->sync);
>   
> -	if (amd_sched_dependency_optimized(fence, s_entity)) {
> -		r = amdgpu_sync_fence(job->adev, &job->sched_sync, fence);
> -		if (r)
> -			DRM_ERROR("Error adding fence to sync (%d)\n", r);
> -	}
> -	if (!fence)
> -		fence = amdgpu_sync_get_fence(&job->sync);
>   	while (fence == NULL && vm && !job->vm_id) {
>   		struct amdgpu_ring *ring = job->ring;
>   
> @@ -172,6 +161,11 @@ static struct dma_fence *amdgpu_job_dependency(struct amd_sched_job *sched_job,
>   		fence = amdgpu_sync_get_fence(&job->sync);
>   	}
>   
> +	if (amd_sched_dependency_optimized(fence, s_entity)) {
> +		r = amdgpu_sync_fence(job->adev, &job->sched_sync, fence);
> +		if (r)
> +			DRM_ERROR("Error adding fence to sync (%d)\n", r);
> +	}
>   	return fence;
>   }
>   



More information about the amd-gfx mailing list