summaryrefslogtreecommitdiff
path: root/linux-core/mga_drv.c
AgeCommit message (Expand)Author
2006-10-20Bug #1746: Set dev_priv_size for the MGA driver.Tilman Sauerbeck
2006-10-14remove config.h from build no longer exists kbuild does itDave Airlie
2006-03-19fix issue in mga from kernelDave Airlie
2005-11-11cleanup ioctl/max_ioctl to use header file for extern symbolsDave Airlie
2005-10-11The Linux 2.6.9 (and earlier) fops structure does not contain aIan Romanick
2005-08-05Rename the driver hooks in the DRM to something a little moreEric Anholt
2005-06-29add mga and r128 32/64 bitsDave Airlie
2005-06-14Adds support for PCI cards to MGA DRMIan Romanick
2005-06-09Completely re-initialize DMA settingsIan Romanick
2005-05-27Modify drm_driver::device_is_agp to return a tri-state value to indicateIan Romanick
2005-05-21Change the MGA initialization and cleanup a bit. The dev_private structureIan Romanick
2005-05-16Added device_is_agp callback to drm_driver. This function is called by theIan Romanick
2004-11-09Fix more build problems on linux-coreJon Smirl
2004-11-06Convert more drivers for bsd-core, moving the ioctl definitions to sharedEric Anholt
2004-10-13Add a poll function that alternates between zero and normal poll return toJon Smirl
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-09-30Lindent of core build. Drivers checked for no binary diffs. A few filesJon Smirl
2004-09-30Make fops per driver instead of global, remove default flush, poll, readJon Smirl
2004-09-27First check in for DRM that splits core from personality modulesJon Smirl
2004-09-231) switches from class_sysfs to drm sysfs implementation to allowJon Smirl
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2003-10-17- Move IRQ functions from drm_dma.h to new drm_irq.h and disentangle themEric Anholt
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
2002-07-05merged bsd-3-0-0-branchAlan Hourihane
2002-04-09Merged drmcommand-0-0-1Jens Owen
2001-07-23Fixes that allow the modules to be built into the kernelJeff Hartmann
2001-07-18Add module version name at a lower layer of the code, allows things to beJeff Hartmann
2001-07-16Added version string to the end of the kernel module name. This allowsJeff Hartmann
2001-03-21- Fix MGA header info.Gareth Hughes
2001-03-19Update version, date stamp.Gareth Hughes
2001-02-16- Clean up the way customization of the templates is done.Gareth Hughes
2001-02-15- Fix up merge.Gareth Hughes
2001-02-15Merge mga-1-0-0-branch into trunk.Gareth Hughes
2001-01-04Sync with Linux 2.4.0-prereleaseRik Faith
2000-12-30add blit ioctl, fix plnwt handlingKeith Whitwell
2000-11-15Sync with Linux 2.4.0-test11-pre5 Provide backward compatibility testedRik Faith
2000-09-29Audit calls to schedule() Remove tags from files shared with Linux kernelRik Faith
2000-09-28Fixed two things Rik pointed out in the last commitJeff Hartmann
2000-09-27Merged the mga-lock-debug-0-2-0-branch with the trunk. This includesJeff Hartmann
2000-09-24commit xfree86 4.0.1d-pre updateAlan Hourihane
2000-09-10Sync with 2.4.0-test8 kernel.Gareth Hughes
2000-09-06Sync with 2.4.0-test8-pre5 kernel.Gareth Hughes
2000-08-31Bump version number after kernel interface change.Keith Whitwell
2000-08-28Add compatibility header file to make Linux 2.4.0 kernel patches cleaner.Rik Faith
2000-08-26Sync with Linux 2.4.0-test7 Add signal blocking support to all driversRik Faith
2000-08-08Sync with Linux 2.4.0-test6-pre8Rik Faith
2000-08-04Sync with Linux 2.4.0-test6-pre2Rik Faith
2000-07-20More fixups for kernel build: EXPORT_SYMTAB warning removalRik Faith
terruptible (lock->queue, atomic_add_unless(&lock->readers, 1, -1)); if (ret) return -EAGAIN; } return 0; } EXPORT_SYMBOL(drm_bo_read_lock); static int __drm_bo_write_unlock(struct drm_bo_lock *lock) { if (unlikely(atomic_cmpxchg(&lock->readers, -1, 0) != -1)) return -EINVAL; if (unlikely(atomic_cmpxchg(&lock->write_lock_pending, 1, 0) != 1)) return -EINVAL; wake_up_interruptible(&lock->queue); return 0; } static void drm_bo_write_lock_remove(struct drm_file *file_priv, struct drm_user_object *item) { struct drm_bo_lock *lock = container_of(item, struct drm_bo_lock, base); int ret; ret = __drm_bo_write_unlock(lock); BUG_ON(ret); } int drm_bo_write_lock(struct drm_bo_lock *lock, struct drm_file *file_priv) { int ret = 0; struct drm_device *dev; if (unlikely(atomic_cmpxchg(&lock->write_lock_pending, 0, 1) != 0)) { return -EINVAL; } while (unlikely(atomic_cmpxchg(&lock->readers, 0, -1) != 0)) { ret = wait_event_interruptible (lock->queue, atomic_cmpxchg(&lock->readers, 0, -1) == 0); if (ret) { atomic_set(&lock->write_lock_pending, 0); wake_up_interruptible(&lock->queue); return -EAGAIN; } } /* * Add a dummy user-object, the destructor of which will * make sure the lock is released if the client dies * while holding it. */ dev = file_priv->head->dev; mutex_lock(&dev->struct_mutex); ret = drm_add_user_object(file_priv, &lock->base, 0); lock->base.remove = &drm_bo_write_lock_remove; lock->base.type = drm_lock_type; if (ret) { (void)__drm_bo_write_unlock(lock); } mutex_unlock(&dev->struct_mutex); return ret; } int drm_bo_write_unlock(struct drm_bo_lock *lock, struct drm_file *file_priv) { struct drm_device *dev = file_priv->head->dev; struct drm_ref_object *ro; mutex_lock(&dev->struct_mutex); if (lock->base.owner != file_priv) { mutex_unlock(&dev->struct_mutex); return -EINVAL; } ro = drm_lookup_ref_object(file_priv, &lock->base, _DRM_REF_USE); BUG_ON(!ro); drm_remove_ref_object(file_priv, ro); lock->base.owner = NULL; mutex_unlock(&dev->struct_mutex); return 0; }