AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "José Pekkarinen" <koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: "José Pekkarinen" <koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] Only detect virtualization capabilities on Fiji and Tonga.
Date: Tue, 26 Dec 2017 16:26:10 +0200	[thread overview]
Message-ID: <20171226142610.27402-1-koalinux@gmail.com> (raw)

Signed-off-by: José Pekkarinen <koalinux@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
index 045988b18bc3..1a043a50d22f 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c
@@ -245,16 +245,19 @@ void nbio_v6_1_detect_hw_virt(struct amdgpu_device *adev)
 {
 	uint32_t reg;
 
-	reg = RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER);
-	if (reg & 1)
-		adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
-
-	if (reg & 0x80000000)
-		adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
-
-	if (!reg) {
-		if (is_virtual_machine())	/* passthrough mode exclus sriov mod */
-			adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
+	if (adev->asic_type == CHIP_TONGA ||
+	    adev->asic_type == CHIP_FIJI) {
+		reg = RREG32_SOC15(NBIO, 0, mmRCC_PF_0_0_RCC_IOV_FUNC_IDENTIFIER);
+		if (reg & 1)
+			adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
+
+		if (reg & 0x80000000)
+			adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
+
+		if (!reg) {
+			if (is_virtual_machine())	/* passthrough mode exclus sriov mod */
+				adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
+		}
 	}
 }
 
-- 
2.13.6

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

             reply	other threads:[~2017-12-26 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-26 14:26 José Pekkarinen [this message]
     [not found] ` <20171226142610.27402-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-27  7:45   ` [PATCH] Only detect virtualization capabilities on Fiji and Tonga Alex Deucher
     [not found]     ` <CADnq5_NM+BLiKUhAoQ1a6Dx=fXGeYNHrPjXzp8Ao+UHCxv4GzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-27 14:28       ` José Ramón Muñoz Pekkarinen

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=20171226142610.27402-1-koalinux@gmail.com \
    --to=koalinux-re5jqeeqqe8avxtiumwx3w@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