sorry, I see we already have padding inside ring_alloc, I'll see why I still get [drm:amdgpu_ring_insert_nop [amdgpu]] *ERROR* amdgpu: writing more dwords to the ring than expected! BR Monk ________________________________ å??件人: Liu, Monk å??é??æ?¶é?´: 2017å¹´1æ??18æ?¥ 15:04:57 æ?¶ä»¶äºº: amd-gfx at lists.freedesktop.org 主é¢?: ç?å¤?: [PATCH] drm/amdgpu:fix write more dws to ring Hi Alex previous patch is just for showing what I want to express : I found "emit_frame_size" is not doable anymore for gfx ring ... we already set "funcs->align_mask" to 0xff which means "amdgpu_ring_commit" call will automatically insert some NOP to make each submission 256 dword aligned (and will be 512 if we used above 256 DWs), so at least we need 256 dw per submit. but (emit_frame_size + ib_count * emit_ib_size) is always less than 256 , and if we pass it to amdgpu_ring_alloc, we'll run into this issue: [drm:amdgpu_ring_insert_nop [amdgpu]] *ERROR* amdgpu: writing more dwords to the ring than expected! any comments ? BR Monk ________________________________ å??件人: Monk Liu <Monk.Liu at amd.com> å??é??æ?¶é?´: 2017å¹´1æ??18æ?¥ 14:56:46 æ?¶ä»¶äºº: amd-gfx at lists.freedesktop.org æ??é??: Liu, Monk 主é¢?: [PATCH] drm/amdgpu:fix write more dws to ring Change-Id: I745512ed7d181e2cd0ce668c86ccfbb2dec80d4d Signed-off-by: Monk Liu <Monk.Liu at amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 9129b8c..6c24ed8 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, alloc_size; + uint32_t status = 0; unsigned i; int r = 0; @@ -152,10 +152,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, return -EINVAL; } - alloc_size = ring->funcs->emit_frame_size + num_ibs * - ring->funcs->emit_ib_size; - - r = amdgpu_ring_alloc(ring, alloc_size); + r = amdgpu_ring_alloc(ring, ring->funcs.align_mask + 1); if (r) { dev_err(adev->dev, "scheduling IB failed (%d).\n", r); return r; -- 2.7.4 -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20170118/4711bf34/attachment-0001.html>