From: Dave Airlie <airlied@xxxxxxxxxx> under driver control, this flag isn't needed anymore Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx> --- drivers/gpu/drm/ttm/ttm_bo.c | 6 ++---- include/drm/ttm/ttm_bo_driver.h | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index f35548ff17e8..bfc20cb27ed6 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -82,7 +82,6 @@ static void ttm_mem_type_debug(struct ttm_bo_device *bdev, struct drm_printer *p { struct ttm_mem_type_manager *man = ttm_manager_type(bdev, mem_type); - drm_printf(p, " has_type: %d\n", man->has_type); drm_printf(p, " use_type: %d\n", man->use_type); drm_printf(p, " use_tt: %d\n", man->use_tt); drm_printf(p, " size: %llu\n", man->size); @@ -997,7 +996,7 @@ static int ttm_bo_mem_placement(struct ttm_buffer_object *bo, return ret; man = ttm_manager_type(bdev, mem_type); - if (!man->has_type || !man->use_type) + if (!man || !man->use_type) return -EBUSY; if (!ttm_bo_mt_compatible(man, mem_type, place, &cur_flags)) @@ -1455,7 +1454,7 @@ int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type) return -EINVAL; } - if (!man->has_type) { + if (!man) { pr_err("Memory type %u has not been initialized\n", mem_type); return 0; } @@ -1469,7 +1468,6 @@ void ttm_bo_init_mm_base(struct ttm_mem_type_manager *man, { unsigned i; - BUG_ON(man->has_type); man->use_io_reserve_lru = false; mutex_init(&man->io_reserve_mutex); spin_lock_init(&man->move_lock); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index b2ffeaed94e7..702b3b056eda 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -111,7 +111,6 @@ struct ttm_mem_type_manager_func { /** * struct ttm_mem_type_manager * - * @has_type: The memory type has been initialized. * @use_type: The memory type is enabled. * @flags: TTM_MEMTYPE_XX flags identifying the traits of the memory * managed by this memory type. @@ -141,8 +140,6 @@ struct ttm_mem_type_manager { /* * No protection. Constant from start. */ - - bool has_type; bool use_type; bool use_tt; uint64_t size; @@ -673,13 +670,11 @@ static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo) static inline void ttm_bo_use_mm(struct ttm_mem_type_manager *man) { - man->has_type = true; man->use_type = true; } static inline void ttm_bo_disable_mm(struct ttm_mem_type_manager *man) { - man->has_type = false; man->use_type = false; } -- 2.26.2 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel