diff options
author | Christian König <christian.koenig@amd.com> | 2017-04-12 14:24:39 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-06 12:48:01 -0500 |
commit | 19be5570107108fba772bc2e3a1eb22ec32fb021 (patch) | |
tree | 86b971706ea8fce92b58cac4ea73e8799564a6ef /include/drm | |
parent | 750a25037cac56afeb48ab807ce80fa2cd518b8d (diff) | |
download | op-kernel-dev-19be5570107108fba772bc2e3a1eb22ec32fb021.zip op-kernel-dev-19be5570107108fba772bc2e3a1eb22ec32fb021.tar.gz |
drm/ttm: add operation ctx to ttm_bo_validate v2
Give moving a BO into place an operation context to work with.
v2: rebased
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 833c3ad..097951e 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -259,6 +259,20 @@ struct ttm_bo_kmap_obj { }; /** + * struct ttm_operation_ctx + * + * @interruptible: Sleep interruptible if sleeping. + * @no_wait_gpu: Return immediately if the GPU is busy. + * + * Context for TTM operations like changing buffer placement or general memory + * allocation. + */ +struct ttm_operation_ctx { + bool interruptible; + bool no_wait_gpu; +}; + +/** * ttm_bo_reference - reference a struct ttm_buffer_object * * @bo: The buffer object. @@ -306,8 +320,7 @@ bool ttm_bo_mem_compat(struct ttm_placement *placement, struct ttm_mem_reg *mem, * * @bo: The buffer object. * @placement: Proposed placement for the buffer object. - * @interruptible: Sleep interruptible if sleeping. - * @no_wait_gpu: Return immediately if the GPU is busy. + * @ctx: validation parameters. * * Changes placement and caching policy of the buffer object * according proposed placement. @@ -319,8 +332,7 @@ bool ttm_bo_mem_compat(struct ttm_placement *placement, struct ttm_mem_reg *mem, */ int ttm_bo_validate(struct ttm_buffer_object *bo, struct ttm_placement *placement, - bool interruptible, - bool no_wait_gpu); + struct ttm_operation_ctx *ctx); /** * ttm_bo_unref |