[PATCH 04/11] drm/amdgpu: move setting the GART addr into TTM

Huang Rui ray.huang at amd.com
Thu Aug 23 11:23:55 UTC 2018


On Wed, Aug 22, 2018 at 05:05:10PM +0200, Christian König wrote:
> Move setting the GART addr for window based copies into the TTM code who
> uses it.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>

Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 --
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 5 ++++-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> index 391e2f7c03aa..239ccbae09bc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
> @@ -82,8 +82,6 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev, unsigned size,
>  	r = amdgpu_ib_get(adev, NULL, size, &(*job)->ibs[0]);
>  	if (r)
>  		kfree(*job);
> -	else
> -		(*job)->vm_pd_addr = adev->gart.table_addr;
>  
>  	return r;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index c6611cff64c8..b4333f60ed8b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -2048,7 +2048,10 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
>  	if (r)
>  		return r;
>  
> -	job->vm_needs_flush = vm_needs_flush;
> +	if (vm_needs_flush) {
> +		job->vm_pd_addr = adev->gart.table_addr;
> +		job->vm_needs_flush = true;
> +	}
>  	if (resv) {
>  		r = amdgpu_sync_resv(adev, &job->sync, resv,
>  				     AMDGPU_FENCE_OWNER_UNDEFINED,
> -- 
> 2.17.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list