aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-09-03 23:06:29 -0400
committerDave Airlie <airlied@redhat.com>2015-09-03 23:06:29 -0400
commit99495589aa4de7166af254bc497cdbe133fc24bb (patch)
treed525e957854064f2492976e9beb8a04dddc28143 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
parent879a37d00f1882b1e56a66e626af4194d592d257 (diff)
parentbddf8026386927985ef6d0d11c3ba78f70b76bad (diff)
Merge branch 'drm-next-4.3' of git://people.freedesktop.org/~agd5f/linux into drm-next
More fixes for radeon and amdgpu for 4.3: - Send full DP aux address fixes for radeon and amdgpu - Fix an HDMI display regression for pre-DCE5 parts - UVD suspend fixes for amdgpu - Add an rs480 suspend quirk - Fix bo reserve handling in amdgpu GEM_OP ioctl - GPU scheduler fixes - SDMA optimizations - MEC fix for Fiji * 'drm-next-4.3' of git://people.freedesktop.org/~agd5f/linux: (21 commits) drm/amdgpu: set MEC doorbell range for Fiji drm/amdgpu: implement burst NOP for SDMA drm/amdgpu: add insert_nop ring func and default implementation drm/amdgpu: add amdgpu_get_sdma_instance helper function drm/amdgpu: add AMDGPU_MAX_SDMA_INSTANCES drm/amdgpu: add burst_nop flag for sdma drm/amdgpu: add count field for the SDMA NOP packet v2 drm/amdgpu: use PT for VM sync on unmap drm/amdgpu: make wait_event uninterruptible in push_job drm/amdgpu: fix amdgpu_bo_unreserve order in GEM_OP IOCTL v2 drm/amdgpu: partially revert "modify amdgpu_fence_wait_any() to amdgpu_fence_wait_multiple()" v2 Add radeon suspend/resume quirk for HP Compaq dc5750. drm/amdgpu: re-work sync_resv drm/amdgpu/atom: Send out the full AUX address drm/radeon/native: Send out the full AUX address drm/radeon/atom: Send out the full AUX address drm/amdgpu: use IB for fill_buffer instead of direct command drm/amdgpu: stop trying to suspend UVD sessions v2 drm/amdgpu: add scheduler dependency callback v2 drm/amdgpu: let the scheduler work more with jobs v2 ...
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 7d442c51063e..9bec91484c24 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -131,6 +131,21 @@ int amdgpu_ring_lock(struct amdgpu_ring *ring, unsigned ndw)
131 return 0; 131 return 0;
132} 132}
133 133
134/** amdgpu_ring_insert_nop - insert NOP packets
135 *
136 * @ring: amdgpu_ring structure holding ring information
137 * @count: the number of NOP packets to insert
138 *
139 * This is the generic insert_nop function for rings except SDMA
140 */
141void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
142{
143 int i;
144
145 for (i = 0; i < count; i++)
146 amdgpu_ring_write(ring, ring->nop);
147}
148
134/** 149/**
135 * amdgpu_ring_commit - tell the GPU to execute the new 150 * amdgpu_ring_commit - tell the GPU to execute the new
136 * commands on the ring buffer 151 * commands on the ring buffer
@@ -143,10 +158,13 @@ int amdgpu_ring_lock(struct amdgpu_ring *ring, unsigned ndw)
143 */ 158 */
144void amdgpu_ring_commit(struct amdgpu_ring *ring) 159void amdgpu_ring_commit(struct amdgpu_ring *ring)
145{ 160{
161 uint32_t count;
162
146 /* We pad to match fetch size */ 163 /* We pad to match fetch size */
147 while (ring->wptr & ring->align_mask) { 164 count = ring->align_mask + 1 - (ring->wptr & ring->align_mask);
148 amdgpu_ring_write(ring, ring->nop); 165 count %= ring->align_mask + 1;
149 } 166 ring->funcs->insert_nop(ring, count);
167
150 mb(); 168 mb();
151 amdgpu_ring_set_wptr(ring); 169 amdgpu_ring_set_wptr(ring);
152} 170}