summaryrefslogtreecommitdiff
path: root/shared-core/radeon_drm.h
AgeCommit message (Expand)Author
2007-07-16drm: detypedef drm.h and fixup all problemsDave Airlie
2007-06-03radeon: add support for vblank on crtc2Dave Airlie
2007-03-04radeon: make PCI GART aperture size variable, but making table size variableDave Airlie
2006-05-24Add support for r200 vertex programs (R200_EMIT_VAP_PVS_CNTL, and newRoland Scheidegger
2006-03-06Add general-purpose packet for manipulating scratch registers (r300)Aapo Tahkola
2006-02-18add benh's memory management patchDave Airlie
2006-02-18major realigment of DRM CVS with kernel code, makes integration much easierDave Airlie
2005-12-29add radeon card type get param so userspace can avoid walking PCIDave Airlie
2005-09-30fix pci overriding from userspaceDave Airlie
2005-09-11Add GART in FB support for ati pcigart, and PCIE support for r300Dave Airlie
2005-09-09Add support for GL_ATI_fragment_shader, new packets R200_EMIT_PP_AFS_0/1,Roland Scheidegger
2005-08-04Mark some radeon init variables deprecated. These used to be passed in butJon Smirl
2005-07-20Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya,Eric Anholt
2005-03-15add R200_EMIT_PP_TRI_PERF_CNTL packet to support brilinear filtering onRoland Scheidegger
2005-02-10add support for texture micro tiling on radeon/r200. Add support for r100Roland Scheidegger
2005-01-26(Stephane Marchesin,me) Add radeon framebuffer tiling support to radeonRoland Scheidegger
2004-12-08(Stephane Marchesin, me) add hyperz support to radeon drm. Only fast zRoland Scheidegger
2004-10-10Vladimir requested support so we can at least load r300 microcode forDave Airlie
2004-09-30Lindent of core build. Drivers checked for no binary diffs. A few filesJon Smirl
2004-08-17preparation patch for radeon permanent mapping registers/framebuffer makesDave Airlie
2004-07-25sync up with current 2.6 kernel bk tree - mostly __user annotationsDave Airlie
2004-05-18add R200_EMIT_RB3D_BLENDCOLOR state packet to support GL_EXT_blend_color,Roland Scheidegger
2004-04-10white space changes to align with kernelDave Airlie
2004-03-12Fixes need to clean up the mess I made with the mesa merge. This codeJon Smirl
2003-11-04Memory layout transition:Michel Daenzer
2003-08-26Remove artificial PCI GART limitations, rename AGP to GART whereMichel Daenzer
2003-08-08Added some information as to when (which DRM version) various queries wereIan Romanick
2003-06-10Texture rectangle support for r100Keith Whitwell
2003-05-20DRM part of Radeon DRI suspend/resume support (Charl Botha).David Dawes
2003-04-30Merged texmem-0-0-1Ian Romanick
2003-04-22add more get_param queries for embedded projectKeith Whitwell
2003-02-21Merge from bsd-4-0-0-branch.Eric Anholt
2003-02-03Fix size of VERTEX2 ioctl struct (Egbert Eich)Keith Whitwell
2002-10-29updated e-mail addresses for Keith, Alan and JensJens Owen
2002-10-29preserve CRTC{,2}_OFFSET_CNTL in 2D driver to avoid bad effects whenMichel Daenzer
2002-10-28merge from mesa-4-1-branch to get cube-map registers. bumped version to 1.7Brian Paul
2002-09-25change RADEON_PARAM_IRQ_ACTIVE to RADEON_PARAM_IRQ_NRMichel Daenzer
2002-09-23merged r200-0-2-branch to trunkKeith Whitwell
2002-08-26merged r200-0-1-branchKeith Whitwell
2002-07-11Don't read scratch registers directly, obtain the values via the GET_PARAMMichel Daenzer
2002-07-05merged bsd-3-0-0-branchAlan Hourihane
class="hl kwd">DRM_DEBUG("\n"); return 0; } int DRM(unblock)(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { DRM_DEBUG("\n"); return 0; } int DRM(lock_take)(__volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new, prev; do { old = *lock; if (old & _DRM_LOCK_HELD) new = old | _DRM_LOCK_CONT; else new = context | _DRM_LOCK_HELD; prev = cmpxchg(lock, old, new); } while (prev != old); if (_DRM_LOCKING_CONTEXT(old) == context) { if (old & _DRM_LOCK_HELD) { if (context != DRM_KERNEL_CONTEXT) { DRM_ERROR("%d holds heavyweight lock\n", context); } return 0; } } if (new == (context | _DRM_LOCK_HELD)) { /* Have lock */ return 1; } return 0; } /* This takes a lock forcibly and hands it to context. Should ONLY be used inside *_unlock to give lock to kernel before calling *_dma_schedule. */ int DRM(lock_transfer)(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new, prev; dev->lock.pid = 0; do { old = *lock; new = context | _DRM_LOCK_HELD; prev = cmpxchg(lock, old, new); } while (prev != old); return 1; } int DRM(lock_free)(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new, prev; pid_t pid = dev->lock.pid; dev->lock.pid = 0; do { old = *lock; new = 0; prev = cmpxchg(lock, old, new); } while (prev != old); if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { DRM_ERROR("%d freed heavyweight lock held by %d (pid %d)\n", context, _DRM_LOCKING_CONTEXT(old), pid); return 1; } wake_up_interruptible(&dev->lock.lock_queue); return 0; } 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; } /* If we get here, it means that the process has called DRM_IOCTL_LOCK without calling DRM_IOCTL_UNLOCK. If the lock is not held, then let the signal proceed as usual. If the lock is held, then set the contended flag and keep the signal blocked. Return 1 if the signal should be delivered normally. Return 0 if the signal should be blocked. */ int DRM(notifier)(void *priv) { drm_sigdata_t *s = (drm_sigdata_t *)priv; unsigned int old, new, prev; /* Allow signal delivery if lock isn't held */ if (!_DRM_LOCK_IS_HELD(s->lock->lock) || _DRM_LOCKING_CONTEXT(s->lock->lock) != s->context) return 1; /* Otherwise, set flag to force call to drmUnlock */ do { old = s->lock->lock; new = old | _DRM_LOCK_CONT; prev = cmpxchg(&s->lock->lock, old, new); } while (prev != old); return 0; }