diff options
author | Thomas Hellstrom <unichrome@shipmail.org> | 2005-01-05 17:44:43 +0000 |
---|---|---|
committer | Thomas Hellstrom <unichrome@shipmail.org> | 2005-01-05 17:44:43 +0000 |
commit | e34b5601912ce4b611d429304d5271fcf6f9f457 (patch) | |
tree | 5835a51eb1d597af63de599a6f0846a85be3d7b0 /shared-core/via_mm.c | |
parent | 094f02c568fb2096a93b30adf291f82e0b87bbce (diff) |
VIA update:
Release video futexes when context is destroyed (This was previously done
by the X server).
Added New Unichrome Pro VIDEO DMA commands to the verifier.
Added Quiescent heavyweight lock mode.
Diffstat (limited to 'shared-core/via_mm.c')
-rw-r--r-- | shared-core/via_mm.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/shared-core/via_mm.c b/shared-core/via_mm.c index 5199f6c9..5940de70 100644 --- a/shared-core/via_mm.c +++ b/shared-core/via_mm.c @@ -130,8 +130,12 @@ int via_init_context(struct drm_device *dev, int context) } int via_final_context(struct drm_device *dev, int context) -{ - int i; +{ + 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 && (global_ppriv[i].context == context)) @@ -166,6 +170,22 @@ int via_final_context(struct drm_device *dev, int context) global_ppriv[i].used = 0; } + + /* + * Release futex locks. + */ + + for (i=0; i < VIA_NR_XVMC_LOCKS; ++i) { + lock = XVMCLOCKPTR(sAPriv, i); + if ( (_DRM_LOCKING_CONTEXT( *lock ) == i) && + (_DRM_LOCK_IS_HELD( *lock ))) { + if ( *lock & _DRM_LOCK_CONT) { + DRM_WAKEUP( &(dev_priv->decoder_queue[i])); + } + *lock &= ~( _DRM_LOCK_HELD | _DRM_LOCK_CONT ); + } + } + #if defined(__linux__) /* Linux specific until context tracking code gets ported to BSD */ /* Last context, perform cleanup */ |