diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-04-05 01:04:50 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-04-06 13:28:07 -0400 |
commit | 81758c55956d91feae2f11e3dbf20b5ce45c6f23 (patch) | |
tree | e80fd05f0a5ded999219bedd837704e775ba56ec /drivers/gpu/drm/amd/amdgpu | |
parent | 8758cb6a96aec6a2474c1827d38f094264ac034b (diff) |
drm/amdgpu:invoke new implemented AI MB func
Implement the sr-iov mailbox for soc15 asics.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/soc15.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 02ba1cf557ad..385de8617075 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c | |||
@@ -563,6 +563,7 @@ static int soc15_common_early_init(void *handle) | |||
563 | 563 | ||
564 | if (amdgpu_sriov_vf(adev)) { | 564 | if (amdgpu_sriov_vf(adev)) { |
565 | amdgpu_virt_init_setting(adev); | 565 | amdgpu_virt_init_setting(adev); |
566 | xgpu_ai_mailbox_set_irq_funcs(adev); | ||
566 | } | 567 | } |
567 | 568 | ||
568 | /* | 569 | /* |
@@ -615,8 +616,23 @@ static int soc15_common_early_init(void *handle) | |||
615 | return 0; | 616 | return 0; |
616 | } | 617 | } |
617 | 618 | ||
619 | static int soc15_common_late_init(void *handle) | ||
620 | { | ||
621 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | ||
622 | |||
623 | if (amdgpu_sriov_vf(adev)) | ||
624 | xgpu_ai_mailbox_get_irq(adev); | ||
625 | |||
626 | return 0; | ||
627 | } | ||
628 | |||
618 | static int soc15_common_sw_init(void *handle) | 629 | static int soc15_common_sw_init(void *handle) |
619 | { | 630 | { |
631 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | ||
632 | |||
633 | if (amdgpu_sriov_vf(adev)) | ||
634 | xgpu_ai_mailbox_add_irq_id(adev); | ||
635 | |||
620 | return 0; | 636 | return 0; |
621 | } | 637 | } |
622 | 638 | ||
@@ -647,6 +663,8 @@ static int soc15_common_hw_fini(void *handle) | |||
647 | 663 | ||
648 | /* disable the doorbell aperture */ | 664 | /* disable the doorbell aperture */ |
649 | soc15_enable_doorbell_aperture(adev, false); | 665 | soc15_enable_doorbell_aperture(adev, false); |
666 | if (amdgpu_sriov_vf(adev)) | ||
667 | xgpu_ai_mailbox_put_irq(adev); | ||
650 | 668 | ||
651 | return 0; | 669 | return 0; |
652 | } | 670 | } |
@@ -860,7 +878,7 @@ static int soc15_common_set_powergating_state(void *handle, | |||
860 | const struct amd_ip_funcs soc15_common_ip_funcs = { | 878 | const struct amd_ip_funcs soc15_common_ip_funcs = { |
861 | .name = "soc15_common", | 879 | .name = "soc15_common", |
862 | .early_init = soc15_common_early_init, | 880 | .early_init = soc15_common_early_init, |
863 | .late_init = NULL, | 881 | .late_init = soc15_common_late_init, |
864 | .sw_init = soc15_common_sw_init, | 882 | .sw_init = soc15_common_sw_init, |
865 | .sw_fini = soc15_common_sw_fini, | 883 | .sw_fini = soc15_common_sw_fini, |
866 | .hw_init = soc15_common_hw_init, | 884 | .hw_init = soc15_common_hw_init, |