Lines Matching defs:dev

68 drm_find_map(drm_device_t *dev, u_offset_t offset, int type)
72 TAILQ_FOREACH(map, &dev->maplist, link) {
82 int drm_addmap(drm_device_t *dev, unsigned long offset,
106 map = drm_find_map(dev, offset, type);
127 retval = drm_ioremap(dev, map);
153 if (dev->lock.hw_lock != NULL) {
158 dev->lock.hw_lock = map->handle; /* Pointer to lock */
163 if (!dev->sg) {
167 map->offset += (uintptr_t)dev->sg->virtual;
169 map->dev_addr = dev->sg->virtual;
170 map->dev_handle = dev->sg->dmah_sg->acc_hdl;
177 map->offset += dev->agp->base;
194 TAILQ_INSERT_TAIL(&dev->maplist, map, link);
227 err = drm_addmap(dev, request.offset, request.size, request.type,
260 drm_rmmap(drm_device_t *dev, drm_local_map_t *map)
262 DRM_SPINLOCK_ASSERT(&dev->dev_lock);
264 TAILQ_REMOVE(&dev->maplist, map, link);
325 TAILQ_FOREACH(map, &dev->maplist, link) {
337 drm_rmmap(dev, map);
345 drm_cleanup_buf_error(drm_device_t *dev, drm_buf_entry_t *entry)
395 drm_do_addbufs_agp(drm_device_t *dev, drm_buf_desc_t *request)
397 drm_device_dma_t *dma = dev->dma;
423 agp_offset = dev->agp->base + request->agp_start;
456 buf->dev_priv_size = dev->driver->buf_priv_size;
461 drm_cleanup_buf_error(dev, entry);
476 drm_cleanup_buf_error(dev, entry);
504 drm_do_addbufs_sg(drm_device_t *dev, drm_buf_desc_t *request)
506 drm_device_dma_t *dma = dev->dma;
551 buf->address = (void *)(agp_offset + offset + dev->sg->handle);
556 buf->dev_priv_size = dev->driver->buf_priv_size;
562 drm_cleanup_buf_error(dev, entry);
576 drm_cleanup_buf_error(dev, entry);
595 drm_addbufs_agp(drm_device_t *dev, drm_buf_desc_t *request)
599 DRM_SPINLOCK(&dev->dma_lock);
602 DRM_SPINLOCK(&dev->dma_lock);
608 DRM_SPINLOCK(&dev->dma_lock);
613 if (dev->buf_use != 0) {
614 DRM_SPINUNLOCK(&dev->dma_lock);
618 if (dev->dma->bufs[order].buf_count != 0) {
619 DRM_SPINUNLOCK(&dev->dma_lock);
623 ret = drm_do_addbufs_agp(dev, request);
625 DRM_SPINUNLOCK(&dev->dma_lock);
631 drm_addbufs_sg(drm_device_t *dev, drm_buf_desc_t *request)
635 DRM_SPINLOCK(&dev->dma_lock);
638 DRM_SPINUNLOCK(&dev->dma_lock);
644 DRM_SPINUNLOCK(&dev->dma_lock);
649 if (dev->buf_use != 0) {
650 DRM_SPINUNLOCK(&dev->dma_lock);
655 if (dev->dma->bufs[order].buf_count != 0) {
656 DRM_SPINUNLOCK(&dev->dma_lock);
660 ret = drm_do_addbufs_sg(dev, request);
661 DRM_SPINUNLOCK(&dev->dma_lock);
690 err = drm_addbufs_agp(dev, &request);
692 err = drm_addbufs_sg(dev, &request);
718 drm_device_dma_t *dma = dev->dma;
756 drm_free_buffer(dev, buf);
784 drm_device_dma_t *dma = dev->dma;
807 dev->buf_use++;
812 if ((dev->driver->use_agp && (dma->flags & _DRM_DMA_USE_AGP)) ||
813 (dev->driver->use_sg && (dma->flags & _DRM_DMA_USE_SG))) {
814 drm_local_map_t *map = dev->agp_buffer_map;