On Wed, Mar 19, 2025 at 5:03 AM Liang, Prike <Prike.Liang@xxxxxxx> wrote: > > [Public] > > > From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Alex > > Deucher > > Sent: Thursday, March 13, 2025 10:42 PM > > To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx > > Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Khatri, Sunil > > <Sunil.Khatri@xxxxxxx> > > Subject: [PATCH 06/11] drm/amdgpu/mes: make more vmids available when > > disable_kq=1 > > > > If we don't have kernel queues, the vmids can be used by the MES for user > > queues. > > > > Reviewed-by: Sunil Khatri <sunil.khatri@xxxxxxx> > > Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 +- > > drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 2 +- > > drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 2 +- > > 3 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > > index 971bf01fe46a9..a536a78342a09 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c > > @@ -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; > > > Question: Why here only set some of the GCHUB VMID to validate? Is that VMID reserved for other specific usage? While it seems vmid_mask_mmhub is not further used in the MES FW? None of the engines managed by MES use mmhub. GFX, compute, and SDMA are all gchub clients. I suppose we could actually set the mmhub mask to 0. Driver manages mmhub for VCN, VPE, etc. When we eventually enable the umsched for VCN, VPE user queues, those will all be mmhub clients. Alex > > Anway this patch is: Acked-by: Prike Liang <Prike.Liang@xxxxxxx> > > > > for (i = 0; i < AMDGPU_MES_MAX_GFX_PIPES; i++) { > > /* use only 1st ME pipe */ > > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > index 95d894a231fcf..19a5f196829f3 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c > > @@ -900,7 +900,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); > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c > > b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c > > index bf8d01da88154..a2f6c9f4ebf2f 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c > > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c > > @@ -838,7 +838,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); > > > > -- > > 2.48.1 >