Linux Audio

Check our new training course

Loading...
v5.4
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#ifndef _DRM_AGPSUPPORT_H_
  3#define _DRM_AGPSUPPORT_H_
  4
  5#include <linux/agp_backend.h>
  6#include <linux/kernel.h>
  7#include <linux/list.h>
  8#include <linux/mm.h>
  9#include <linux/mutex.h>
 10#include <linux/types.h>
 11#include <uapi/drm/drm.h>
 12
 13struct drm_device;
 14struct drm_file;
 15
 16struct drm_agp_head {
 17	struct agp_kern_info agp_info;
 18	struct list_head memory;
 19	unsigned long mode;
 20	struct agp_bridge_data *bridge;
 21	int enabled;
 22	int acquired;
 23	unsigned long base;
 24	int agp_mtrr;
 25	int cant_use_aperture;
 26	unsigned long page_mask;
 27};
 28
 29#if IS_ENABLED(CONFIG_AGP)
 30
 31void drm_free_agp(struct agp_memory * handle, int pages);
 32int drm_bind_agp(struct agp_memory * handle, unsigned int start);
 33int drm_unbind_agp(struct agp_memory * handle);
 
 
 
 
 
 34
 35struct drm_agp_head *drm_agp_init(struct drm_device *dev);
 36void drm_legacy_agp_clear(struct drm_device *dev);
 37int drm_agp_acquire(struct drm_device *dev);
 38int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
 39			  struct drm_file *file_priv);
 40int drm_agp_release(struct drm_device *dev);
 41int drm_agp_release_ioctl(struct drm_device *dev, void *data,
 42			  struct drm_file *file_priv);
 43int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
 44int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
 45			 struct drm_file *file_priv);
 46int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
 47int drm_agp_info_ioctl(struct drm_device *dev, void *data,
 48		       struct drm_file *file_priv);
 49int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
 50int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
 51			struct drm_file *file_priv);
 52int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
 53int drm_agp_free_ioctl(struct drm_device *dev, void *data,
 54		       struct drm_file *file_priv);
 55int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
 56int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
 57			 struct drm_file *file_priv);
 58int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
 59int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
 60		       struct drm_file *file_priv);
 61
 62#else /* CONFIG_AGP */
 63
 64static inline void drm_free_agp(struct agp_memory * handle, int pages)
 65{
 66}
 67
 68static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start)
 69{
 70	return -ENODEV;
 71}
 72
 73static inline int drm_unbind_agp(struct agp_memory * handle)
 74{
 75	return -ENODEV;
 76}
 77
 
 
 
 
 
 
 
 
 
 78static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 79{
 80	return NULL;
 81}
 82
 83static inline void drm_legacy_agp_clear(struct drm_device *dev)
 84{
 85}
 86
 87static inline int drm_agp_acquire(struct drm_device *dev)
 88{
 89	return -ENODEV;
 90}
 91
 
 
 
 
 
 
 92static inline int drm_agp_release(struct drm_device *dev)
 93{
 94	return -ENODEV;
 95}
 96
 
 
 
 
 
 
 97static inline int drm_agp_enable(struct drm_device *dev,
 98				 struct drm_agp_mode mode)
 99{
100	return -ENODEV;
101}
102
 
 
 
 
 
 
103static inline int drm_agp_info(struct drm_device *dev,
104			       struct drm_agp_info *info)
105{
106	return -ENODEV;
107}
108
 
 
 
 
 
 
109static inline int drm_agp_alloc(struct drm_device *dev,
110				struct drm_agp_buffer *request)
111{
112	return -ENODEV;
113}
114
 
 
 
 
 
 
115static inline int drm_agp_free(struct drm_device *dev,
116			       struct drm_agp_buffer *request)
117{
118	return -ENODEV;
119}
120
 
 
 
 
 
 
121static inline int drm_agp_unbind(struct drm_device *dev,
122				 struct drm_agp_binding *request)
123{
124	return -ENODEV;
125}
126
 
 
 
 
 
 
127static inline int drm_agp_bind(struct drm_device *dev,
128			       struct drm_agp_binding *request)
129{
130	return -ENODEV;
131}
132
133#endif /* CONFIG_AGP */
 
 
 
 
 
134
135#endif /* _DRM_AGPSUPPORT_H_ */
v3.15
 
  1#ifndef _DRM_AGPSUPPORT_H_
  2#define _DRM_AGPSUPPORT_H_
  3
 
  4#include <linux/kernel.h>
 
  5#include <linux/mm.h>
  6#include <linux/mutex.h>
  7#include <linux/types.h>
  8#include <linux/agp_backend.h>
  9#include <drm/drmP.h>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 10
 11#if __OS_HAS_AGP
 12
 13void drm_free_agp(struct agp_memory * handle, int pages);
 14int drm_bind_agp(struct agp_memory * handle, unsigned int start);
 15int drm_unbind_agp(struct agp_memory * handle);
 16struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
 17				struct page **pages,
 18				unsigned long num_pages,
 19				uint32_t gtt_offset,
 20				uint32_t type);
 21
 22struct drm_agp_head *drm_agp_init(struct drm_device *dev);
 23void drm_agp_clear(struct drm_device *dev);
 24int drm_agp_acquire(struct drm_device *dev);
 25int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
 26			  struct drm_file *file_priv);
 27int drm_agp_release(struct drm_device *dev);
 28int drm_agp_release_ioctl(struct drm_device *dev, void *data,
 29			  struct drm_file *file_priv);
 30int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
 31int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
 32			 struct drm_file *file_priv);
 33int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
 34int drm_agp_info_ioctl(struct drm_device *dev, void *data,
 35		       struct drm_file *file_priv);
 36int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
 37int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
 38			struct drm_file *file_priv);
 39int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
 40int drm_agp_free_ioctl(struct drm_device *dev, void *data,
 41		       struct drm_file *file_priv);
 42int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
 43int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
 44			 struct drm_file *file_priv);
 45int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
 46int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
 47		       struct drm_file *file_priv);
 48#else /* __OS_HAS_AGP */
 
 49
 50static inline void drm_free_agp(struct agp_memory * handle, int pages)
 51{
 52}
 53
 54static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start)
 55{
 56	return -ENODEV;
 57}
 58
 59static inline int drm_unbind_agp(struct agp_memory * handle)
 60{
 61	return -ENODEV;
 62}
 63
 64static inline struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
 65					      struct page **pages,
 66					      unsigned long num_pages,
 67					      uint32_t gtt_offset,
 68					      uint32_t type)
 69{
 70	return NULL;
 71}
 72
 73static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
 74{
 75	return NULL;
 76}
 77
 78static inline void drm_agp_clear(struct drm_device *dev)
 79{
 80}
 81
 82static inline int drm_agp_acquire(struct drm_device *dev)
 83{
 84	return -ENODEV;
 85}
 86
 87static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
 88					struct drm_file *file_priv)
 89{
 90	return -ENODEV;
 91}
 92
 93static inline int drm_agp_release(struct drm_device *dev)
 94{
 95	return -ENODEV;
 96}
 97
 98static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data,
 99					struct drm_file *file_priv)
100{
101	return -ENODEV;
102}
103
104static inline int drm_agp_enable(struct drm_device *dev,
105				 struct drm_agp_mode mode)
106{
107	return -ENODEV;
108}
109
110static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
111				       struct drm_file *file_priv)
112{
113	return -ENODEV;
114}
115
116static inline int drm_agp_info(struct drm_device *dev,
117			       struct drm_agp_info *info)
118{
119	return -ENODEV;
120}
121
122static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data,
123				     struct drm_file *file_priv)
124{
125	return -ENODEV;
126}
127
128static inline int drm_agp_alloc(struct drm_device *dev,
129				struct drm_agp_buffer *request)
130{
131	return -ENODEV;
132}
133
134static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
135				      struct drm_file *file_priv)
136{
137	return -ENODEV;
138}
139
140static inline int drm_agp_free(struct drm_device *dev,
141			       struct drm_agp_buffer *request)
142{
143	return -ENODEV;
144}
145
146static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data,
147				     struct drm_file *file_priv)
148{
149	return -ENODEV;
150}
151
152static inline int drm_agp_unbind(struct drm_device *dev,
153				 struct drm_agp_binding *request)
154{
155	return -ENODEV;
156}
157
158static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
159				       struct drm_file *file_priv)
160{
161	return -ENODEV;
162}
163
164static inline int drm_agp_bind(struct drm_device *dev,
165			       struct drm_agp_binding *request)
166{
167	return -ENODEV;
168}
169
170static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
171				     struct drm_file *file_priv)
172{
173	return -ENODEV;
174}
175#endif /* __OS_HAS_AGP */
176
177#endif /* _DRM_AGPSUPPORT_H_ */