All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Look for bios sriov capabilities only if we are on Fiji or Tonga.
@ 2017-12-25 20:49 José Pekkarinen
       [not found] ` <20171225204947.9950-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: José Pekkarinen @ 2017-12-25 20:49 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: José Pekkarinen

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index e630d918fefc..7958597028e3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1933,12 +1933,15 @@ static int amdgpu_resume(struct amdgpu_device *adev)
 
 static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
 {
-	if (adev->is_atom_fw) {
-		if (amdgpu_atomfirmware_gpu_supports_virtualization(adev))
-			adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
-	} else {
-		if (amdgpu_atombios_has_gpu_virtualization_table(adev))
-			adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
+	if (adev->asic_type == CHIP_TONGA ||
+	    adev->asic_type == CHIP_FIJI) {
+		if (adev->is_atom_fw) {
+			if (amdgpu_atomfirmware_gpu_supports_virtualization(adev))
+				adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
+		} else {
+			if (amdgpu_atombios_has_gpu_virtualization_table(adev))
+				adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
+		}
 	}
 }
 
-- 
2.13.6

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Look for bios sriov capabilities only if we are on Fiji or Tonga.
       [not found] ` <20171225204947.9950-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-12-27  7:49   ` Alex Deucher
       [not found]     ` <CADnq5_Mewg2SUFMqi0L0t7FOsD1RfKZERcK08KnybbcG=riadg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Deucher @ 2017-12-27  7:49 UTC (permalink / raw)
  To: José Pekkarinen; +Cc: amd-gfx list

On Mon, Dec 25, 2017 at 3:49 PM, José Pekkarinen <koalinux@gmail.com> wrote:
> Signed-off-by: José Pekkarinen <koalinux@gmail.com>

NACK.  This will break vega10.  The virtualization table only exists
on sr-iov capable cards so the checks are safe on all asics.

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index e630d918fefc..7958597028e3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1933,12 +1933,15 @@ static int amdgpu_resume(struct amdgpu_device *adev)
>
>  static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
>  {
> -       if (adev->is_atom_fw) {
> -               if (amdgpu_atomfirmware_gpu_supports_virtualization(adev))
> -                       adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
> -       } else {
> -               if (amdgpu_atombios_has_gpu_virtualization_table(adev))
> -                       adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
> +       if (adev->asic_type == CHIP_TONGA ||
> +           adev->asic_type == CHIP_FIJI) {
> +               if (adev->is_atom_fw) {
> +                       if (amdgpu_atomfirmware_gpu_supports_virtualization(adev))
> +                               adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
> +               } else {
> +                       if (amdgpu_atombios_has_gpu_virtualization_table(adev))
> +                               adev->virt.caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
> +               }
>         }
>  }
>
> --
> 2.13.6
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Look for bios sriov capabilities only if we are on Fiji or Tonga.
       [not found]     ` <CADnq5_Mewg2SUFMqi0L0t7FOsD1RfKZERcK08KnybbcG=riadg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-12-27 14:48       ` José Ramón Muñoz Pekkarinen
  0 siblings, 0 replies; 3+ messages in thread
From: José Ramón Muñoz Pekkarinen @ 2017-12-27 14:48 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx list

On Wednesday, 27 December 2017 09:49:40 EET Alex Deucher wrote:
> On Mon, Dec 25, 2017 at 3:49 PM, José Pekkarinen <koalinux@gmail.com> wrote:
> > Signed-off-by: José Pekkarinen <koalinux@gmail.com>
> 
> NACK.  This will break vega10.  The virtualization table only exists
> on sr-iov capable cards so the checks are safe on all asics.
> 
> Alex

	Yes, true, for some time I wrongly believed it activates 
AMDGPU_SRIOV_CAPS_IS_VF and allows getting into amdgpu_sriov_vf checks. 
Hopefully not the case.

	Thanks again!

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-27 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-25 20:49 [PATCH] Look for bios sriov capabilities only if we are on Fiji or Tonga José Pekkarinen
     [not found] ` <20171225204947.9950-1-koalinux-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-27  7:49   ` Alex Deucher
     [not found]     ` <CADnq5_Mewg2SUFMqi0L0t7FOsD1RfKZERcK08KnybbcG=riadg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-27 14:48       ` José Ramón Muñoz Pekkarinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.