aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2017-06-07 10:46:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-06-07 15:43:11 -0400
commitcf8b611f55a775cc6514485e7dccf1c0e85b938d (patch)
tree1fceba68cad17d8d869461a4b1da6452f4134b2d
parent378506a7e600a025131df947a15f9bc23b522690 (diff)
drm/amdgpu: fix mec queue policy on single MEC asics
Fixes hangs on single MEC asics. Fixes: 2ed286fb434 (drm/amdgpu: new queue policy, take first 2 queues of each pipe v2) Reviewed-by: Alex Xie <AlexBin.Xie@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c12
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c12
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c12
3 files changed, 27 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index 4c04e9dec28b..862bc724de42 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -2825,9 +2825,15 @@ static void gfx_v7_0_compute_queue_acquire(struct amdgpu_device *adev)
2825 if (mec >= adev->gfx.mec.num_mec) 2825 if (mec >= adev->gfx.mec.num_mec)
2826 break; 2826 break;
2827 2827
2828 /* policy: amdgpu owns the first two queues of the first MEC */ 2828 if (adev->gfx.mec.num_mec > 1) {
2829 if (mec == 0 && queue < 2) 2829 /* policy: amdgpu owns the first two queues of the first MEC */
2830 set_bit(i, adev->gfx.mec.queue_bitmap); 2830 if (mec == 0 && queue < 2)
2831 set_bit(i, adev->gfx.mec.queue_bitmap);
2832 } else {
2833 /* policy: amdgpu owns all queues in the first pipe */
2834 if (mec == 0 && pipe == 0)
2835 set_bit(i, adev->gfx.mec.queue_bitmap);
2836 }
2831 } 2837 }
2832 2838
2833 /* update the number of active compute rings */ 2839 /* update the number of active compute rings */
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index ad2e0bba5c93..1370b3980791 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -1464,9 +1464,15 @@ static void gfx_v8_0_compute_queue_acquire(struct amdgpu_device *adev)
1464 if (mec >= adev->gfx.mec.num_mec) 1464 if (mec >= adev->gfx.mec.num_mec)
1465 break; 1465 break;
1466 1466
1467 /* policy: amdgpu owns the first two queues of the first MEC */ 1467 if (adev->gfx.mec.num_mec > 1) {
1468 if (mec == 0 && queue < 2) 1468 /* policy: amdgpu owns the first two queues of the first MEC */
1469 set_bit(i, adev->gfx.mec.queue_bitmap); 1469 if (mec == 0 && queue < 2)
1470 set_bit(i, adev->gfx.mec.queue_bitmap);
1471 } else {
1472 /* policy: amdgpu owns all queues in the first pipe */
1473 if (mec == 0 && pipe == 0)
1474 set_bit(i, adev->gfx.mec.queue_bitmap);
1475 }
1470 } 1476 }
1471 1477
1472 /* update the number of active compute rings */ 1478 /* update the number of active compute rings */
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index cf15a350d9bf..9d675b37883d 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -873,9 +873,15 @@ static void gfx_v9_0_compute_queue_acquire(struct amdgpu_device *adev)
873 if (mec >= adev->gfx.mec.num_mec) 873 if (mec >= adev->gfx.mec.num_mec)
874 break; 874 break;
875 875
876 /* policy: amdgpu owns the first two queues of the first MEC */ 876 if (adev->gfx.mec.num_mec > 1) {
877 if (mec == 0 && queue < 2) 877 /* policy: amdgpu owns the first two queues of the first MEC */
878 set_bit(i, adev->gfx.mec.queue_bitmap); 878 if (mec == 0 && queue < 2)
879 set_bit(i, adev->gfx.mec.queue_bitmap);
880 } else {
881 /* policy: amdgpu owns all queues in the first pipe */
882 if (mec == 0 && pipe == 0)
883 set_bit(i, adev->gfx.mec.queue_bitmap);
884 }
879 } 885 }
880 886
881 /* update the number of active compute rings */ 887 /* update the number of active compute rings */