aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorAndres Rodriguez <andresx7@gmail.com>2017-04-06 00:10:53 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-31 16:48:58 -0400
commit7b2124a5dd99b5b794943e26dbcc8ed62aed8d01 (patch)
treec3bb0de0e2caf21bf48526c59aa10345b674e25f /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parentde65513af1124b28f2a858bc19b71a54dd93824e (diff)
drm/amdgpu: avoid KIQ clashing with compute or KFD queues v2
Instead of picking an arbitrary queue for KIQ, search for one according to policy. The queue must be unused. Also report the KIQ as an unavailable resource to KFD. In testing I ran into KCQ initialization issues when using pipes 2/3 of MEC2 for the KIQ. Therefore the policy disallows grabbing one of these. v2: fix (ring.me + 1) to (ring.me -1) in amdgpu_amdkfd_device_init Reviewed-by: Felix Kuehling <Felix.Kuehling@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.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 30ba29adddd5..1135f19c9e9c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1803,8 +1803,8 @@ 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, 1806static inline int amdgpu_queue_to_bit(struct amdgpu_device *adev,
1807 int mec, int pipe, int queue) 1807 int mec, int pipe, int queue)
1808{ 1808{
1809 int bit = 0; 1809 int bit = 0;
1810 1810
@@ -1813,7 +1813,24 @@ static inline bool amdgpu_is_mec_queue_enabled(struct amdgpu_device *adev,
1813 bit += pipe * adev->gfx.mec.num_queue_per_pipe; 1813 bit += pipe * adev->gfx.mec.num_queue_per_pipe;
1814 bit += queue; 1814 bit += queue;
1815 1815
1816 return test_bit(bit, adev->gfx.mec.queue_bitmap); 1816 return bit;
1817}
1818
1819static inline void amdgpu_bit_to_queue(struct amdgpu_device *adev, int bit,
1820 int *mec, int *pipe, int *queue)
1821{
1822 *queue = bit % adev->gfx.mec.num_queue_per_pipe;
1823 *pipe = (bit / adev->gfx.mec.num_queue_per_pipe)
1824 % adev->gfx.mec.num_pipe_per_mec;
1825 *mec = (bit / adev->gfx.mec.num_queue_per_pipe)
1826 / adev->gfx.mec.num_pipe_per_mec;
1827
1828}
1829static inline bool amdgpu_is_mec_queue_enabled(struct amdgpu_device *adev,
1830 int mec, int pipe, int queue)
1831{
1832 return test_bit(amdgpu_queue_to_bit(adev, mec, pipe, queue),
1833 adev->gfx.mec.queue_bitmap);
1817} 1834}
1818 1835
1819/* 1836/*