diff options
author | Dave Airlie <airlied@redhat.com> | 2020-09-17 12:54:24 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-09-18 06:14:00 +1000 |
commit | 0b988ca1c7c4c73983b4ea96ef7c2af2263c87eb (patch) | |
tree | 729ee7adfc399e41f03a768f1a1df8f036d7af88 /include/drm | |
parent | 67d6a8b358eac488112a4775f77dc3dbf63bea88 (diff) |
drm/ttm: protect against reentrant bind in the drivers
This moves the generic tracking into the drivers and protects
against reentrancy in the drivers. It fixes up radeon and agp
to be able to query the bound status as that is required.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200917043040.146575-2-airlied@gmail.com
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 1 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 14 | ||||
-rw-r--r-- | include/drm/ttm/ttm_tt.h | 1 |
3 files changed, 1 insertions, 15 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 89ad6f213fc0..fd8d29f5f370 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -141,7 +141,6 @@ struct ttm_buffer_object { struct ttm_resource mem; struct file *persistent_swap_storage; struct ttm_tt *ttm; - bool ttm_bound; bool evicted; bool deleted; diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e66672f703a3..7846dfa507f7 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -698,20 +698,6 @@ int ttm_bo_tt_bind(struct ttm_buffer_object *bo, struct ttm_resource *mem); */ 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_bound; -} - -static inline void ttm_bo_tt_set_unbound(struct ttm_buffer_object *bo) -{ - bo->ttm_bound = false; -} - -static inline void ttm_bo_tt_set_bound(struct ttm_buffer_object *bo) -{ - bo->ttm_bound = true; -} /** * ttm_bo_tt_destroy. */ diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h index c777b72063db..4e906e32d08c 100644 --- a/include/drm/ttm/ttm_tt.h +++ b/include/drm/ttm/ttm_tt.h @@ -219,6 +219,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_buffer_object *bo, int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem); void ttm_agp_unbind(struct ttm_tt *ttm); void ttm_agp_destroy(struct ttm_tt *ttm); +bool ttm_agp_is_bound(struct ttm_tt *ttm); #endif #endif |