summaryrefslogtreecommitdiff
path: root/linux/drm_agpsupport.h
AgeCommit message (Expand)Author
2004-08-27__NO_VERSION__ hasn't been needed since 2.3 days ditch it...Dave Airlie
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2004-07-20first set of __user annotations from kernel (Al Viro)Dave Airlie
2004-02-28More differentiated error codes for DRM(agp_acquire)Michel Daenzer
2003-08-15Merge from 2.6 kernel (Linus Torvalds)Michel Daenzer
2003-07-25Compile fixes for recent 2.5/2.6 Linux kernels. I hope this doesn't breakMichel Daenzer
2003-07-25Fail in DRM(agp_acquire) if the AGP aperture can't be used, such that the XMichel Daenzer
2003-07-09DA: fix for bug 484 in Bugzilla, originally from me, reworked by DavidDave Airlie
2003-06-19Revert the janitorial - that works is now on the new branchJose Fonseca
2003-06-03Split declarations/definitions in drm_scatter.h into drm_sg.h/drm_sg_tmp.hJose Fonseca
2003-05-27Merged DRM documentation.Jose Fonseca
2003-04-17Bring some drm module changes over from the XFree86 trunk:David Dawes
2003-03-25linux merge for drmAlan Hourihane
2002-12-11remove agpgart informationalKeith Whitwell
2002-08-22Don't (re)define vmalloc_to_page for kernel >= 2.4.19, as it has beenLeif Delgass
2001-12-10merge with linux kernel 2.4.15Alan Hourihane
2001-09-25merge with 2.4.10 kernelAlan Hourihane
2001-08-19No one's maintaining 2.2.x support - so remove all the cruft.Alan Hourihane
2001-08-08Update to the code I sent Linus and Alan this morning. Added some missingJeff Hartmann
2001-05-01Import of XFree86 4.0.99.3David Dawes
2001-04-09Import -f XFree86 4.0.99.2David Dawes
2001-04-05Merged ati-pcigart-1-0-0Kevin E Martin
2001-03-04Don't try and setup the MTRR for AGP when AGP not available. CheckAlan Hourihane
2001-02-15Merge mga-1-0-0-branch into trunk.Gareth Hughes
OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Authors: * Rickard E. (Rik) Faith <faith@valinux.com> * Gareth Hughes <gareth@valinux.com> */ /* Gamma-specific code extracted from drm_lock.h: */ static int DRM(flush_queue)(drm_device_t *dev, int context) { DECLARE_WAITQUEUE(entry, current); int ret = 0; drm_queue_t *q = dev->queuelist[context]; DRM_DEBUG("\n"); atomic_inc(&q->use_count); if (atomic_read(&q->use_count) > 1) { atomic_inc(&q->block_write); add_wait_queue(&q->flush_queue, &entry); atomic_inc(&q->block_count); for (;;) { current->state = TASK_INTERRUPTIBLE; if (!DRM_BUFCOUNT(&q->waitlist)) break; schedule(); if (signal_pending(current)) { ret = -EINTR; /* Can't restart */ break; } } atomic_dec(&q->block_count); current->state = TASK_RUNNING; remove_wait_queue(&q->flush_queue, &entry); } atomic_dec(&q->use_count); /* NOTE: block_write is still incremented! Use drm_flush_unlock_queue to decrement. */ return ret; } static int DRM(flush_unblock_queue)(drm_device_t *dev, int context) { drm_queue_t *q = dev->queuelist[context]; DRM_DEBUG("\n"); atomic_inc(&q->use_count); if (atomic_read(&q->use_count) > 1) { if (atomic_read(&q->block_write)) { atomic_dec(&q->block_write); wake_up_interruptible(&q->write_queue); } } atomic_dec(&q->use_count); return 0; } int DRM(flush_block_and_flush)(drm_device_t *dev, int context, drm_lock_flags_t flags) { int ret = 0; int i; DRM_DEBUG("\n"); if (flags & _DRM_LOCK_FLUSH) { ret = DRM(flush_queue)(dev, DRM_KERNEL_CONTEXT); if (!ret) ret = DRM(flush_queue)(dev, context); } if (flags & _DRM_LOCK_FLUSH_ALL) { for (i = 0; !ret && i < dev->queue_count; i++) { ret = DRM(flush_queue)(dev, i); } } return ret; } int DRM(flush_unblock)(drm_device_t *dev, int context, drm_lock_flags_t flags) { int ret = 0; int i; DRM_DEBUG("\n"); if (flags & _DRM_LOCK_FLUSH) { ret = DRM(flush_unblock_queue)(dev, DRM_KERNEL_CONTEXT); if (!ret) ret = DRM(flush_unblock_queue)(dev, context); } if (flags & _DRM_LOCK_FLUSH_ALL) { for (i = 0; !ret && i < dev->queue_count; i++) { ret = DRM(flush_unblock_queue)(dev, i); } } return ret; } int DRM(finish)(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; int ret = 0; drm_lock_t lock; DRM_DEBUG("\n"); if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock))) return -EFAULT; ret = DRM(flush_block_and_flush)(dev, lock.context, lock.flags); DRM(flush_unblock)(dev, lock.context, lock.flags); return ret; }