[PATCH 4/4] drm/amdgpu: assign the cpu/gpu address of fence from ring

Christian König christian.koenig at amd.com
Tue Jul 28 11:20:58 UTC 2020


Am 28.07.20 um 12:21 schrieb Jack Xiao:
> assign the cpu/gpu address of fence for the normal or mes ring
> from ring structure.
>
> Signed-off-by: Jack Xiao <Jack.Xiao at amd.com>
> Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
> Acked-by: Christian König <christian.koenig at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> index 58d4c219178a..0be3e2007387 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
> @@ -407,8 +407,8 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring,
>   	uint64_t index;
>   
>   	if (ring->funcs->type != AMDGPU_RING_TYPE_UVD) {
> -		ring->fence_drv.cpu_addr = &adev->wb.wb[ring->fence_offs];
> -		ring->fence_drv.gpu_addr = adev->wb.gpu_addr + (ring->fence_offs * 4);
> +		ring->fence_drv.cpu_addr = ring->fence_cpu_addr;
> +		ring->fence_drv.gpu_addr = ring->fence_gpu_addr;

That doesn't look like a good idea to me. We should probably rather 
remove ring->fence_offs and move all the handling here instead.

Christian.

>   	} else {
>   		/* put fence directly behind firmware */
>   		index = ALIGN(adev->uvd.fw->size, 8);



More information about the amd-gfx mailing list