drm/amdgpu/mes: make more vmids available when disable_kq=1
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Feb 2025 17:51:30 +0000 (12:51 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Apr 2025 20:48:22 +0000 (16:48 -0400)
If we don't have kernel queues, the vmids can be used by
the MES for user queues.

Acked-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Sunil Khatri <sunil.khatri@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c

index 4127e11924d8d42ce675d38721d21a6d09e4acfa..36f2e871612645c6a751b442352ef4c201ff6c15 100644 (file)
@@ -106,7 +106,7 @@ int amdgpu_mes_init(struct amdgpu_device *adev)
 
        adev->mes.total_max_queue = AMDGPU_FENCE_MES_QUEUE_ID_MASK;
        adev->mes.vmid_mask_mmhub = 0xffffff00;
-       adev->mes.vmid_mask_gfxhub = 0xffffff00;
+       adev->mes.vmid_mask_gfxhub = adev->gfx.disable_kq ? 0xfffffffe : 0xffffff00;
 
        num_pipes = adev->gfx.me.num_pipe_per_me * adev->gfx.me.num_me;
        if (num_pipes > AMDGPU_MES_MAX_GFX_PIPES)
index 8ae4c031162bcd9ab310cba77e501a21bf94c032..b6ac4c7adc8a65922c80c90f03d8007d8d2be7e7 100644 (file)
@@ -896,7 +896,7 @@ static int gmc_v10_0_sw_init(struct amdgpu_ip_block *ip_block)
         * amdgpu graphics/compute will use VMIDs 1-7
         * amdkfd will use VMIDs 8-15
         */
-       adev->vm_manager.first_kfd_vmid = 8;
+       adev->vm_manager.first_kfd_vmid = adev->gfx.disable_kq ? 1 : 8;
 
        amdgpu_vm_manager_init(adev);
 
index 6e15cff6d5480dd5a43dbaa5969effacbe241c73..d544419e3b44a0795871d0f6a789614e7bef4425 100644 (file)
@@ -816,7 +816,7 @@ static int gmc_v12_0_sw_init(struct amdgpu_ip_block *ip_block)
         * amdgpu graphics/compute will use VMIDs 1-7
         * amdkfd will use VMIDs 8-15
         */
-       adev->vm_manager.first_kfd_vmid = 8;
+       adev->vm_manager.first_kfd_vmid = adev->gfx.disable_kq ? 1 : 8;
 
        amdgpu_vm_manager_init(adev);