From b0e40e0805221dc8e11762717149e2c099e0eb99 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Wed, 11 Sep 2019 13:09:08 +0200 Subject: drm/vram: Have VRAM MM call GEM VRAM functions directly VRAM MM and GEM VRAM buffer objects are only used with each other; connected via 3 function pointers. Simplify this code by making the memory manager call the rsp. functions of the BOs directly; and remove the functions from the BO's public interface. v2: * typos in commit message Signed-off-by: Thomas Zimmermann Acked-by: Gerd Hoffmann Link: https://patchwork.freedesktop.org/patch/msgid/20190911110910.30698-3-tzimmermann@suse.de --- include/drm/drm_gem_vram_helper.h | 24 ++---------------------- include/drm/drm_vram_mm_helper.h | 32 -------------------------------- 2 files changed, 2 insertions(+), 54 deletions(-) delete mode 100644 include/drm/drm_vram_mm_helper.h (limited to 'include/drm') diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vram_helper.h index 1513349a27b1..fd978e0c9542 100644 --- a/include/drm/drm_gem_vram_helper.h +++ b/include/drm/drm_gem_vram_helper.h @@ -109,22 +109,6 @@ int drm_gem_vram_fill_create_dumb(struct drm_file *file, bool interruptible, struct drm_mode_create_dumb *args); -/* - * Helpers for struct ttm_bo_driver - */ - -void drm_gem_vram_bo_driver_evict_flags(struct ttm_buffer_object *bo, - struct ttm_placement *pl); - -void drm_gem_vram_bo_driver_move_notify(struct ttm_buffer_object *bo, - bool evict, - struct ttm_mem_reg *new_mem); - -int drm_gem_vram_bo_driver_verify_access(struct ttm_buffer_object *bo, - struct file *filp); - -extern const struct drm_vram_mm_funcs drm_gem_vram_mm_funcs; - /* * Helpers for struct drm_driver */ @@ -170,8 +154,6 @@ struct drm_vram_mm { size_t vram_size; struct ttm_bo_device bdev; - - const struct drm_vram_mm_funcs *funcs; }; /** @@ -190,8 +172,7 @@ static inline struct drm_vram_mm *drm_vram_mm_of_bdev( int drm_vram_mm_debugfs_init(struct drm_minor *minor); int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, - uint64_t vram_base, size_t vram_size, - const struct drm_vram_mm_funcs *funcs); + uint64_t vram_base, size_t vram_size); void drm_vram_mm_cleanup(struct drm_vram_mm *vmm); int drm_vram_mm_mmap(struct file *filp, struct vm_area_struct *vma, @@ -202,8 +183,7 @@ int drm_vram_mm_mmap(struct file *filp, struct vm_area_struct *vma, */ struct drm_vram_mm *drm_vram_helper_alloc_mm( - struct drm_device *dev, uint64_t vram_base, size_t vram_size, - const struct drm_vram_mm_funcs *funcs); + struct drm_device *dev, uint64_t vram_base, size_t vram_size); void drm_vram_helper_release_mm(struct drm_device *dev); /* diff --git a/include/drm/drm_vram_mm_helper.h b/include/drm/drm_vram_mm_helper.h deleted file mode 100644 index e3b79e13e106..000000000000 --- a/include/drm/drm_vram_mm_helper.h +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ - -#ifndef DRM_VRAM_MM_HELPER_H -#define DRM_VRAM_MM_HELPER_H - -#include -#include -#include - -struct drm_device; - -/** - * struct drm_vram_mm_funcs - Callback functions for &struct drm_vram_mm - * @evict_flags: Provides an implementation for struct \ - &ttm_bo_driver.evict_flags - * @verify_access: Provides an implementation for \ - struct &ttm_bo_driver.verify_access - * @move_notify: Provides an implementation for - * struct &ttm_bo_driver.move_notify - * - * These callback function integrate VRAM MM with TTM buffer objects. New - * functions can be added if necessary. - */ -struct drm_vram_mm_funcs { - void (*evict_flags)(struct ttm_buffer_object *bo, - struct ttm_placement *placement); - int (*verify_access)(struct ttm_buffer_object *bo, struct file *filp); - void (*move_notify)(struct ttm_buffer_object *bo, bool evict, - struct ttm_mem_reg *new_mem); -}; - -#endif -- cgit v1.2.3