linux/include/drm/drm_vram_mm_helper.h
Thomas Zimmermann 6b5ce4a1fb drm/vram: Move VRAM memory manager to GEM VRAM implementation
The separation between GEM VRAM objects and the memory manager is
artificial, as they are only used with each other. Copying both
implementations into the same file is a first step to simplifying
the code.

This patch only moves code without functional changes.

v3:
	* update to use dev->vma_offset_manager
v2:
	* update for debugfs support
	* typos in commit message

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190911110910.30698-2-tzimmermann@suse.de
2019-09-12 19:54:04 +02:00

32 lines
978 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef DRM_VRAM_MM_HELPER_H
#define DRM_VRAM_MM_HELPER_H
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>
#include <drm/ttm/ttm_bo_driver.h>
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