drm/amdgpu: cleanup vce/vcn selftests
Subsystems (2)
RFC PATCH 1/1 drm/amdgpu: cleanup vce/vcn selftests
Use amdgpu_sa_bo instead of amdgpu_bo.
Signed-off-by Nirmoy Das <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 17 +++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 47 ++++++++++++------------- 2 files changed, 31 insertions(+), 33 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +8 -9
@@ -81,7 +81,7 @@ MODULE_FIRMWARE(FIRMWARE_VEGA20);static void amdgpu_vce_idle_work_handler (struct work_struct *work);static int amdgpu_vce_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, -struct amdgpu_bo *bo, +struct amdgpu_sa_bo *bo,struct dma_fence **fence);static int amdgpu_vce_get_destroy_msg (struct amdgpu_ring *ring,uint32_t handle,bool direct,struct dma_fence **fence);
@@ -437,7 +437,7 @@ void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp)* Open up a stream for HW test */ static int amdgpu_vce_get_create_msg (struct amdgpu_ring *ring,uint32_t handle, -struct amdgpu_bo *bo, +struct amdgpu_sa_bo *bo,struct dma_fence **fence) {const unsigned ib_size_dw =1024 ;
@@ -454,7 +454,7 @@ static int amdgpu_vce_get_create_msg(struct amdgpu_ring *ring, uint32_t handle, ib = &job->ibs[0 ]; - addr =amdgpu_bo_gpu_offset (bo); + addr =amdgpu_sa_bo_gpu_addr (bo);/* stitch together an VCE create msg */ ib->length_dw =0 ;
@@ -1130,16 +1130,16 @@ int amdgpu_vce_ring_test_ring(struct amdgpu_ring *ring)int amdgpu_vce_ring_test_ib (struct amdgpu_ring *ring,long timeout) {struct dma_fence *fence =NULL ; -struct amdgpu_bo *bo =NULL ; +struct amdgpu_sa_bo *bo =NULL ; +struct amdgpu_device *adev = ring->adev;long r;/* skip vce ring1/2 ib test for now, since it's not reliable */ if (ring != &ring->adev->vce.ring[0 ])return 0 ; - r =amdgpu_bo_create_reserved (ring->adev,512 ,PAGE_SIZE , -AMDGPU_GEM_DOMAIN_VRAM , - &bo,NULL ,NULL ); + r =amdgpu_sa_bo_new (&adev->ib_pools[AMDGPU_IB_POOL_DIRECT ], + &bo,512 ,PAGE_SIZE );if (r)return r;
@@ -1158,8 +1158,7 @@ int amdgpu_vce_ring_test_ib(struct amdgpu_ring *ring, long timeout) r =0 ; error: +amdgpu_sa_bo_free (adev, &bo, fence);dma_fence_put (fence); -amdgpu_bo_unreserve (bo); -amdgpu_bo_unref (&bo);return r; }
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +23 -24
134 lines not on this page · raw message
Signature · 6 lines
2.29.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel