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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -145,6 +145,8 @@ 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;

	if (count != 0)
		ring->funcs->insert_nop(ring, count);

	mb();