All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: For Navi12 SRIOV VF, register mailbox functions
@ 2019-09-11 10:25 jianzh-5C7GfCeVMHo
       [not found] ` <20190911102505.5480-1-jianzh-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: jianzh-5C7GfCeVMHo @ 2019-09-11 10:25 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Deng, Emily, Zhao, Jiange, Koenig, Christian, Nieto, David M

From: Jiange Zhao <Jiange.Zhao@amd.com>

Mailbox functions and interrupts are only for Navi12 VF.

Register functions and irqs during initialization.

Signed-off-by: Jiange Zhao <Jiange.Zhao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index a61f43c0c9df..4c24672be12a 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -53,6 +53,7 @@
 #include "vcn_v2_0.h"
 #include "dce_virtual.h"
 #include "mes_v10_1.h"
+#include "mxgpu_nv.h"
 
 static const struct amd_ip_funcs nv_common_ip_funcs;
 
@@ -426,6 +427,9 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
 
 	adev->nbio.funcs->detect_hw_virt(adev);
 
+	if (amdgpu_sriov_vf(adev))
+		adev->virt.ops = &xgpu_nv_virt_ops;
+
 	switch (adev->asic_type) {
 	case CHIP_NAVI10:
 	case CHIP_NAVI14:
@@ -666,16 +670,31 @@ static int nv_common_early_init(void *handle)
 		return -EINVAL;
 	}
 
+	if (amdgpu_sriov_vf(adev)) {
+		amdgpu_virt_init_setting(adev);
+		xgpu_nv_mailbox_set_irq_funcs(adev);
+	}
+
 	return 0;
 }
 
 static int nv_common_late_init(void *handle)
 {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	if (amdgpu_sriov_vf(adev))
+		xgpu_nv_mailbox_get_irq(adev);
+
 	return 0;
 }
 
 static int nv_common_sw_init(void *handle)
 {
+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+	if (amdgpu_sriov_vf(adev))
+		xgpu_nv_mailbox_add_irq_id(adev);
+
 	return 0;
 }
 
-- 
2.20.1

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

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

* RE: [PATCH] drm/amdgpu: For Navi12 SRIOV VF, register mailbox functions
       [not found] ` <20190911102505.5480-1-jianzh-5C7GfCeVMHo@public.gmane.org>
@ 2019-09-12  3:04   ` Deng, Emily
  0 siblings, 0 replies; 2+ messages in thread
From: Deng, Emily @ 2019-09-12  3:04 UTC (permalink / raw)
  To: Zhao, Jiange, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Koenig, Christian, Nieto, David M

Reviewed-by: Emily Deng <Emily.Deng@amd.com>

>-----Original Message-----
>From: Zhao, Jiange <Jiange.Zhao@amd.com>
>Sent: Wednesday, September 11, 2019 6:25 PM
>To: amd-gfx@lists.freedesktop.org
>Cc: Nieto, David M <David.Nieto@amd.com>; Deng, Emily
><Emily.Deng@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>;
>Zhao, Jiange <Jiange.Zhao@amd.com>
>Subject: [PATCH] drm/amdgpu: For Navi12 SRIOV VF, register mailbox
>functions
>
>From: Jiange Zhao <Jiange.Zhao@amd.com>
>
>Mailbox functions and interrupts are only for Navi12 VF.
>
>Register functions and irqs during initialization.
>
>Signed-off-by: Jiange Zhao <Jiange.Zhao@amd.com>
>---
> drivers/gpu/drm/amd/amdgpu/nv.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
>diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c
>b/drivers/gpu/drm/amd/amdgpu/nv.c index a61f43c0c9df..4c24672be12a
>100644
>--- a/drivers/gpu/drm/amd/amdgpu/nv.c
>+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
>@@ -53,6 +53,7 @@
> #include "vcn_v2_0.h"
> #include "dce_virtual.h"
> #include "mes_v10_1.h"
>+#include "mxgpu_nv.h"
>
> static const struct amd_ip_funcs nv_common_ip_funcs;
>
>@@ -426,6 +427,9 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)
>
> 	adev->nbio.funcs->detect_hw_virt(adev);
>
>+	if (amdgpu_sriov_vf(adev))
>+		adev->virt.ops = &xgpu_nv_virt_ops;
>+
> 	switch (adev->asic_type) {
> 	case CHIP_NAVI10:
> 	case CHIP_NAVI14:
>@@ -666,16 +670,31 @@ static int nv_common_early_init(void *handle)
> 		return -EINVAL;
> 	}
>
>+	if (amdgpu_sriov_vf(adev)) {
>+		amdgpu_virt_init_setting(adev);
>+		xgpu_nv_mailbox_set_irq_funcs(adev);
>+	}
>+
> 	return 0;
> }
>
> static int nv_common_late_init(void *handle)  {
>+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>+
>+	if (amdgpu_sriov_vf(adev))
>+		xgpu_nv_mailbox_get_irq(adev);
>+
> 	return 0;
> }
>
> static int nv_common_sw_init(void *handle)  {
>+	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>+
>+	if (amdgpu_sriov_vf(adev))
>+		xgpu_nv_mailbox_add_irq_id(adev);
>+
> 	return 0;
> }
>
>--
>2.20.1

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

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

end of thread, other threads:[~2019-09-12  3:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 10:25 [PATCH] drm/amdgpu: For Navi12 SRIOV VF, register mailbox functions jianzh-5C7GfCeVMHo
     [not found] ` <20190911102505.5480-1-jianzh-5C7GfCeVMHo@public.gmane.org>
2019-09-12  3:04   ` Deng, Emily

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.