summaryrefslogtreecommitdiff
path: root/shared/via_drm.h
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/via_drm.h
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/via_drm.h')
-rw-r--r--shared/via_drm.h77
1 files changed, 39 insertions, 38 deletions
diff --git a/shared/via_drm.h b/shared/via_drm.h
index 2327bec5..f3b4a28a 100644
--- a/shared/via_drm.h
+++ b/shared/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.
*/
@@ -60,18 +61,31 @@
#define VIA_UPLOAD_ALL 0xff
/* VIA specific ioctls */
-#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(0x40, drm_via_mem_t)
-#define DRM_IOCTL_VIA_FREEMEM DRM_IOW(0x41, drm_via_mem_t)
-#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(0x42, drm_via_agp_t)
-#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(0x43, drm_via_fb_t)
-#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(0x44, drm_via_init_t)
-#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW(0x45, drm_via_futex_t)
-#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(0x47, drm_via_dma_init_t)
-#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW(0x48, drm_via_cmdbuffer_t)
-#define DRM_IOCTL_VIA_FLUSH DRM_IO(0x49)
-#define DRM_IOCTL_VIA_PCICMD DRM_IOW(0x4A, drm_via_cmdbuffer_t)
-#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR(0x4B, drm_via_cmdbuf_size_t)
-
+#define DRM_VIA_ALLOCMEM 0x00
+#define DRM_VIA_FREEMEM 0x01
+#define DRM_VIA_AGP_INIT 0x02
+#define DRM_VIA_FB_INIT 0x03
+#define DRM_VIA_MAP_INIT 0x04
+#define DRM_VIA_DEC_FUTEX 0x05
+#define NOT_USED
+#define DRM_VIA_DMA_INIT 0x07
+#define DRM_VIA_CMDBUFFER 0x08
+#define DRM_VIA_FLUSH 0x09
+#define DRM_VIA_PCICMD 0x0a
+#define DRM_VIA_CMDBUF_SIZE 0x0b
+
+#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
+#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
+#define DRM_IOCTL_VIA_AGP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_AGP_INIT, drm_via_agp_t)
+#define DRM_IOCTL_VIA_FB_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_FB_INIT, drm_via_fb_t)
+#define DRM_IOCTL_VIA_MAP_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_MAP_INIT, drm_via_init_t)
+#define DRM_IOCTL_VIA_DEC_FUTEX DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_DEC_FUTEX, drm_via_futex_t)
+#define DRM_IOCTL_VIA_DMA_INIT DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_DMA_INIT, drm_via_dma_init_t)
+#define DRM_IOCTL_VIA_CMDBUFFER DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_CMDBUFFER, drm_via_cmdbuffer_t)
+#define DRM_IOCTL_VIA_FLUSH DRM_IO( DRM_COMMAND_BASE + DRM_VIA_FLUSH)
+#define DRM_IOCTL_VIA_PCICMD DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_PCICMD, drm_via_cmdbuffer_t)
+#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
+ drm_via_cmdbuf_size_t)
/* Indices into buf.Setup where various bits of state are mirrored per
* context and per buffer. These can be fired at the card as a unit,
@@ -89,19 +103,19 @@
#define VIDEO 0
#define AGP 1
typedef struct {
- unsigned long offset;
- unsigned long size;
+ uint32_t offset;
+ uint32_t size;
} drm_via_agp_t;
typedef struct {
- unsigned long offset;
- unsigned long size;
+ uint32_t offset;
+ uint32_t size;
} drm_via_fb_t;
typedef struct {
uint32_t context;
uint32_t type;
- unsigned long size;
+ uint32_t size;
unsigned long index;
unsigned long offset;
} drm_via_mem_t;
@@ -177,20 +191,6 @@ typedef struct _drm_via_sarea {
} drm_via_sarea_t;
-typedef struct _drm_via_flush_agp {
- unsigned int offset;
- unsigned int size;
- unsigned int index;
- int discard; /* client is finished with the buffer? */
-} drm_via_flush_agp_t;
-
-typedef struct _drm_via_flush_sys {
- unsigned int offset;
- unsigned int size;
- unsigned long index;
- int discard; /* client is finished with the buffer? */
-} drm_via_flush_sys_t;
-
typedef struct _drm_via_cmdbuf_size {
enum {
VIA_CMDBUF_SPACE = 0x01,
@@ -200,6 +200,7 @@ typedef struct _drm_via_cmdbuf_size {
uint32_t size;
} drm_via_cmdbuf_size_t;
+
#ifdef __KERNEL__
int via_fb_init(DRM_IOCTL_ARGS);