summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2004-10-28fix for 2.4 buildDave Airlie
2004-10-23Round 2 of getting rid of inter_module_get()Jon Smirl
2004-10-23Revert symbol_get() changes from drm_drvJon Smirl
2004-10-23fix inter module put/getDave Airlie
2004-10-23actually 2.6.10 introduced pfn range so it should work now..Dave Airlie
2004-10-23fix pfn vs page for older kernels (2.6.9-rc kernels many not work..)Dave Airlie
2004-10-23Apply radeon r300 microcode patch to non-coreDave Airlie
2004-10-23Prepare to eliminate inter_module_get("agp")Jon Smirl
2004-10-22Bring in patch from kernel for remap_pfn_rangeJon Smirl
2004-10-21Fix up the radeon i2c error handingJon Smirl
2004-10-20Don't release an i2c channel that has not initialized correctlyJon Smirl
2004-10-20Switch linux-core from using dev->pdev->driver->name toJon Smirl
2004-10-20Fix dd vs di version typo in drm_setversionJon Smirl
2004-10-19Add a protective check against a possible buffer overflowJon Smirl
2004-10-19Fix missing I2C busses to be non-fatal error.Jon Smirl
2004-10-19drm-core, Clean up bug error path on stealth mode exitJon Smirl
2004-10-18Update Doxygen configuration & comments.Jose Fonseca
2004-10-16Fixed off by one errors in clipping.Ville Syrjala
2004-10-16Fixed bad formatting.Ville Syrjala
2004-10-15Remove drm_init.cJon Smirl
2004-10-15Move drm_cpu_valid out of drm_init. drm_init is empty now.Jon Smirl
2004-10-15Switch linux-core over to 2.6 parameter model to enable debug useJon Smirl
2004-10-13Add a poll function that alternates between zero and normal poll return toJon Smirl
2004-10-12Via updates. Fixed unlikely but possible uint32_t overflow in ring-bufferThomas Hellstrom
2004-10-12Breakout heads into their own data structures.Jon Smirl
2004-10-10Rename fn_tbl to driver. Core driver now uses pci_driver name whichJon Smirl
2004-10-10Vladimir requested support so we can at least load r300 microcode forDave Airlie
2004-10-10Forgot to add the new MakefileJon Smirl
2004-10-10Make the test programs buildJon Smirl
2004-10-09cleanup VIA driver to look a bit like others before kernel mergeDave Airlie
2004-10-09fix up whitespacing in KconfigDave Airlie
2004-10-09Lindent the via stuff so I can include it in kernelDave Airlie
2004-10-09remove unused dma remnants that were gamma only - these could cause an oopsDave Airlie
2004-10-08Changed unsigned to uint32_t in some ioctl parameters. Introduced firstThomas Hellstrom
2004-10-08Fix refcount bug in stealth modeJon Smirl
2004-10-07Fix drm_exit to allow for DRM(global) being deleted when framebuffer isJon Smirl
2004-10-06Revert back to drm_order() instead of using kernel get_order(). TheJon Smirl
2004-10-05Patch for Kconfig for making i830/i915 not build togetherDave Airlie
2004-10-05enable the device in the right order, remove __devinit from drm_intJon Smirl
2004-10-02janitor-list_for_each-drivers-char-drm-radeon_memc.patch from mm kernelJon Smirl
2004-09-30Make the debug memory functions compile for the core model.Jon Smirl
2004-09-30Remove DRM() macros from core ffb driver. DaveA says he'll make it compileJon Smirl
2004-09-30Lindent of core build. Drivers checked for no binary diffs. A few filesJon Smirl
2004-09-30savage.h not used in core buildsJon Smirl
2004-09-30core ffb.h is not used anymoreJon Smirl
2004-09-30Remove unused drm_module.hJon Smirl
2004-09-30Move things around to reduce public symbols and even out files. Switch toJon Smirl
2004-09-30Make fops per driver instead of global, remove default flush, poll, readJon Smirl
2004-09-28Getting the AGP module is a global resource. Make sure a dual PCI/AGPJon Smirl
2004-09-27Fix the shared directory I accidentally stomped onJon Smirl
K_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 */ DRM_DEBUG("%d\n", context); return 1; } DRM_DEBUG("%d unable to get lock held by %d\n", context, _DRM_LOCKING_CONTEXT(old)); 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); DRM_DEBUG("%d => %d\n", _DRM_LOCKING_CONTEXT(old), context); 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; DRM_DEBUG("%d\n", context); 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); current->state = TASK_INTERRUPTIBLE; add_wait_queue(&q->flush_queue, &entry); atomic_inc(&q->block_count); for (;;) { 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); atomic_inc(&q->total_flushed); /* 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"); copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT); ret = drm_flush_block_and_flush(dev, lock.context, lock.flags); drm_flush_unblock(dev, lock.context, lock.flags); return ret; }