summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2005-03-14 22:50:21 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2005-03-14 22:50:21 +0000
commitd2fd9200956a94cfd91a39e76994f326bdfc6ac0 (patch)
tree9151ee4ea20c3ea53be1370b058afec101858b54 /shared-core
parenta396617dbc15abafdc172b972a02c04007ad579f (diff)
via changes:
1. Initialize futex locks to zero on device init. 2. Remove some stray defines from via_drm.h 3. Prepare via_drm.h for drm client inclusion. The goal is to share a common file with common definitions. 4. Sync shared / shared-core via_drm.h 5. Bump minor, because of the futex lock initialization.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/via_drm.h15
-rw-r--r--shared-core/via_drv.h6
-rw-r--r--shared-core/via_map.c7
-rw-r--r--shared-core/via_mm.c7
4 files changed, 19 insertions, 16 deletions
diff --git a/shared-core/via_drm.h b/shared-core/via_drm.h
index b4c11dab..f3b4a28a 100644
--- a/shared-core/via_drm.h
+++ b/shared-core/via_drm.h
@@ -31,18 +31,19 @@
#ifndef _VIA_DEFINES_
#define _VIA_DEFINES_
-#define VIA_DMA_BUF_ORDER 12
-#define VIA_DMA_BUF_SZ (1 << VIA_DMA_BUF_ORDER)
-#define VIA_DMA_BUF_NR 256
+#ifndef __KERNEL__
+#include "via_drmclient.h"
+#endif
+
#define VIA_NR_SAREA_CLIPRECTS 8
#define VIA_NR_XVMC_PORTS 10
#define VIA_NR_XVMC_LOCKS 5
#define VIA_MAX_CACHELINE_SIZE 64
#define XVMCLOCKPTR(saPriv,lockNo) \
- ((volatile int *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
- (VIA_MAX_CACHELINE_SIZE - 1)) & \
- ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
- VIA_MAX_CACHELINE_SIZE*(lockNo)))
+ ((volatile drm_hw_lock_t *)(((((unsigned long) (saPriv)->XvMCLockArea) + \
+ (VIA_MAX_CACHELINE_SIZE - 1)) & \
+ ~(VIA_MAX_CACHELINE_SIZE - 1)) + \
+ VIA_MAX_CACHELINE_SIZE*(lockNo)))
/* Each region is a minimum of 64k, and there are at most 64 of them.
*/
diff --git a/shared-core/via_drv.h b/shared-core/via_drv.h
index 399474bf..00382e5d 100644
--- a/shared-core/via_drv.h
+++ b/shared-core/via_drv.h
@@ -28,11 +28,11 @@
#define DRIVER_NAME "via"
#define DRIVER_DESC "VIA Unichrome"
-#define DRIVER_DATE "20050214"
+#define DRIVER_DATE "20050314"
#define DRIVER_MAJOR 2
-#define DRIVER_MINOR 4
-#define DRIVER_PATCHLEVEL 6
+#define DRIVER_MINOR 5
+#define DRIVER_PATCHLEVEL 0
#include "via_verifier.h"
diff --git a/shared-core/via_map.c b/shared-core/via_map.c
index 51868dbe..50ca96cb 100644
--- a/shared-core/via_map.c
+++ b/shared-core/via_map.c
@@ -67,8 +67,10 @@ static int via_do_init_map(drm_device_t * dev, drm_via_init_t * init)
dev_priv->agpAddr = init->agpAddr;
- for (i = 0; i < VIA_NR_XVMC_LOCKS; ++i)
+ for (i = 0; i < VIA_NR_XVMC_LOCKS; ++i) {
DRM_INIT_WAITQUEUE(&(dev_priv->decoder_queue[i]));
+ XVMCLOCKPTR(dev_priv->sarea_priv, i)->lock = 0;
+ }
dev->dev_private = (void *)dev_priv;
@@ -109,6 +111,7 @@ int via_map_init(DRM_IOCTL_ARGS)
return -EINVAL;
}
+
int via_decoder_futex(DRM_IOCTL_ARGS)
{
DRM_DEVICE;
@@ -123,7 +126,7 @@ int via_decoder_futex(DRM_IOCTL_ARGS)
if (fx.lock > VIA_NR_XVMC_LOCKS)
return -EFAULT;
- lock = XVMCLOCKPTR(sAPriv, fx.lock);
+ lock = (int *)XVMCLOCKPTR(sAPriv, fx.lock);
switch (fx.func) {
case VIA_FUTEX_WAIT:
diff --git a/shared-core/via_mm.c b/shared-core/via_mm.c
index 7477db1e..5cead8c4 100644
--- a/shared-core/via_mm.c
+++ b/shared-core/via_mm.c
@@ -179,10 +179,9 @@ int via_final_context(struct drm_device *dev, int context)
*/
for (i=0; i < VIA_NR_XVMC_LOCKS; ++i) {
- lock = XVMCLOCKPTR(sAPriv, i);
- if ( (_DRM_LOCKING_CONTEXT( *lock ) == context) &&
- (_DRM_LOCK_IS_HELD( *lock ))) {
- if ( *lock & _DRM_LOCK_CONT) {
+ 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;