diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-09-16 18:02:34 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-09-16 22:53:03 +0300 |
commit | 9a9db6ef7cf486f4849fe6bb8619009b5fd66399 (patch) | |
tree | 58dc5cb7a0287de36068dd3cfc6673a8b7a640fa /drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | |
parent | 58fafbaf166673f1a5724b42360d6b35610727aa (diff) | |
download | linux-9a9db6ef7cf486f4849fe6bb8619009b5fd66399.tar.xz |
drm/amdgpu: use the new ring ib and dma frame size callbacks (v2)
Use them to more accurately determine the ring size required
for ib submission.
v2: drop extra alignment
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 2aa741c2a64c..4127e7ceace0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -125,7 +125,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, unsigned patch_offset = ~0; struct amdgpu_vm *vm; uint64_t fence_ctx; - uint32_t status = 0; + uint32_t status = 0, alloc_size; unsigned i; int r = 0; @@ -152,7 +152,10 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, return -EINVAL; } - r = amdgpu_ring_alloc(ring, 256 * num_ibs); + alloc_size = amdgpu_ring_get_dma_frame_size(ring) + + num_ibs * amdgpu_ring_get_emit_ib_size(ring); + + r = amdgpu_ring_alloc(ring, alloc_size); if (r) { dev_err(adev->dev, "scheduling IB failed (%d).\n", r); return r; |