[PATCH] drm/amdgpu: clean up the count calculation for nop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



clean up the calculation for nops count before
commit in the ring.

Signed-off-by: Sunil Khatri <sunil.khatri@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 0d72d2cbb64b..2c8218332c65 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -142,9 +142,8 @@ void amdgpu_ring_commit(struct amdgpu_ring *ring)
 	uint32_t count;
 
 	/* We pad to match fetch size */
-	count = ring->funcs->align_mask + 1 -
-		(ring->wptr & ring->funcs->align_mask);
-	count %= ring->funcs->align_mask + 1;
+	count = ring->funcs->align_mask -
+		((ring->wptr + ring->funcs->align_mask) & ring->funcs->align_mask);
 
 	if (count != 0)
 		ring->funcs->insert_nop(ring, count);
-- 
2.34.1




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux