Commit 67c4ca9f authored by Sunil Khatri's avatar Sunil Khatri Committed by Alex Deucher

drm/amdgpu: do not call insert_nop fn for zero count

Do not make a function call for zero size NOP as it
does not add anything in the ring and is unnecessary
function call.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarSunil Khatri <sunil.khatri@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ee0a469c
......@@ -145,7 +145,9 @@ void amdgpu_ring_commit(struct amdgpu_ring *ring)
count = ring->funcs->align_mask + 1 -
(ring->wptr & ring->funcs->align_mask);
count %= ring->funcs->align_mask + 1;
ring->funcs->insert_nop(ring, count);
if (count != 0)
ring->funcs->insert_nop(ring, count);
mb();
amdgpu_ring_set_wptr(ring);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment