Lines Matching refs:dev

56 void drm_agp_cleanup(struct drm_device *dev)
58 struct drm_agp_head *agp = dev->agp;
76 int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info)
80 if (!dev->agp || !dev->agp->acquired)
83 agpinfo = &dev->agp->agp_info;
103 err = drm_agp_info(dev, info);
113 * \param dev DRM device that is to acquire AGP.
119 int drm_agp_acquire(struct drm_device * dev)
121 if (!dev->agp)
123 if (dev->agp->acquired)
127 if (ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_ACQUIRE,
133 dev->agp->acquired = 1;
152 return drm_agp_acquire((struct drm_device *) file->minor->dev);
158 * \param dev DRM device that is to release AGP.
163 int drm_agp_release(struct drm_device * dev)
165 if (!dev->agp || !dev->agp->acquired)
169 if (ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_RELEASE,
175 dev->agp->acquired = 0;
182 return drm_agp_release(dev);
188 * \param dev DRM device that has previously acquired AGP.
195 int drm_agp_enable(struct drm_device * dev, struct drm_agp_mode mode)
197 if (!dev->agp || !dev->agp->acquired)
200 dev->agp->mode = mode.mode;
205 if (ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_SETUP,
211 dev->agp->enabled = 1;
220 return drm_agp_enable(dev, *mode);
235 int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
242 if (!dev->agp || !dev->agp->acquired)
253 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_ALLOCATE,
264 list_add(&entry->head, &dev->agp->memory, (caddr_t)entry);
277 return drm_agp_alloc(dev, request);
283 * \param dev DRM device structure.
289 static struct drm_agp_mem *drm_agp_lookup_entry(struct drm_device * dev,
294 list_for_each_entry(entry, struct drm_agp_mem, &dev->agp->memory, head) {
313 int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request)
318 if (!dev->agp || !dev->agp->acquired)
320 if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
329 if (ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_UNBIND,
344 return drm_agp_unbind(dev, request);
360 int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
366 if (!dev->agp || !dev->agp->acquired)
368 if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
375 if (retcode = drm_agp_bind_memory(key, page, dev)) {
377 "agp_base=0x%lx", key, page, dev->agp->base);
381 entry->bound = dev->agp->base + (page << PAGE_SHIFT);
383 dev->agp->base, entry->bound);
392 return drm_agp_bind(dev, request);
409 int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request)
413 if (!dev->agp || !dev->agp->acquired)
415 if (!(entry = drm_agp_lookup_entry(dev, request->handle)))
418 (void) drm_agp_unbind_memory(request->handle, dev);
424 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_DEALLOCATE,
441 return drm_agp_free(dev, request);
453 struct drm_agp_head *drm_agp_init(struct drm_device *dev)
461 ret = ldi_ident_from_dip(dev->devinfo, &head->agpgart_li);
494 void *drm_agp_allocate_memory(size_t pages, uint32_t type, struct drm_device *dev)
500 int drm_agp_free_memory(agp_allocate_t *handle, struct drm_device *dev)
505 int drm_agp_bind_memory(unsigned int key, uint32_t start, struct drm_device *dev)
512 if (ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_BIND,
520 int drm_agp_unbind_memory(unsigned long handle, struct drm_device *dev)
526 if (!dev->agp || !dev->agp->acquired)
529 entry = drm_agp_lookup_entry(dev, handle);
535 if (ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_UNBIND,
552 drm_agp_bind_pages(struct drm_device *dev,
566 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_PAGES_BIND,
576 drm_agp_unbind_pages(struct drm_device *dev,
592 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_PAGES_UNBIND,
601 void drm_agp_chipset_flush(struct drm_device *dev)
605 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_FLUSHCHIPSET,
612 drm_agp_rw_gtt(struct drm_device *dev,
626 ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_RW_GTT,