diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-04-17 16:14:09 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-24 17:40:15 -0400 |
commit | f1f7b443788c5e81a7a2ee8079e3d5b9f24ef003 (patch) | |
tree | 1c06f3dd70058e48ae1f64287145af5234834b96 /drivers/gpu/drm/amd/amdgpu | |
parent | 495a746354a056ecb8c13f3baff305d0c50864ec (diff) |
drm/amdgpu/gfx9: use new KIQ packet defines
Rather than magic numbers.
Reviewed-by: monk liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 70e9a2318e2b..c95886d2f163 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -1838,7 +1838,8 @@ static void gfx_v9_0_kiq_enable(struct amdgpu_ring *ring) | |||
1838 | amdgpu_ring_alloc(ring, 8); | 1838 | amdgpu_ring_alloc(ring, 8); |
1839 | /* set resources */ | 1839 | /* set resources */ |
1840 | amdgpu_ring_write(ring, PACKET3(PACKET3_SET_RESOURCES, 6)); | 1840 | amdgpu_ring_write(ring, PACKET3(PACKET3_SET_RESOURCES, 6)); |
1841 | amdgpu_ring_write(ring, 0); /* vmid_mask:0 queue_type:0 (KIQ) */ | 1841 | amdgpu_ring_write(ring, PACKET3_SET_RESOURCES_VMID_MASK(0) | |
1842 | PACKET3_SET_RESOURCES_QUEUE_TYPE(0)); /* vmid_mask:0 queue_type:0 (KIQ) */ | ||
1842 | amdgpu_ring_write(ring, 0x000000FF); /* queue mask lo */ | 1843 | amdgpu_ring_write(ring, 0x000000FF); /* queue mask lo */ |
1843 | amdgpu_ring_write(ring, 0); /* queue mask hi */ | 1844 | amdgpu_ring_write(ring, 0); /* queue mask hi */ |
1844 | amdgpu_ring_write(ring, 0); /* gws mask lo */ | 1845 | amdgpu_ring_write(ring, 0); /* gws mask lo */ |
@@ -1862,16 +1863,16 @@ static void gfx_v9_0_map_queue_enable(struct amdgpu_ring *kiq_ring, | |||
1862 | amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_MAP_QUEUES, 5)); | 1863 | amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_MAP_QUEUES, 5)); |
1863 | /* Q_sel:0, vmid:0, vidmem: 1, engine:0, num_Q:1*/ | 1864 | /* Q_sel:0, vmid:0, vidmem: 1, engine:0, num_Q:1*/ |
1864 | amdgpu_ring_write(kiq_ring, /* Q_sel: 0, vmid: 0, engine: 0, num_Q: 1 */ | 1865 | amdgpu_ring_write(kiq_ring, /* Q_sel: 0, vmid: 0, engine: 0, num_Q: 1 */ |
1865 | (0 << 4) | /* Queue_Sel */ | 1866 | PACKET3_MAP_QUEUES_QUEUE_SEL(0) | /* Queue_Sel */ |
1866 | (0 << 8) | /* VMID */ | 1867 | PACKET3_MAP_QUEUES_VMID(0) | /* VMID */ |
1867 | (ring->queue << 13 ) | | 1868 | PACKET3_MAP_QUEUES_QUEUE(ring->queue) | |
1868 | (ring->pipe << 16) | | 1869 | PACKET3_MAP_QUEUES_PIPE(ring->pipe) | |
1869 | ((ring->me == 1 ? 0 : 1) << 18) | | 1870 | PACKET3_MAP_QUEUES_ME((ring->me == 1 ? 0 : 1)) | |
1870 | (0 << 21) | /*queue_type: normal compute queue */ | 1871 | PACKET3_MAP_QUEUES_QUEUE_TYPE(0) | /*queue_type: normal compute queue */ |
1871 | (1 << 24) | /* alloc format: all_on_one_pipe */ | 1872 | PACKET3_MAP_QUEUES_ALLOC_FORMAT(1) | /* alloc format: all_on_one_pipe */ |
1872 | (0 << 26) | /* engine_sel: compute */ | 1873 | PACKET3_MAP_QUEUES_ENGINE_SEL(0) | /* engine_sel: compute */ |
1873 | (1 << 29)); /* num_queues: must be 1 */ | 1874 | PACKET3_MAP_QUEUES_NUM_QUEUES(1)); /* num_queues: must be 1 */ |
1874 | amdgpu_ring_write(kiq_ring, (ring->doorbell_index << 2)); | 1875 | amdgpu_ring_write(kiq_ring, PACKET3_MAP_QUEUES_DOORBELL_OFFSET(ring->doorbell_index)); |
1875 | amdgpu_ring_write(kiq_ring, lower_32_bits(mqd_addr)); | 1876 | amdgpu_ring_write(kiq_ring, lower_32_bits(mqd_addr)); |
1876 | amdgpu_ring_write(kiq_ring, upper_32_bits(mqd_addr)); | 1877 | amdgpu_ring_write(kiq_ring, upper_32_bits(mqd_addr)); |
1877 | amdgpu_ring_write(kiq_ring, lower_32_bits(wptr_addr)); | 1878 | amdgpu_ring_write(kiq_ring, lower_32_bits(wptr_addr)); |