From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Christian_K=c3=b6nig?= Subject: =?UTF-8?B?UmU6IOetlOWkjTogW1BBVENIXSBkcm0vYW1kZ3B1OiBza2lwIGZ3IHBy?= =?UTF-8?Q?i_bo_alloc_for_SRIOV?= Date: Fri, 17 May 2019 09:20:54 +0200 Message-ID: <0f307e3d-3f5f-3766-6db8-e51ab6c2562e@gmail.com> References: <1558007618-24482-1-git-send-email-yttao@amd.com> Reply-To: christian.koenig-5C7GfCeVMHo@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1388032840==" Return-path: In-Reply-To: Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Tao, Yintian" , "Koenig, Christian" Cc: "Liu, Monk" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" This is a multi-part message in MIME format. --===============1388032840== Content-Type: multipart/alternative; boundary="------------963F868BC249EFA50224614C" Content-Language: en-US This is a multi-part message in MIME format. --------------963F868BC249EFA50224614C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Yintian, please add this as a code comment to the patch. Christian. Am 17.05.19 um 09:17 schrieb Tao, Yintian: > > Hi  Christian > > > Many thanks for your review. > > > The background is that this bo is to let psp load sos and sysdrv but > under sriov, sos and sysdrv is loaded by VBIOS or hypervisor driver. > > > The reason why not let guest driver to load it under SRIOV is that it > is not safe. > > > > Best Regards > > Yintian Tao > > ------------------------------------------------------------------------ > *发件人:* Koenig, Christian > *发送时间:* 2019年5月17日 14:53:35 > *收件人:* Tao, Yintian > *抄送:* Liu, Monk; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > *主题:* Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV > Looks good to me now, but I don't know the technical background why this > BO is not needed under SRIOV. > > So this patch is Acked-by: Christian König . > > Regards, > Christian. > > Am 17.05.19 um 04:41 schrieb Tao, Yintian: > > Hi Christian > > > > > > I have modified it according to your suggestion. Can you help review > this again? Thanks in advance. > > > > > > Best Regards > > Yintian Tao > > > > -----Original Message----- > > From: Yintian Tao > > Sent: Thursday, May 16, 2019 7:54 PM > > To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > > Cc: Tao, Yintian ; Liu, Monk > > Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV > > > > PSP fw primary buffer is not used under SRIOV. > > Therefore, we don't need to allocate memory for it. > > > > v2: remove superfluous check for amdgpu_bo_free_kernel(). > > > > Signed-off-by: Yintian Tao > > Signed-off-by: Monk Liu > > --- > >   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++------- > >   1 file changed, 10 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > > index c567a55..af9835c 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c > > @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev) > >        if (!psp->cmd) > >                return -ENOMEM; > > > > -     ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG, > > - AMDGPU_GEM_DOMAIN_GTT, > > - &psp->fw_pri_bo, > > - &psp->fw_pri_mc_addr, > > - &psp->fw_pri_buf); > > -     if (ret) > > -             goto failed; > > +     /* this fw pri bo is not used under SRIOV */ > > +     if (!amdgpu_sriov_vf(psp->adev)) { > > +             ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG, > > + AMDGPU_GEM_DOMAIN_GTT, > > + &psp->fw_pri_bo, > > + &psp->fw_pri_mc_addr, > > + &psp->fw_pri_buf); > > +             if (ret) > > +                     goto failed; > > +     } > > > >        ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, > PAGE_SIZE, > > AMDGPU_GEM_DOMAIN_VRAM, > > > _______________________________________________ > amd-gfx mailing list > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx --------------963F868BC249EFA50224614C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
Hi Yintian,

please add this as a code comment to the patch.

Christian.

Am 17.05.19 um 09:17 schrieb Tao, Yintian:

Hi  Christian


Many thanks for your review.


The background is that this bo is to let psp load sos and sysdrv but under sriov, sos and sysdrv is loaded by VBIOS or hypervisor driver.


The reason why not let guest driver to load it under SRIOV is that it is not safe.



Best Regards

Yintian Tao


发件人: Koenig, Christian
发送时间: 2019年5月17日 14:53:35
收件人: Tao, Yintian
抄送: Liu, Monk; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
主题: Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
 
Looks good to me now, but I don't know the technical background why this
BO is not needed under SRIOV.

So this patch is Acked-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>.

Regards,
Christian.

Am 17.05.19 um 04:41 schrieb Tao, Yintian:
> Hi Christian
>
>
> I have modified it according to your suggestion. Can you help review this again? Thanks in advance.
>
>
> Best Regards
> Yintian Tao
>
> -----Original Message-----
> From: Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>
> Sent: Thursday, May 16, 2019 7:54 PM
> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Cc: Tao, Yintian <Yintian.Tao-5C7GfCeVMHo@public.gmane.org>; Liu, Monk <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
> Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
>
> PSP fw primary buffer is not used under SRIOV.
> Therefore, we don't need to allocate memory for it.
>
> v2: remove superfluous check for amdgpu_bo_free_kernel().
>
> Signed-off-by: Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>
> Signed-off-by: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 17 ++++++++++-------
>   1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..af9835c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -905,13 +905,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
>        if (!psp->cmd)
>                return -ENOMEM;
>  
> -     ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> -                                     AMDGPU_GEM_DOMAIN_GTT,
> -                                     &psp->fw_pri_bo,
> -                                     &psp->fw_pri_mc_addr,
> -                                     &psp->fw_pri_buf);
> -     if (ret)
> -             goto failed;
> +     /* this fw pri bo is not used under SRIOV */
> +     if (!amdgpu_sriov_vf(psp->adev)) {
> +             ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
> +                                           AMDGPU_GEM_DOMAIN_GTT,
> +                                           &psp->fw_pri_bo,
> +                                           &psp->fw_pri_mc_addr,
> +                                           &psp->fw_pri_buf);
> +             if (ret)
> +                     goto failed;
> +     }
>  
>        ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
>                                        AMDGPU_GEM_DOMAIN_VRAM,


_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

--------------963F868BC249EFA50224614C-- --===============1388032840== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4 --===============1388032840==--