aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorAndres Rodriguez <andresx7@gmail.com>2017-02-03 17:31:38 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-05-31 16:48:56 -0400
commite33fec4835b9d2b1f8f8b1eb7c3415ab75a0faf5 (patch)
treed143f7d1d1744394ebda980e045f36bdc566ad64 /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parent5e7095625d3ffd74165e5a6f46e894395caeabe8 (diff)
drm/amdgpu: allocate queues horizontally across pipes
Pipes provide better concurrency than queues, therefore we want to make sure that apps use queues from different pipes whenever possible. Optimize for the trivial case where an app will consume rings in order, therefore we don't want adjacent rings to belong to the same pipe. Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 4b8710b2f459..30ba29adddd5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1803,6 +1803,19 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
1803 return NULL; 1803 return NULL;
1804} 1804}
1805 1805
1806static inline bool amdgpu_is_mec_queue_enabled(struct amdgpu_device *adev,
1807 int mec, int pipe, int queue)
1808{
1809 int bit = 0;
1810
1811 bit += mec * adev->gfx.mec.num_pipe_per_mec
1812 * adev->gfx.mec.num_queue_per_pipe;
1813 bit += pipe * adev->gfx.mec.num_queue_per_pipe;
1814 bit += queue;
1815
1816 return test_bit(bit, adev->gfx.mec.queue_bitmap);
1817}
1818
1806/* 1819/*
1807 * ASICs macro. 1820 * ASICs macro.
1808 */ 1821 */