Plumb in support for disabling kernel queues and make it
the default.  For testing, kernel queues can be re-enabled
by setting amdgpu.user_queue=0.  Kernel queues are still
created for use by the kernel driver for memory management,
etc., just not user submissions.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c 
b/drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c
index f20e0fc3fc743..061934a2e93a3 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v7_1.c
@@ -1268,6 +1268,18 @@ static int sdma_v7_1_early_init(struct amdgpu_ip_block 
*ip_block)
        struct amdgpu_device *adev = ip_block->adev;
        int r;
 
+       switch (amdgpu_user_queue) {
+       case -1:
+       default:
+               adev->sdma.no_user_submission = true;
+               adev->sdma.disable_uq = true;
+               break;
+       case 0:
+               adev->sdma.no_user_submission = false;
+               adev->sdma.disable_uq = true;
+               break;
+       }
+
        r = amdgpu_sdma_init_microcode(adev, 0, true);
        if (r) {
                DRM_ERROR("Failed to init sdma firmware!\n");
-- 
2.53.0

Reply via email to