aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/via_drm.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-11-12 05:52:46 -0500
committerDave Airlie <airlied@linux.ie>2005-11-12 05:52:46 -0500
commit925142431bd653175b80ae153bd7a8bc13628bde (patch)
tree594c1e65d3bf25b10961ea2b97dee5704b4f6cb5 /drivers/char/drm/via_drm.h
parent792d2b9a12594522111fbe2a7f17460a4d7edff7 (diff)
drm: update VIA driver to 2.7.2
Add PCI DMA blitengine to VIA DRM Add portability code for porting VIA to FreeBSD. Sync via_drm.h with 3d driver From: Thomas Hellstrom <unichrome@shipmail.org>, Eric Anholt <anholt@freebsd.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/via_drm.h')
-rw-r--r--drivers/char/drm/via_drm.h60
1 files changed, 43 insertions, 17 deletions
diff --git a/drivers/char/drm/via_drm.h b/drivers/char/drm/via_drm.h
index ebde9206115e..556d80722fd0 100644
--- a/drivers/char/drm/via_drm.h
+++ b/drivers/char/drm/via_drm.h
@@ -75,6 +75,8 @@
75#define DRM_VIA_CMDBUF_SIZE 0x0b 75#define DRM_VIA_CMDBUF_SIZE 0x0b
76#define NOT_USED 76#define NOT_USED
77#define DRM_VIA_WAIT_IRQ 0x0d 77#define DRM_VIA_WAIT_IRQ 0x0d
78#define DRM_VIA_DMA_BLIT 0x0e
79#define DRM_VIA_BLIT_SYNC 0x0f
78 80
79#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t) 81#define DRM_IOCTL_VIA_ALLOCMEM DRM_IOWR(DRM_COMMAND_BASE + DRM_VIA_ALLOCMEM, drm_via_mem_t)
80#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t) 82#define DRM_IOCTL_VIA_FREEMEM DRM_IOW( DRM_COMMAND_BASE + DRM_VIA_FREEMEM, drm_via_mem_t)
@@ -89,6 +91,8 @@
89#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \ 91#define DRM_IOCTL_VIA_CMDBUF_SIZE DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_CMDBUF_SIZE, \
90 drm_via_cmdbuf_size_t) 92 drm_via_cmdbuf_size_t)
91#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t) 93#define DRM_IOCTL_VIA_WAIT_IRQ DRM_IOWR( DRM_COMMAND_BASE + DRM_VIA_WAIT_IRQ, drm_via_irqwait_t)
94#define DRM_IOCTL_VIA_DMA_BLIT DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_DMA_BLIT, drm_via_dmablit_t)
95#define DRM_IOCTL_VIA_BLIT_SYNC DRM_IOW(DRM_COMMAND_BASE + DRM_VIA_BLIT_SYNC, drm_via_blitsync_t)
92 96
93/* Indices into buf.Setup where various bits of state are mirrored per 97/* Indices into buf.Setup where various bits of state are mirrored per
94 * context and per buffer. These can be fired at the card as a unit, 98 * context and per buffer. These can be fired at the card as a unit,
@@ -103,8 +107,12 @@
103#define VIA_BACK 0x2 107#define VIA_BACK 0x2
104#define VIA_DEPTH 0x4 108#define VIA_DEPTH 0x4
105#define VIA_STENCIL 0x8 109#define VIA_STENCIL 0x8
106#define VIDEO 0 110#define VIA_MEM_VIDEO 0 /* matches drm constant */
107#define AGP 1 111#define VIA_MEM_AGP 1 /* matches drm constant */
112#define VIA_MEM_SYSTEM 2
113#define VIA_MEM_MIXED 3
114#define VIA_MEM_UNKNOWN 4
115
108typedef struct { 116typedef struct {
109 uint32_t offset; 117 uint32_t offset;
110 uint32_t size; 118 uint32_t size;
@@ -192,6 +200,9 @@ typedef struct _drm_via_sarea {
192 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS]; 200 unsigned int XvMCSubPicOn[VIA_NR_XVMC_PORTS];
193 unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */ 201 unsigned int XvMCCtxNoGrabbed; /* Last context to hold decoder */
194 202
203 /* Used bt the 3d driver only at this point, for pageflipping:
204 */
205 unsigned int pfCurrentOffset;
195} drm_via_sarea_t; 206} drm_via_sarea_t;
196 207
197typedef struct _drm_via_cmdbuf_size { 208typedef struct _drm_via_cmdbuf_size {
@@ -212,6 +223,16 @@ typedef enum {
212 223
213#define VIA_IRQ_FLAGS_MASK 0xF0000000 224#define VIA_IRQ_FLAGS_MASK 0xF0000000
214 225
226enum drm_via_irqs {
227 drm_via_irq_hqv0 = 0,
228 drm_via_irq_hqv1,
229 drm_via_irq_dma0_dd,
230 drm_via_irq_dma0_td,
231 drm_via_irq_dma1_dd,
232 drm_via_irq_dma1_td,
233 drm_via_irq_num
234};
235
215struct drm_via_wait_irq_request { 236struct drm_via_wait_irq_request {
216 unsigned irq; 237 unsigned irq;
217 via_irq_seq_type_t type; 238 via_irq_seq_type_t type;
@@ -224,20 +245,25 @@ typedef union drm_via_irqwait {
224 struct drm_wait_vblank_reply reply; 245 struct drm_wait_vblank_reply reply;
225} drm_via_irqwait_t; 246} drm_via_irqwait_t;
226 247
227#ifdef __KERNEL__ 248typedef struct drm_via_blitsync {
228 249 uint32_t sync_handle;
229int via_fb_init(DRM_IOCTL_ARGS); 250 unsigned engine;
230int via_mem_alloc(DRM_IOCTL_ARGS); 251} drm_via_blitsync_t;
231int via_mem_free(DRM_IOCTL_ARGS); 252
232int via_agp_init(DRM_IOCTL_ARGS); 253typedef struct drm_via_dmablit {
233int via_map_init(DRM_IOCTL_ARGS); 254 uint32_t num_lines;
234int via_decoder_futex(DRM_IOCTL_ARGS); 255 uint32_t line_length;
235int via_dma_init(DRM_IOCTL_ARGS); 256
236int via_cmdbuffer(DRM_IOCTL_ARGS); 257 uint32_t fb_addr;
237int via_flush_ioctl(DRM_IOCTL_ARGS); 258 uint32_t fb_stride;
238int via_pci_cmdbuffer(DRM_IOCTL_ARGS); 259
239int via_cmdbuf_size(DRM_IOCTL_ARGS); 260 unsigned char *mem_addr;
240int via_wait_irq(DRM_IOCTL_ARGS); 261 uint32_t mem_stride;
262
263 int bounce_buffer;
264 int to_fb;
265
266 drm_via_blitsync_t sync;
267} drm_via_dmablit_t;
241 268
242#endif
243#endif /* _VIA_DRM_H_ */ 269#endif /* _VIA_DRM_H_ */