aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index 997932ebbb83..855eff834e2a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -199,6 +199,30 @@ void amdgpu_gfx_compute_queue_acquire(struct amdgpu_device *adev)
199 adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS; 199 adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS;
200} 200}
201 201
202void amdgpu_gfx_graphics_queue_acquire(struct amdgpu_device *adev)
203{
204 int i, queue, pipe, me;
205
206 for (i = 0; i < AMDGPU_MAX_GFX_QUEUES; ++i) {
207 queue = i % adev->gfx.me.num_queue_per_pipe;
208 pipe = (i / adev->gfx.me.num_queue_per_pipe)
209 % adev->gfx.me.num_pipe_per_me;
210 me = (i / adev->gfx.me.num_queue_per_pipe)
211 / adev->gfx.me.num_pipe_per_me;
212
213 if (me >= adev->gfx.me.num_me)
214 break;
215 /* policy: amdgpu owns the first queue per pipe at this stage
216 * will extend to mulitple queues per pipe later */
217 if (me == 0 && queue < 1)
218 set_bit(i, adev->gfx.me.queue_bitmap);
219 }
220
221 /* update the number of active graphics rings */
222 adev->gfx.num_gfx_rings =
223 bitmap_weight(adev->gfx.me.queue_bitmap, AMDGPU_MAX_GFX_QUEUES);
224}
225
202static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev, 226static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
203 struct amdgpu_ring *ring) 227 struct amdgpu_ring *ring)
204{ 228{