summaryrefslogtreecommitdiff
path: root/shared-core/via_mm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2005-03-28 21:21:42 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2005-03-28 21:21:42 +0000
commit532ccb98b5f2946f574a747b90c39edbe783f888 (patch)
treecfbdf4e8e2b8e0827b35b92a7e57e7f6104e18f1 /shared-core/via_mm.c
parentc6161eff86b250f3113791edcc162dc97322c401 (diff)
Via updates:
New PCI command parser. Moved from via_dma.c to via_verifier.c so functions with similar functionality are close to eachother. Moved video related functions to via_video.c, which might be extended in the future, as new video functionality is added. New device-specific generic IRQ IOCTL, similar to the general VBLANK IOCTL, but with support for multiple device IRQ sources and functionality. Support for Unichrome Pro PM800/CN400 video DMA commands in verifier and PCI parser. Support for Unichrome Pro PM800/CN400 HQV IRQs in the new generic IRQ IOCTL. Bumped minor. New version 2.6.0.
Diffstat (limited to 'shared-core/via_mm.c')
-rw-r--r--shared-core/via_mm.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/shared-core/via_mm.c b/shared-core/via_mm.c
index 5cead8c4..cf286b49 100644
--- a/shared-core/via_mm.c
+++ b/shared-core/via_mm.c
@@ -135,9 +135,7 @@ int via_init_context(struct drm_device *dev, int context)
int via_final_context(struct drm_device *dev, int context)
{
int i;
- volatile int *lock;
drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
- drm_via_sarea_t *sAPriv = dev_priv->sarea_priv;
for (i = 0; i < MAX_CONTEXT; i++)
if (global_ppriv[i].used &&
@@ -170,23 +168,10 @@ int via_final_context(struct drm_device *dev, int context)
retval = via_setNext(set, &item);
}
via_setDestroy(set);
-
global_ppriv[i].used = 0;
}
+ via_release_futex(dev_priv, context);
- /*
- * Release futex locks.
- */
-
- for (i=0; i < VIA_NR_XVMC_LOCKS; ++i) {
- lock = (int *) XVMCLOCKPTR(sAPriv, i);
- if ( (_DRM_LOCKING_CONTEXT( *lock ) == context)) {
- if (_DRM_LOCK_IS_HELD( *lock ) && (*lock & _DRM_LOCK_CONT)) {
- DRM_WAKEUP( &(dev_priv->decoder_queue[i]));
- }
- *lock = 0;
- }
- }
#if defined(__linux__)
/* Linux specific until context tracking code gets ported to BSD */
@@ -196,6 +181,7 @@ int via_final_context(struct drm_device *dev, int context)
if (dev->irq)
drm_irq_uninstall(dev);
+ via_cleanup_futex(dev_priv);
via_do_cleanup_map(dev);
}
#endif
@@ -208,6 +194,7 @@ int via_mem_alloc(DRM_IOCTL_ARGS)
drm_via_mem_t mem;
DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem));
+
switch (mem.type) {
case VIDEO:
if (via_fb_alloc(&mem) < 0)