AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Monk Liu <Monk.Liu-5C7GfCeVMHo@public.gmane.org>,
	Yintian Tao <yttao-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH] drm/amdgpu: skip fw pri bo alloc for SRIOV
Date: Thu, 16 May 2019 19:53:38 +0800	[thread overview]
Message-ID: <1558007618-24482-1-git-send-email-yttao@amd.com> (raw)

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@amd.com>
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 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,
-- 
2.7.4

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

             reply	other threads:[~2019-05-16 11:53 UTC|newest]

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

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=1558007618-24482-1-git-send-email-yttao@amd.com \
    --to=yttao-5c7gfcevmho@public.gmane.org \
    --cc=Monk.Liu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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