aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
diff options
context:
space:
mode:
authorAndres Rodriguez <andresx7@gmail.com>2017-04-04 17:18:28 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-05-31 16:48:57 -0400
commitde65513af1124b28f2a858bc19b71a54dd93824e (patch)
tree1ae7ec152cfeb244704fe5bbc434a1b6822cbf16 /drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
parente33fec4835b9d2b1f8f8b1eb7c3415ab75a0faf5 (diff)
drm/amdgpu: remove hardcoded queue_mask in PACKET3_SET_RESOURCES
The assumption that we are only using the first pipe no longer holds. Instead, calculate the queue_mask from the queue_bitmap. Acked-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/gfx_v9_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index db1d50e45985..155a13911023 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2608,8 +2608,24 @@ static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev)
2608{ 2608{
2609 struct amdgpu_ring *kiq_ring = &adev->gfx.kiq.ring; 2609 struct amdgpu_ring *kiq_ring = &adev->gfx.kiq.ring;
2610 uint32_t scratch, tmp = 0; 2610 uint32_t scratch, tmp = 0;
2611 uint64_t queue_mask = 0;
2611 int r, i; 2612 int r, i;
2612 2613
2614 for (i = 0; i < AMDGPU_MAX_COMPUTE_QUEUES; ++i) {
2615 if (!test_bit(i, adev->gfx.mec.queue_bitmap))
2616 continue;
2617
2618 /* This situation may be hit in the future if a new HW
2619 * generation exposes more than 64 queues. If so, the
2620 * definition of queue_mask needs updating */
2621 if (WARN_ON(i > (sizeof(queue_mask)*8))) {
2622 DRM_ERROR("Invalid KCQ enabled: %d\n", i);
2623 break;
2624 }
2625
2626 queue_mask |= (1ull << i);
2627 }
2628
2613 r = amdgpu_gfx_scratch_get(adev, &scratch); 2629 r = amdgpu_gfx_scratch_get(adev, &scratch);
2614 if (r) { 2630 if (r) {
2615 DRM_ERROR("Failed to get scratch reg (%d).\n", r); 2631 DRM_ERROR("Failed to get scratch reg (%d).\n", r);
@@ -2628,8 +2644,8 @@ static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev)
2628 amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_SET_RESOURCES, 6)); 2644 amdgpu_ring_write(kiq_ring, PACKET3(PACKET3_SET_RESOURCES, 6));
2629 amdgpu_ring_write(kiq_ring, PACKET3_SET_RESOURCES_VMID_MASK(0) | 2645 amdgpu_ring_write(kiq_ring, PACKET3_SET_RESOURCES_VMID_MASK(0) |
2630 PACKET3_SET_RESOURCES_QUEUE_TYPE(0)); /* vmid_mask:0 queue_type:0 (KIQ) */ 2646 PACKET3_SET_RESOURCES_QUEUE_TYPE(0)); /* vmid_mask:0 queue_type:0 (KIQ) */
2631 amdgpu_ring_write(kiq_ring, 0x000000FF); /* queue mask lo */ 2647 amdgpu_ring_write(kiq_ring, lower_32_bits(queue_mask)); /* queue mask lo */
2632 amdgpu_ring_write(kiq_ring, 0); /* queue mask hi */ 2648 amdgpu_ring_write(kiq_ring, upper_32_bits(queue_mask)); /* queue mask hi */
2633 amdgpu_ring_write(kiq_ring, 0); /* gws mask lo */ 2649 amdgpu_ring_write(kiq_ring, 0); /* gws mask lo */
2634 amdgpu_ring_write(kiq_ring, 0); /* gws mask hi */ 2650 amdgpu_ring_write(kiq_ring, 0); /* gws mask hi */
2635 amdgpu_ring_write(kiq_ring, 0); /* oac mask */ 2651 amdgpu_ring_write(kiq_ring, 0); /* oac mask */