Skip to content

Commit

Permalink
drm/amdgpu:invoke new implemented AI MB func
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Monk Liu authored and Alex Deucher committed Apr 6, 2017
1 parent 8758cb6 commit 81758c5
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/soc15.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ static int soc15_common_early_init(void *handle)

if (amdgpu_sriov_vf(adev)) {
amdgpu_virt_init_setting(adev);
xgpu_ai_mailbox_set_irq_funcs(adev);
}

/*
Expand Down Expand Up @@ -615,8 +616,23 @@ static int soc15_common_early_init(void *handle)
return 0;
}

static int soc15_common_late_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

if (amdgpu_sriov_vf(adev))
xgpu_ai_mailbox_get_irq(adev);

return 0;
}

static int soc15_common_sw_init(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;

if (amdgpu_sriov_vf(adev))
xgpu_ai_mailbox_add_irq_id(adev);

return 0;
}

Expand Down Expand Up @@ -647,6 +663,8 @@ static int soc15_common_hw_fini(void *handle)

/* disable the doorbell aperture */
soc15_enable_doorbell_aperture(adev, false);
if (amdgpu_sriov_vf(adev))
xgpu_ai_mailbox_put_irq(adev);

return 0;
}
Expand Down Expand Up @@ -860,7 +878,7 @@ static int soc15_common_set_powergating_state(void *handle,
const struct amd_ip_funcs soc15_common_ip_funcs = {
.name = "soc15_common",
.early_init = soc15_common_early_init,
.late_init = NULL,
.late_init = soc15_common_late_init,
.sw_init = soc15_common_sw_init,
.sw_fini = soc15_common_sw_fini,
.hw_init = soc15_common_hw_init,
Expand Down

0 comments on commit 81758c5

Please sign in to comment.