Lines Matching refs:dev
35 __FBSDID("$FreeBSD: releng/11.0/sys/dev/drm2/drm_agpsupport.c 280183 2015-03-17 18:50:33Z dumbbell $");
37 #include <dev/drm2/drmP.h>
53 int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info)
57 if (!dev->agp || !dev->agp->acquired)
60 kern = &dev->agp->agp_info;
61 agp_get_info(dev->agp->bridge, kern);
77 int drm_agp_info_ioctl(struct drm_device *dev, void *data,
83 err = drm_agp_info(dev, info);
93 * \param dev DRM device that is to acquire AGP.
99 int drm_agp_acquire(struct drm_device * dev)
103 if (!dev->agp)
105 if (dev->agp->acquired)
107 retcode = agp_acquire(dev->agp->bridge);
110 dev->agp->acquired = 1;
128 int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
131 return drm_agp_acquire((struct drm_device *) file_priv->minor->dev);
137 * \param dev DRM device that is to release AGP.
142 int drm_agp_release(struct drm_device * dev)
144 if (!dev->agp || !dev->agp->acquired)
146 agp_release(dev->agp->bridge);
147 dev->agp->acquired = 0;
152 int drm_agp_release_ioctl(struct drm_device *dev, void *data,
155 return drm_agp_release(dev);
161 * \param dev DRM device that has previously acquired AGP.
168 int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode)
170 if (!dev->agp || !dev->agp->acquired)
173 dev->agp->mode = mode.mode;
174 agp_enable(dev->agp->bridge, mode.mode);
175 dev->agp->enabled = 1;
181 int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
186 return drm_agp_enable(dev, *mode);
201 int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
209 if (!dev->agp || !dev->agp->acquired)
218 if (!(memory = agp_alloc_memory(dev->agp->bridge, type, pages << PAGE_SHIFT))) {
227 list_add(&entry->head, &dev->agp->memory);
229 agp_memory_info(dev->agp->bridge, entry->memory, &info);
239 int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
244 return drm_agp_alloc(dev, request);
250 * \param dev DRM device structure.
256 static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device * dev,
261 list_for_each_entry(entry, &dev->agp->memory, head) {
280 int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request)
285 if (!dev->agp || !dev->agp->acquired)
287 if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
299 int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
304 return drm_agp_unbind(dev, request);
320 int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
326 if (!dev->agp || !dev->agp->acquired)
328 if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
335 entry->bound = dev->agp->base + (page << PAGE_SHIFT);
337 dev->agp->base, entry->bound);
343 int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
348 return drm_agp_bind(dev, request);
365 int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
369 if (!dev->agp || !dev->agp->acquired)
371 if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
386 int drm_agp_free_ioctl(struct drm_device *dev, void *data,
391 return drm_agp_free(dev, request);
403 struct drm_agp_head *drm_agp_init(struct drm_device *dev)
432 drm_agp_bind_pages(struct drm_device *dev,
443 mem = agp_allocate_memory(dev->agp->bridge, num_pages,