mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-25 01:33:37 +07:00
drm/amdgpu:fix ring_write_multiple
ring_write_multiple should use buf_mask instead of ptr_mask Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
79a0c4655e
commit
5846e35569
@ -1739,9 +1739,9 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr
|
|||||||
if (ring->count_dw < count_dw) {
|
if (ring->count_dw < count_dw) {
|
||||||
DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
|
DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
|
||||||
} else {
|
} else {
|
||||||
occupied = ring->wptr & ring->ptr_mask;
|
occupied = ring->wptr & ring->buf_mask;
|
||||||
dst = (void *)&ring->ring[occupied];
|
dst = (void *)&ring->ring[occupied];
|
||||||
chunk1 = ring->ptr_mask + 1 - occupied;
|
chunk1 = ring->buf_mask + 1 - occupied;
|
||||||
chunk1 = (chunk1 >= count_dw) ? count_dw: chunk1;
|
chunk1 = (chunk1 >= count_dw) ? count_dw: chunk1;
|
||||||
chunk2 = count_dw - chunk1;
|
chunk2 = count_dw - chunk1;
|
||||||
chunk1 <<= 2;
|
chunk1 <<= 2;
|
||||||
|
Loading…
Reference in New Issue
Block a user