drm/amdgpu: allow direct submission of PDE updates v2
For handling PDE updates directly in the fault handler. v2: fix typo in comment Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
47ca7efa4c
commit
807e299409
@@ -344,7 +344,7 @@ static int vm_update_pds(struct amdgpu_vm *vm, struct amdgpu_sync *sync)
|
|||||||
struct amdgpu_device *adev = amdgpu_ttm_adev(pd->tbo.bdev);
|
struct amdgpu_device *adev = amdgpu_ttm_adev(pd->tbo.bdev);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = amdgpu_vm_update_directories(adev, vm);
|
ret = amdgpu_vm_update_pdes(adev, vm, false);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|||||||
@@ -847,7 +847,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
|
|||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
r = amdgpu_vm_update_directories(adev, vm);
|
r = amdgpu_vm_update_pdes(adev, vm, false);
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_vm_update_directories(adev, vm);
|
r = amdgpu_vm_update_pdes(adev, vm, false);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (r && r != -ERESTARTSYS)
|
if (r && r != -ERESTARTSYS)
|
||||||
|
|||||||
@@ -1227,18 +1227,19 @@ static void amdgpu_vm_invalidate_pds(struct amdgpu_device *adev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* amdgpu_vm_update_directories - make sure that all directories are valid
|
* amdgpu_vm_update_pdes - make sure that all directories are valid
|
||||||
*
|
*
|
||||||
* @adev: amdgpu_device pointer
|
* @adev: amdgpu_device pointer
|
||||||
* @vm: requested vm
|
* @vm: requested vm
|
||||||
|
* @direct: submit directly to the paging queue
|
||||||
*
|
*
|
||||||
* Makes sure all directories are up to date.
|
* Makes sure all directories are up to date.
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* 0 for success, error for failure.
|
* 0 for success, error for failure.
|
||||||
*/
|
*/
|
||||||
int amdgpu_vm_update_directories(struct amdgpu_device *adev,
|
int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
|
||||||
struct amdgpu_vm *vm)
|
struct amdgpu_vm *vm, bool direct)
|
||||||
{
|
{
|
||||||
struct amdgpu_vm_update_params params;
|
struct amdgpu_vm_update_params params;
|
||||||
int r;
|
int r;
|
||||||
@@ -1249,6 +1250,7 @@ int amdgpu_vm_update_directories(struct amdgpu_device *adev,
|
|||||||
memset(¶ms, 0, sizeof(params));
|
memset(¶ms, 0, sizeof(params));
|
||||||
params.adev = adev;
|
params.adev = adev;
|
||||||
params.vm = vm;
|
params.vm = vm;
|
||||||
|
params.direct = direct;
|
||||||
|
|
||||||
r = vm->update_funcs->prepare(¶ms, AMDGPU_FENCE_OWNER_VM, NULL);
|
r = vm->update_funcs->prepare(¶ms, AMDGPU_FENCE_OWNER_VM, NULL);
|
||||||
if (r)
|
if (r)
|
||||||
|
|||||||
@@ -366,8 +366,8 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
|||||||
int (*callback)(void *p, struct amdgpu_bo *bo),
|
int (*callback)(void *p, struct amdgpu_bo *bo),
|
||||||
void *param);
|
void *param);
|
||||||
int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_pipe_sync);
|
int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job, bool need_pipe_sync);
|
||||||
int amdgpu_vm_update_directories(struct amdgpu_device *adev,
|
int amdgpu_vm_update_pdes(struct amdgpu_device *adev,
|
||||||
struct amdgpu_vm *vm);
|
struct amdgpu_vm *vm, bool direct);
|
||||||
int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
|
int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
|
||||||
struct amdgpu_vm *vm,
|
struct amdgpu_vm *vm,
|
||||||
struct dma_fence **fence);
|
struct dma_fence **fence);
|
||||||
|
|||||||
Reference in New Issue
Block a user