AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
Date: Thu, 16 May 2019 09:24:45 +0200	[thread overview]
Message-ID: <3b9d9e94-35f9-dd5c-ec27-19705a3f8172@gmail.com> (raw)
In-Reply-To: <1557983492-25237-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>

Am 16.05.19 um 07:11 schrieb Yintian Tao:
> PSP fw primary buffer is not used under SRIOV
> Therefore, we don't need to allocate memory for it.
>
> Signed-off-by: Yintian Tao <yttao@amd.com>
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 22 +++++++++++++---------
>   1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index c567a55..d3c77d2 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,
> @@ -1012,8 +1015,9 @@ static int psp_hw_fini(void *handle)
>   	psp_ring_destroy(psp, PSP_RING_TYPE__KM);
>   
>   	amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
> -	amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> -			      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
> +	if (!amdgpu_sriov_vf(psp->adev))
> +		amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> +				      &psp->fw_pri_mc_addr, &psp->fw_pri_buf);

This is superfluous, amdgpu_bo_free_kernel() does a NULL check anyway.

Apart from that looks good to me,
Christian.

>   	amdgpu_bo_free_kernel(&psp->fence_buf_bo,
>   			      &psp->fence_buf_mc_addr, &psp->fence_buf);
>   	amdgpu_bo_free_kernel(&psp->asd_shared_bo, &psp->asd_shared_mc_addr,

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

  parent reply	other threads:[~2019-05-16  7:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16  5:11 [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV Yintian Tao
     [not found] ` <1557983492-25237-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
2019-05-16  7:24   ` Christian König [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-16 11:53 Yintian Tao
     [not found] ` <1558007618-24482-1-git-send-email-yttao-5C7GfCeVMHo@public.gmane.org>
2019-05-17  2:41   ` Tao, Yintian
     [not found]     ` <MN2PR12MB3039EAC37D6BB17BD3582D77E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-05-17  6:53       ` Koenig, Christian
2019-05-17  7:17         ` 答复: " Tao, Yintian
     [not found]           ` <MN2PR12MB30390AB5467D6A7080AD45C6E50B0-rweVpJHSKTr/fpeVZQY9RQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-05-17 10:19             ` Liu, Monk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b9d9e94-35f9-dd5c-ec27-19705a3f8172@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Monk.Liu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=yttao-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox