1#ifndef __DRM_LEGACY_H__
2#define __DRM_LEGACY_H__
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#include <linux/list.h>
32#include <drm/drm_legacy.h>
33
34struct agp_memory;
35struct drm_device;
36struct drm_file;
37
38
39
40
41
42#define DRM_KERNEL_CONTEXT 0
43#define DRM_RESERVED_CONTEXTS 1
44
45void drm_legacy_ctxbitmap_init(struct drm_device *dev);
46void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
47void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle);
48void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);
49
50int drm_legacy_resctx(struct drm_device *d, void *v, struct drm_file *f);
51int drm_legacy_addctx(struct drm_device *d, void *v, struct drm_file *f);
52int drm_legacy_getctx(struct drm_device *d, void *v, struct drm_file *f);
53int drm_legacy_switchctx(struct drm_device *d, void *v, struct drm_file *f);
54int drm_legacy_newctx(struct drm_device *d, void *v, struct drm_file *f);
55int drm_legacy_rmctx(struct drm_device *d, void *v, struct drm_file *f);
56
57int drm_legacy_setsareactx(struct drm_device *d, void *v, struct drm_file *f);
58int drm_legacy_getsareactx(struct drm_device *d, void *v, struct drm_file *f);
59
60
61
62
63
64#define DRM_MAP_HASH_OFFSET 0x10000000
65
66int drm_legacy_addmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
67int drm_legacy_rmmap_ioctl(struct drm_device *d, void *v, struct drm_file *f);
68int drm_legacy_addbufs(struct drm_device *d, void *v, struct drm_file *f);
69int drm_legacy_infobufs(struct drm_device *d, void *v, struct drm_file *f);
70int drm_legacy_markbufs(struct drm_device *d, void *v, struct drm_file *f);
71int drm_legacy_freebufs(struct drm_device *d, void *v, struct drm_file *f);
72int drm_legacy_mapbufs(struct drm_device *d, void *v, struct drm_file *f);
73int drm_legacy_dma_ioctl(struct drm_device *d, void *v, struct drm_file *f);
74
75void drm_legacy_vma_flush(struct drm_device *d);
76
77
78
79
80
81struct drm_agp_mem {
82 unsigned long handle;
83 struct agp_memory *memory;
84 unsigned long bound;
85 int pages;
86 struct list_head head;
87};
88
89
90
91
92
93int drm_legacy_i_have_hw_lock(struct drm_device *d, struct drm_file *f);
94int drm_legacy_lock(struct drm_device *d, void *v, struct drm_file *f);
95int drm_legacy_unlock(struct drm_device *d, void *v, struct drm_file *f);
96int drm_legacy_lock_free(struct drm_lock_data *lock, unsigned int ctx);
97
98
99int drm_legacy_dma_setup(struct drm_device *dev);
100void drm_legacy_dma_takedown(struct drm_device *dev);
101void drm_legacy_free_buffer(struct drm_device *dev,
102 struct drm_buf * buf);
103void drm_legacy_reclaim_buffers(struct drm_device *dev,
104 struct drm_file *filp);
105
106
107void drm_legacy_sg_cleanup(struct drm_device *dev);
108int drm_legacy_sg_alloc(struct drm_device *dev, void *data,
109 struct drm_file *file_priv);
110int drm_legacy_sg_free(struct drm_device *dev, void *data,
111 struct drm_file *file_priv);
112
113#endif
114