Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Use memset32 for IB padding

Use memset32 instead of open coding it, just because it is
that bit nicer.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tvrtko Ursulin and committed by
Alex Deucher
8c62f75c ccdc171b

+10 -2
+10 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
··· 159 159 */ 160 160 void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib) 161 161 { 162 - while (ib->length_dw & ring->funcs->align_mask) 163 - ib->ptr[ib->length_dw++] = ring->funcs->nop; 162 + u32 align_mask = ring->funcs->align_mask; 163 + u32 count = ib->length_dw & align_mask; 164 + 165 + if (count) { 166 + count = align_mask + 1 - count; 167 + 168 + memset32(&ib->ptr[ib->length_dw], ring->funcs->nop, count); 169 + 170 + ib->length_dw += count; 171 + } 164 172 } 165 173 166 174 /**