summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/unichrome/xf86drmVIA.h
diff options
context:
space:
mode:
authorThomas Hellström <thomas@tungstengraphics.com>2004-12-15 21:59:25 +0000
committerThomas Hellström <thomas@tungstengraphics.com>2004-12-15 21:59:25 +0000
commit20456d6a3d18970988eedc1ab84ccde13d1ce900 (patch)
treeac22a574bd4360928adc351f193c51440271d339 /src/mesa/drivers/dri/unichrome/xf86drmVIA.h
parentb4f58e99ebfa7d746781b992aca8189821fb26b0 (diff)
Unichrome DRI:
Updated the driver to the new VIA security mechanisms in DRM. All command submissions now passes through DRM ioctls. If the DRM AGP ring-buffer is not enabled, it will use a DRM mechanism for submitting commands to the hardware via a PCI bus mechanism. Removed all direct write accesses to the hardware. Among other things the VQ was previously turned off for the PCI path, apparently for Tuxracer. That seemed unneeded and was removed. No visible impact on Tuxracer. Abstracted all buffer blit operations in via_ioctl.c. The blitter context is now reprogrammed before each blitting operation. Updated driver date and drm version requirement. (Bugzilla Bug #1950, Thomas Hellström)
Diffstat (limited to 'src/mesa/drivers/dri/unichrome/xf86drmVIA.h')
-rw-r--r--src/mesa/drivers/dri/unichrome/xf86drmVIA.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/unichrome/xf86drmVIA.h b/src/mesa/drivers/dri/unichrome/xf86drmVIA.h
index 4b64579336..e8c62bf4a7 100644
--- a/src/mesa/drivers/dri/unichrome/xf86drmVIA.h
+++ b/src/mesa/drivers/dri/unichrome/xf86drmVIA.h
@@ -25,6 +25,19 @@
#ifndef __XF86DRI_VIA_H__
#define __XF86DRI_VIA_H__
+#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
+
typedef struct {
unsigned long sarea_priv_offset;
unsigned long fb_offset;
@@ -45,10 +58,44 @@ typedef struct {
unsigned long *address;
} drmVIADMABuf;
+typedef struct {
+ char *buf;
+ unsigned long size;
+} drmVIACommandBuffer;
+
+typedef struct {
+ enum {
+ VIA_CMDBUF_SPACE = 0x01,
+ VIA_CMDBUF_LAG = 0x02
+ } func;
+ int wait;
+ unsigned size;
+} drmVIACmdBufSize;
+
+typedef struct {
+ unsigned int offset;
+ unsigned int size;
+ unsigned long index;
+ int discard; /* client is finished with the buffer? */
+} drmVIAFlush;
+
+typedef struct{
+ enum {
+ VIA_INIT_DMA = 0x01,
+ VIA_CLEANUP_DMA = 0x02,
+ VIA_DMA_INITIALIZED = 0x03
+ } func;
+
+ unsigned long offset;
+ unsigned long size;
+ unsigned long reg_pause_addr;
+} drmVIADMAInit;
+
extern int drmVIAAgpInit(int fd, int offset, int size);
extern int drmVIAFBInit(int fd, int offset, int size);
extern int drmVIAInitMAP(int fd, drmVIAInit *info);
extern int drmVIAAllocateDMA(int fd, drmVIADMABuf *buf);
extern int drmVIAReleaseDMA(int fd, drmVIADMABuf *buf);
+
#endif