aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-06-07 12:59:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-06-07 18:02:06 -0400
commit2db0cdbe2879f424e28f69755a16344348247d44 (patch)
tree71773c2285989ccfbf9824ee7573bb8abf13fcbe /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parentee04fac3b7cc5093653ba87bfdc241d321f4a3da (diff)
drm/amdgpu: move mec queue helpers to amdgpu_gfx.h
They are gfx related, not general helpers. Reviewed-by: Alex Xie <AlexBin.Xie@amd.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.h30
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index ef34ff214083..3308e6200690 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1831,36 +1831,6 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
1831 return NULL; 1831 return NULL;
1832} 1832}
1833 1833
1834static inline int amdgpu_queue_to_bit(struct amdgpu_device *adev,
1835 int mec, int pipe, int queue)
1836{
1837 int bit = 0;
1838
1839 bit += mec * adev->gfx.mec.num_pipe_per_mec
1840 * adev->gfx.mec.num_queue_per_pipe;
1841 bit += pipe * adev->gfx.mec.num_queue_per_pipe;
1842 bit += queue;
1843
1844 return bit;
1845}
1846
1847static inline void amdgpu_bit_to_queue(struct amdgpu_device *adev, int bit,
1848 int *mec, int *pipe, int *queue)
1849{
1850 *queue = bit % adev->gfx.mec.num_queue_per_pipe;
1851 *pipe = (bit / adev->gfx.mec.num_queue_per_pipe)
1852 % adev->gfx.mec.num_pipe_per_mec;
1853 *mec = (bit / adev->gfx.mec.num_queue_per_pipe)
1854 / adev->gfx.mec.num_pipe_per_mec;
1855
1856}
1857static inline bool amdgpu_is_mec_queue_enabled(struct amdgpu_device *adev,
1858 int mec, int pipe, int queue)
1859{
1860 return test_bit(amdgpu_queue_to_bit(adev, mec, pipe, queue),
1861 adev->gfx.mec.queue_bitmap);
1862}
1863
1864/* 1834/*
1865 * ASICs macro. 1835 * ASICs macro.
1866 */ 1836 */