This source file includes following definitions.
- drm_vram_mm_of_bdev
1
2
3 #ifndef DRM_VRAM_MM_HELPER_H
4 #define DRM_VRAM_MM_HELPER_H
5
6 #include <drm/drm_file.h>
7 #include <drm/drm_ioctl.h>
8 #include <drm/ttm/ttm_bo_driver.h>
9
10 struct drm_device;
11
12
13
14
15
16
17
18
19
20
21
22 struct drm_vram_mm_funcs {
23 void (*evict_flags)(struct ttm_buffer_object *bo,
24 struct ttm_placement *placement);
25 int (*verify_access)(struct ttm_buffer_object *bo, struct file *filp);
26 };
27
28
29
30
31
32
33
34
35
36
37
38
39
40 struct drm_vram_mm {
41 uint64_t vram_base;
42 size_t vram_size;
43
44 struct ttm_bo_device bdev;
45
46 const struct drm_vram_mm_funcs *funcs;
47 };
48
49
50
51
52
53
54
55
56
57 static inline struct drm_vram_mm *drm_vram_mm_of_bdev(
58 struct ttm_bo_device *bdev)
59 {
60 return container_of(bdev, struct drm_vram_mm, bdev);
61 }
62
63 int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev,
64 uint64_t vram_base, size_t vram_size,
65 const struct drm_vram_mm_funcs *funcs);
66 void drm_vram_mm_cleanup(struct drm_vram_mm *vmm);
67
68 int drm_vram_mm_mmap(struct file *filp, struct vm_area_struct *vma,
69 struct drm_vram_mm *vmm);
70
71
72
73
74
75 struct drm_vram_mm *drm_vram_helper_alloc_mm(
76 struct drm_device *dev, uint64_t vram_base, size_t vram_size,
77 const struct drm_vram_mm_funcs *funcs);
78 void drm_vram_helper_release_mm(struct drm_device *dev);
79
80
81
82
83
84 int drm_vram_mm_file_operations_mmap(
85 struct file *filp, struct vm_area_struct *vma);
86
87
88
89
90
91
92
93
94 #define DRM_VRAM_MM_FILE_OPERATIONS \
95 .llseek = no_llseek, \
96 .read = drm_read, \
97 .poll = drm_poll, \
98 .unlocked_ioctl = drm_ioctl, \
99 .compat_ioctl = drm_compat_ioctl, \
100 .mmap = drm_vram_mm_file_operations_mmap, \
101 .open = drm_open, \
102 .release = drm_release \
103
104 #endif