diff options
author | Dave Airlie <airlied@redhat.com> | 2020-09-15 11:34:51 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-09-16 09:35:30 +1000 |
commit | 9e9a153bdf2555a931fd37678a8e44d170a5d943 (patch) | |
tree | 1da6cf699fc948cec069a258edaa55020489e4bb /include/drm | |
parent | 2040ec970e94dde0b94e200ae9bb8f21a61c928f (diff) |
drm/ttm: move ttm binding/unbinding out of ttm_tt paths.
Move these up to the bo level, moving ttm_tt to just being
backing store. Next step is to move the bound flag out.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-6-airlied@gmail.com
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 28 | ||||
-rw-r--r-- | include/drm/ttm/ttm_tt.h | 35 |
2 files changed, 28 insertions, 35 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 70557e2de9be..d2bea22f35ae 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -685,6 +685,34 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo); pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); /** + * ttm_bo_tt_bind + * + * Bind the object tt to a memory resource. + */ +int ttm_bo_tt_bind(struct ttm_buffer_object *bo, struct ttm_resource *mem); + +/** + * ttm_bo_tt_bind + * + * Unbind the object tt from a memory resource. + */ +void ttm_bo_tt_unbind(struct ttm_buffer_object *bo); + +static inline bool ttm_bo_tt_is_bound(struct ttm_buffer_object *bo) +{ + return bo->ttm->_state == tt_bound; +} + +static inline void ttm_bo_tt_set_unbound(struct ttm_buffer_object *bo) +{ + bo->ttm->_state = tt_unbound; +} + +static inline void ttm_bo_tt_set_bound(struct ttm_buffer_object *bo) +{ + bo->ttm->_state = tt_bound; +} +/** * ttm_bo_tt_destroy. */ void ttm_bo_tt_destroy(struct ttm_buffer_object *bo); diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h index 8f57d86ee67b..1ac56730d952 100644 --- a/include/drm/ttm/ttm_tt.h +++ b/include/drm/ttm/ttm_tt.h @@ -82,11 +82,6 @@ static inline bool ttm_tt_is_populated(struct ttm_tt *tt) return tt->_state != tt_unpopulated; } -static inline bool ttm_tt_is_bound(struct ttm_tt *tt) -{ - return tt->_state == tt_bound; -} - static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt) { tt->_state = tt_unpopulated; @@ -97,16 +92,6 @@ static inline void ttm_tt_set_populated(struct ttm_tt *tt) tt->_state = tt_unbound; } -static inline void ttm_tt_set_unbound(struct ttm_tt *tt) -{ - tt->_state = tt_unbound; -} - -static inline void ttm_tt_set_bound(struct ttm_tt *tt) -{ - tt->_state = tt_bound; -} - /** * struct ttm_dma_tt * @@ -165,17 +150,6 @@ void ttm_tt_fini(struct ttm_tt *ttm); void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); /** - * ttm_ttm_bind: - * - * @ttm: The struct ttm_tt containing backing pages. - * @bo_mem: The struct ttm_resource identifying the binding location. - * - * Bind the pages of @ttm to an aperture location identified by @bo_mem - */ -int ttm_tt_bind(struct ttm_bo_device *bdev, - struct ttm_tt *ttm, struct ttm_resource *bo_mem); - -/** * ttm_ttm_destroy: * * @ttm: The struct ttm_tt. @@ -185,15 +159,6 @@ int ttm_tt_bind(struct ttm_bo_device *bdev, void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm); /** - * ttm_ttm_unbind: - * - * @ttm: The struct ttm_tt. - * - * Unbind a struct ttm_tt. - */ -void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm); - -/** * ttm_tt_swapin: * * @ttm: The struct ttm_tt. |