diff options
| author | Sunil Khatri <[email protected]> | 2024-07-31 08:06:15 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-08-06 14:43:28 +0000 |
| commit | 67c4ca9f794951482c54a7006c8b3c367d6c3efc (patch) | |
| tree | fb0d73f6afd0b38eba971b0839af758736281b9b | |
| parent | drm/amdkfd: support per-queue reset on gfx9 (diff) | |
| download | kernel-67c4ca9f794951482c54a7006c8b3c367d6c3efc.tar.gz kernel-67c4ca9f794951482c54a7006c8b3c367d6c3efc.zip | |
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: Christian König <[email protected]>
Signed-off-by: Sunil Khatri <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index ad49cecb20b8..0d72d2cbb64b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -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); |
