1 #ifndef _DRM_AGPSUPPORT_H_
2 #define _DRM_AGPSUPPORT_H_
4 #include <linux/agp_backend.h>
5 #include <linux/kernel.h>
6 #include <linux/list.h>
8 #include <linux/mutex.h>
9 #include <linux/types.h>
10 #include <uapi/drm/drm.h>
16 struct agp_kern_info agp_info
;
17 struct list_head memory
;
19 struct agp_bridge_data
*bridge
;
24 int cant_use_aperture
;
25 unsigned long page_mask
;
28 #if IS_ENABLED(CONFIG_AGP)
30 void drm_free_agp(struct agp_memory
* handle
, int pages
);
31 int drm_bind_agp(struct agp_memory
* handle
, unsigned int start
);
32 int drm_unbind_agp(struct agp_memory
* handle
);
33 struct agp_memory
*drm_agp_bind_pages(struct drm_device
*dev
,
35 unsigned long num_pages
,
39 struct drm_agp_head
*drm_agp_init(struct drm_device
*dev
);
40 void drm_legacy_agp_clear(struct drm_device
*dev
);
41 int drm_agp_acquire(struct drm_device
*dev
);
42 int drm_agp_acquire_ioctl(struct drm_device
*dev
, void *data
,
43 struct drm_file
*file_priv
);
44 int drm_agp_release(struct drm_device
*dev
);
45 int drm_agp_release_ioctl(struct drm_device
*dev
, void *data
,
46 struct drm_file
*file_priv
);
47 int drm_agp_enable(struct drm_device
*dev
, struct drm_agp_mode mode
);
48 int drm_agp_enable_ioctl(struct drm_device
*dev
, void *data
,
49 struct drm_file
*file_priv
);
50 int drm_agp_info(struct drm_device
*dev
, struct drm_agp_info
*info
);
51 int drm_agp_info_ioctl(struct drm_device
*dev
, void *data
,
52 struct drm_file
*file_priv
);
53 int drm_agp_alloc(struct drm_device
*dev
, struct drm_agp_buffer
*request
);
54 int drm_agp_alloc_ioctl(struct drm_device
*dev
, void *data
,
55 struct drm_file
*file_priv
);
56 int drm_agp_free(struct drm_device
*dev
, struct drm_agp_buffer
*request
);
57 int drm_agp_free_ioctl(struct drm_device
*dev
, void *data
,
58 struct drm_file
*file_priv
);
59 int drm_agp_unbind(struct drm_device
*dev
, struct drm_agp_binding
*request
);
60 int drm_agp_unbind_ioctl(struct drm_device
*dev
, void *data
,
61 struct drm_file
*file_priv
);
62 int drm_agp_bind(struct drm_device
*dev
, struct drm_agp_binding
*request
);
63 int drm_agp_bind_ioctl(struct drm_device
*dev
, void *data
,
64 struct drm_file
*file_priv
);
66 #else /* CONFIG_AGP */
68 static inline void drm_free_agp(struct agp_memory
* handle
, int pages
)
72 static inline int drm_bind_agp(struct agp_memory
* handle
, unsigned int start
)
77 static inline int drm_unbind_agp(struct agp_memory
* handle
)
82 static inline struct agp_memory
*drm_agp_bind_pages(struct drm_device
*dev
,
84 unsigned long num_pages
,
91 static inline struct drm_agp_head
*drm_agp_init(struct drm_device
*dev
)
96 static inline void drm_legacy_agp_clear(struct drm_device
*dev
)
100 static inline int drm_agp_acquire(struct drm_device
*dev
)
105 static inline int drm_agp_release(struct drm_device
*dev
)
110 static inline int drm_agp_enable(struct drm_device
*dev
,
111 struct drm_agp_mode mode
)
116 static inline int drm_agp_info(struct drm_device
*dev
,
117 struct drm_agp_info
*info
)
122 static inline int drm_agp_alloc(struct drm_device
*dev
,
123 struct drm_agp_buffer
*request
)
128 static inline int drm_agp_free(struct drm_device
*dev
,
129 struct drm_agp_buffer
*request
)
134 static inline int drm_agp_unbind(struct drm_device
*dev
,
135 struct drm_agp_binding
*request
)
140 static inline int drm_agp_bind(struct drm_device
*dev
,
141 struct drm_agp_binding
*request
)
146 #endif /* CONFIG_AGP */
148 #endif /* _DRM_AGPSUPPORT_H_ */