On 10/12/26 11:24, Sunil Khatri wrote:
> The RLC bring-up paths programmed the RLC_SPM_VMID field to a hardcoded
> 0xf as the idle default. Now that the dedicated SPM VMID is tracked in
> vm_manager.spm_vmid, use it directly so the idle default matches the
> VMID the reservation path hands out.
> 
> No functional change: spm_vmid is the top VMID (0xf) on all affected
> generations (gfx7 through gfx12).
> 
> Signed-off-by: Sunil Khatri <[email protected]>

Reviewed-by: Christian König <[email protected]>

> ---
>  drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c  | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c  | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c   | 2 +-
>  drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +-
>  8 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> index e791bf86ad571..fce651d9bc613 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
> @@ -5575,7 +5575,7 @@ static int gfx_v10_0_rlc_resume(struct amdgpu_device 
> *adev)
>  
>               gfx_v10_0_init_csb(adev);
>  
> -             gfx_v10_0_update_spm_vmid_internal(adev, 0xf);
> +             gfx_v10_0_update_spm_vmid_internal(adev, 
> adev->vm_manager.spm_vmid);
>  
>               if (!amdgpu_sriov_vf(adev)) /* enable RLC SRM */
>                       gfx_v10_0_rlc_enable_srm(adev);
> @@ -5607,7 +5607,7 @@ static int gfx_v10_0_rlc_resume(struct amdgpu_device 
> *adev)
>  
>               gfx_v10_0_init_csb(adev);
>  
> -             gfx_v10_0_update_spm_vmid_internal(adev, 0xf);
> +             gfx_v10_0_update_spm_vmid_internal(adev, 
> adev->vm_manager.spm_vmid);
>  
>               adev->gfx.rlc.funcs->start(adev);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> index 1caecf26c4589..1f2ad47adb9fe 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
> @@ -944,7 +944,7 @@ static int gfx_v11_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
> index a5151e15e1011..72ceb113689e8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
> @@ -773,7 +773,7 @@ static int gfx_v12_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> index 4ceb3c0aa3322..b44f5ec68714d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_1.c
> @@ -1861,7 +1861,7 @@ static int gfx_v12_1_xcc_rlc_resume(struct 
> amdgpu_device *adev,
>       int r;
>  
>       /* init spm vmid with 0xf */
> -     gfx_v12_1_update_spm_vmid(adev, xcc_id, NULL, 0xf);
> +     gfx_v12_1_update_spm_vmid(adev, xcc_id, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
>               gfx_v12_1_xcc_init_csb(adev, xcc_id);
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> index 2eaea0e4864dd..91ce21425126f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> @@ -3252,7 +3252,7 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 696558f6f30d3..479480e39fe47 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -1274,7 +1274,7 @@ static int gfx_v8_0_rlc_init(struct amdgpu_device *adev)
>  
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  AMDGPU_MMHUB0_START
>       return 0;
>  }
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> index 3fb51417ebee5..8afcdb54a0f56 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> @@ -3233,7 +3233,7 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device 
> *adev)
>               break;
>       }
>  
> -     gfx_v9_0_update_spm_vmid_internal(adev, 0xf);
> +     gfx_v9_0_update_spm_vmid_internal(adev, adev->vm_manager.spm_vmid);
>  
>       adev->gfx.rlc.funcs->start(adev);
>  
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c 
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> index 3572eb9b5758a..1d1973fd8f677 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
> @@ -1395,7 +1395,7 @@ static int gfx_v9_4_3_rlc_init(struct amdgpu_device 
> *adev)
>  {
>       /* init spm vmid with 0xf */
>       if (adev->gfx.rlc.funcs->update_spm_vmid)
> -             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 0xf);
> +             adev->gfx.rlc.funcs->update_spm_vmid(adev, 0, NULL, 
> adev->vm_manager.spm_vmid);
>  
>       return 0;
>  }

Reply via email to