summaryrefslogtreecommitdiff
path: root/shared-core/nouveau_drv.h
AgeCommit message (Expand)Author
2007-11-14Revert "nouveau: stub superioctl"Ben Skeggs
2007-11-14Merge branch 'fifo-cleanup' into upstream-masterBen Skeggs
2007-11-14nouveau: store user control reg offsets in channel structBen Skeggs
2007-11-14nouveau: funcs to determine active channel on PFIFO.Ben Skeggs
2007-11-14nouveau: stub superioctlBen Skeggs
2007-11-05drm: remove lots of spurious whitespace.Dave Airlie
2007-11-05nouveau: cleanupsBen Skeggs
2007-11-05nouveau: crappy ttm mm init, disabled for now.Ben Skeggs
2007-11-02nouveau: put it all together.Jeremy Kolb
2007-10-31nouveau: ttm stubsJeremy Kolb
2007-09-30nouveau: rename nv30_graph.c to nv20_graph.cPekka Paalanen
2007-09-30nouveau: nv30 graph function renames, removed nv20_graph.cPekka Paalanen
2007-09-30nouveau : pgraph_ctx dynamic alloc for nv04, nv10Matthieu Castet
2007-08-15nouveau: Allow GART notifiers when using sgdma code.Ben Skeggs
2007-08-15nouveau/nv40: Fix channel scheduling.Ben Skeggs
2007-08-10nouveau/nv50: demagic instmem setup.Ben Skeggs
2007-08-10nouveau: Allow creation of gpuobjs before any other init has taken place.Ben Skeggs
2007-08-08nouveau: Always allocate drm's push buffer in VRAMBen Skeggs
2007-08-06nouveau: Give DRM its own gpu channelBen Skeggs
2007-08-06nouveau: Various internal and external API changesBen Skeggs
2007-08-06nouveau: Pass channel struct around instead of channel id.Ben Skeggs
2007-07-20Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.Eric Anholt
2007-07-20Replace filp in ioctl arguments with drm_file *file_priv.Eric Anholt
2007-07-18nouveau: Add read() method to Engine.timer.Pekka Paalanen
2007-07-17nouveau: G8x PCIEGARTBen Skeggs
2007-07-13nouveau: nuke internal typedefs, and drm_device_t use.Ben Skeggs
2007-07-12nouveau: separate region_offset into map_handle and offset.Ben Skeggs
2007-07-11Added support for PCIGART for PCI(E) cards. Bumped DRM interface patchlevel.Arthur Huillet
2007-07-09nouveau: Avoid oopsBen Skeggs
2007-07-09nouveau/nv50: Initial channel/object supportBen Skeggs
2007-07-09nouveau: rewrite gpu object codeBen Skeggs
2007-06-28nouveau: never touch PRAMIN with NV_WRITE, cleanup RAMHT code a bitBen Skeggs
2007-06-28nouveau: simplify PRAMIN accessBen Skeggs
2007-06-28nouveau/nv50: skeletal backendBen Skeggs
2007-06-28nouveau: Nuke DMA_OBJECT_INIT ioctl (bumps interface to 0.0.7)Ben Skeggs
2007-06-24nouveau: NV04/NV10/NV20 PGRAPH engtab functionsBen Skeggs
2007-06-24nouveau: NV3X PGRAPH engtab functionsBen Skeggs
2007-06-24nouveau: NV1X/2X/3X PFIFO engtab functionsBen Skeggs
2007-06-24nouveau: NV04 PFIFO engtab functionsBen Skeggs
2007-06-24nouveau: NV4X PGRAPH engtab functionsBen Skeggs
2007-06-24nouveau: NV4X PFIFO engtab functionsBen Skeggs
2007-06-24nouveau: (mostly) hook up put_base againBen Skeggs
2007-06-24nouveau: prototype PFIFO/PGRAPH engtab APIBen Skeggs
2007-06-24nouveau: rename engtab functionsBen Skeggs
2007-03-26nouveau: move card initialisation into the drmBen Skeggs
2007-03-23nouveau: remove unused cruftBen Skeggs
2007-03-21nouveau: support multiple channels per client (breaks drm interface)Ben Skeggs
2007-03-13nouveau: make sure cmdbuf object gets destroyedBen Skeggs
2007-03-13nouveau: associate all created objects with a channel + cleanupsBen Skeggs
2007-02-28nouveau: intrusive drm interface changesBen Skeggs
(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; }