summaryrefslogtreecommitdiff
path: root/include/drm/drm_vram_mm_helper.h
blob: e3b79e13e106fa5ce54107566dae5899209cd5a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* 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