aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
diff options
context:
space:
mode:
authorpding <Pixel.Ding@amd.com>2017-10-23 21:51:04 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-12-04 16:33:13 -0500
commitb636176efdf0e365a69613f03f6ecbf6fd0408cb (patch)
treec8aa6361e2719540a7b2c3d060388c084334266f /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
parenta16f8f11c599cdec16e77020d56d230fedabe922 (diff)
drm/amdgpu/virt: add wait_reset virt ops
Driver can use this interface to check if there's a function level reset done in hypervisor. It's helpful when IRQ handler for reset is not ready, or special handling is required. Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com> Signed-off-by: pding <Pixel.Ding@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 0f227cf7a67c..b7510bf6bc0f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -236,6 +236,22 @@ int amdgpu_virt_reset_gpu(struct amdgpu_device *adev)
236} 236}
237 237
238/** 238/**
239 * amdgpu_virt_wait_reset() - wait for reset gpu completed
240 * @amdgpu: amdgpu device.
241 * Wait for GPU reset completed.
242 * Return: Zero if reset success, otherwise will return error.
243 */
244int amdgpu_virt_wait_reset(struct amdgpu_device *adev)
245{
246 struct amdgpu_virt *virt = &adev->virt;
247
248 if (!virt->ops || !virt->ops->wait_reset)
249 return -EINVAL;
250
251 return virt->ops->wait_reset(adev);
252}
253
254/**
239 * amdgpu_virt_alloc_mm_table() - alloc memory for mm table 255 * amdgpu_virt_alloc_mm_table() - alloc memory for mm table
240 * @amdgpu: amdgpu device. 256 * @amdgpu: amdgpu device.
241 * MM table is used by UVD and VCE for its initialization 257 * MM table is used by UVD and VCE for its initialization