diff options
| author | Monk Liu <[email protected]> | 2017-03-21 10:48:45 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2017-03-30 03:55:38 +0000 |
| commit | e09706f46ebecf3ae39996772c0ece12e91d8c45 (patch) | |
| tree | b73ae389eb1d2dc88cc338aa46d7ad6f80b9edf8 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
| parent | drm/amdgpu:virt_init_setting invoke is missed! (diff) | |
| download | kernel-e09706f46ebecf3ae39996772c0ece12e91d8c45.tar.gz kernel-e09706f46ebecf3ae39996772c0ece12e91d8c45.zip | |
drm/amdgpu:fix ring init sequence
ring->buf_mask need be set prior to ring_clear_ring invoke
and fix ring_clear_ring as well which should use buf_mask
instead of ptr_mask
Signed-off-by: Monk Liu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index bfd4022210ed..783d52a007ea 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c @@ -235,6 +235,9 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, ring->ring_size = roundup_pow_of_two(max_dw * 4 * amdgpu_sched_hw_submission); + ring->buf_mask = (ring->ring_size / 4) - 1; + ring->ptr_mask = ring->funcs->support_64bit_ptrs ? + 0xffffffffffffffff : ring->buf_mask; /* Allocate ring buffer */ if (ring->ring_obj == NULL) { r = amdgpu_bo_create_kernel(adev, ring->ring_size, PAGE_SIZE, @@ -248,9 +251,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, } amdgpu_ring_clear_ring(ring); } - ring->buf_mask = (ring->ring_size / 4) - 1; - ring->ptr_mask = ring->funcs->support_64bit_ptrs ? - 0xffffffffffffffff : ring->buf_mask; ring->max_dw = max_dw; |
