Skip to content

Commit 39dd895

Browse files
YuBiao Wangalexdeucher
authored andcommitted
drm/amdgpu: Add nv mailbox irq in soc21
Under virtualization guest needs to receive notification from host to perform reset in some cases. Add nv mailbox irq in soc21. Signed-off-by: YuBiao Wang <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 82132ec commit 39dd895

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/gpu/drm/amd/amdgpu/soc21.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "soc15.h"
4444
#include "soc15_common.h"
4545
#include "soc21.h"
46+
#include "mxgpu_nv.h"
4647

4748
static const struct amd_ip_funcs soc21_common_ip_funcs;
4849

@@ -659,19 +660,31 @@ static int soc21_common_early_init(void *handle)
659660
return -EINVAL;
660661
}
661662

662-
if (amdgpu_sriov_vf(adev))
663+
if (amdgpu_sriov_vf(adev)) {
663664
amdgpu_virt_init_setting(adev);
665+
xgpu_nv_mailbox_set_irq_funcs(adev);
666+
}
664667

665668
return 0;
666669
}
667670

668671
static int soc21_common_late_init(void *handle)
669672
{
673+
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
674+
675+
if (amdgpu_sriov_vf(adev))
676+
xgpu_nv_mailbox_get_irq(adev);
677+
670678
return 0;
671679
}
672680

673681
static int soc21_common_sw_init(void *handle)
674682
{
683+
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
684+
685+
if (amdgpu_sriov_vf(adev))
686+
xgpu_nv_mailbox_add_irq_id(adev);
687+
675688
return 0;
676689
}
677690

@@ -709,6 +722,9 @@ static int soc21_common_hw_fini(void *handle)
709722
/* disable the doorbell aperture */
710723
soc21_enable_doorbell_aperture(adev, false);
711724

725+
if (amdgpu_sriov_vf(adev))
726+
xgpu_nv_mailbox_put_irq(adev);
727+
712728
return 0;
713729
}
714730

0 commit comments

Comments
 (0)