summaryrefslogtreecommitdiff
path: root/shared-core/via_drv.h
diff options
context:
space:
mode:
authorErdi Chen <erdi@freedesktop.org>2004-08-24 01:44:37 +0000
committerErdi Chen <erdi@freedesktop.org>2004-08-24 01:44:37 +0000
commit25e319c1ef5b6c002ddfe55338cd920240cc1dad (patch)
tree92c13df2e866d7d70016b11cfc9316993431d420 /shared-core/via_drv.h
parent7fe4f607681e9a5593e91915953a9b6c45e5f08c (diff)
This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:
DRM_IOCTL_VIA_DMA_INIT DRM_IOCTL_VIA_CMDBUFFER DRM_IOCTL_VIA_FLUSH The first ioctl sets up an area in AGP memory that will be used as the ring buffer. The second ioctl copies a command buffer from user space memory to the ring buffer. The third ioctl waits for engine idle until it returns. The motivation for this patch is to avoid the wait for engine idle call before each buffer flush in the current DRI driver. With this patch, the DRI driver can continue to flush its buffer as long as there is free space in the ring buffer. This patch adds an additional copy operation on the command buffer. This buffer copying is necessary to support multiple DRI clients rendering simultaneously. Otherwise, more CPU time will be spent in the busy loop waiting for engine idle between DRI context switch. Even in the single client case, the tradeoff is reasonable in comparision to the kernel call to check for free buffer space for the client to render directly to the ring buffer.
Diffstat (limited to 'shared-core/via_drv.h')
-rw-r--r--shared-core/via_drv.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/shared-core/via_drv.h b/shared-core/via_drv.h
index 9677b7f3..582eb6de 100644
--- a/shared-core/via_drv.h
+++ b/shared-core/via_drv.h
@@ -27,6 +27,11 @@
#include "via_drm.h"
+typedef struct drm_via_ring_buffer {
+ drm_map_t map;
+ char * virtual_start;
+} drm_via_ring_buffer_t;
+
typedef struct drm_via_private {
drm_via_sarea_t *sarea_priv;
drm_map_t *sarea;
@@ -34,6 +39,13 @@ typedef struct drm_via_private {
drm_map_t *mmio;
unsigned long agpAddr;
wait_queue_head_t decoder_queue[VIA_NR_XVMC_LOCKS];
+ char * dma_ptr;
+ unsigned int dma_low;
+ unsigned int dma_high;
+ unsigned int dma_offset;
+ uint32_t * last_pause_ptr;
+ volatile uint32_t * hw_addr_ptr;
+ drm_via_ring_buffer_t ring;
} drm_via_private_t;
@@ -53,4 +65,6 @@ extern int via_do_cleanup_map(drm_device_t *dev);
extern int via_map_init(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg);
+extern int via_dma_cleanup(drm_device_t *dev);
+
#endif