summaryrefslogtreecommitdiff
path: root/linux-core/i915_fence.c
AgeCommit message (Collapse)Author
2007-02-22Some fencing cleanup.Thomas Hellstrom
2007-02-15Initial support for fence object classes.Thomas Hellstrom
(Fence objects belonging to different command submission mechanisms).
2007-02-14Remove an intel-specific hack and replace it with a fence driver callback.Thomas Hellstrom
2006-10-19Make sure delayed delete list is empty on lastclose.Thomas Hellstrom
Fix some refcounting errors. Fix some error messages.
2006-10-17Lindent.Thomas Hellstrom
2006-09-25Add /proc filesystem buffer / fence object accounting.Thomas Hellstrom
Check for NULL pointer in the i915 flush handler. Remove i915_sync_flush declaration.
2006-09-18Alternative implementation of page table zeroing using zap page_range.Thomas Hellstrom
(Disabled for now) Fix bo_wait_idle bug. Remove stray debug message.
2006-09-15Allow a "native type" to be associated with a fence sequence.Thomas Hellstrom
In the intel case, we can associate a flush with a sequence.
2006-09-15Some bugfixes.Thomas Hellstrom
Change the fence object interface somewhat to allow some more flexibility. Make list IOCTLS really restartable. Try to avoid busy-waits in the kernel using immediate return to user-space with an -EAGAIN.
2006-09-08Various bugfixes.Thomas Hellstrom
2006-09-05i915: Only turn on user IRQs when they are needed.Thomas Hellstrom
2006-08-31Validation and fencing.Thomas Hellstrom
2006-08-29Checkpoint commit. Buffer object flags and IOCTL argument list.Thomas Hellstrom
2006-08-21i915 fence object driver implementing 2 fence object types:Thomas Hellstrom
0x00 EXE fence. Signals when command stream interpreter has reached the point where the fence was emitted. 0x01 FLUSH fence. Signals when command stream interpreter has reached the point where the fence was emitted, and all previous drawing operations have been completed and flushed. Implements busy wait (for fastest response time / high CPU) and lazy wait (User interrupt or timer driven).
kwb">struct cdev *kdev, vm_offset_t offset, vm_paddr_t *paddr, int prot) #elif defined(__FreeBSD__) int drm_mmap(dev_t kdev, vm_offset_t offset, int prot) #elif defined(__NetBSD__) || defined(__OpenBSD__) paddr_t drm_mmap(dev_t kdev, off_t offset, int prot) #endif { drm_device_t *dev = drm_get_device_from_kdev(kdev); drm_local_map_t *map; drm_file_t *priv; drm_map_type_t type; #ifdef __FreeBSD__ vm_paddr_t phys; #else paddr_t phys; #endif DRM_LOCK(); priv = drm_find_file_by_proc(dev, DRM_CURPROC); DRM_UNLOCK(); if (priv == NULL) { DRM_ERROR("can't find authenticator\n"); return EINVAL; } if (!priv->authenticated) return EACCES; if (dev->dma && offset >= 0 && offset < ptoa(dev->dma->page_count)) { drm_device_dma_t *dma = dev->dma; DRM_SPINLOCK(&dev->dma_lock); if (dma->pagelist != NULL) { unsigned long page = offset >> PAGE_SHIFT; unsigned long phys = dma->pagelist[page]; #if defined(__FreeBSD__) && __FreeBSD_version >= 500102 *paddr = phys; DRM_SPINUNLOCK(&dev->dma_lock); return 0; #else return atop(phys); #endif } else { DRM_SPINUNLOCK(&dev->dma_lock); return -1; } DRM_SPINUNLOCK(&dev->dma_lock); } /* A sequential search of a linked list is fine here because: 1) there will only be about 5-10 entries in the list and, 2) a DRI client only has to do this mapping once, so it doesn't have to be optimized for performance, even if the list was a bit longer. */ DRM_LOCK(); TAILQ_FOREACH(map, &dev->maplist, link) { if (offset >= map->offset && offset < map->offset + map->size) break; } if (map == NULL) { DRM_UNLOCK(); DRM_DEBUG("can't find map\n"); return -1; } if (((map->flags&_DRM_RESTRICTED) && !DRM_SUSER(DRM_CURPROC))) { DRM_UNLOCK(); DRM_DEBUG("restricted map\n"); return -1; } type = map->type; DRM_UNLOCK(); switch (type) { case _DRM_FRAME_BUFFER: case _DRM_REGISTERS: case _DRM_AGP: phys = offset; break; case _DRM_CONSISTENT: phys = vtophys((char *)map->handle + (offset - map->offset)); break; case _DRM_SCATTER_GATHER: case _DRM_SHM: phys = vtophys(offset); break; default: DRM_ERROR("bad map type %d\n", type); return -1; /* This should never happen. */ } #if defined(__FreeBSD__) && __FreeBSD_version >= 500102 *paddr = phys; return 0; #else return atop(phys); #endif }