diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-11-12 05:52:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-11-12 05:52:46 -0500 |
commit | 925142431bd653175b80ae153bd7a8bc13628bde (patch) | |
tree | 594c1e65d3bf25b10961ea2b97dee5704b4f6cb5 /drivers/char/drm/via_drv.h | |
parent | 792d2b9a12594522111fbe2a7f17460a4d7edff7 (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_drv.h')
-rw-r--r-- | drivers/char/drm/via_drv.h | 56 |
1 files changed, 43 insertions, 13 deletions
diff --git a/drivers/char/drm/via_drv.h b/drivers/char/drm/via_drv.h index 7d5daf43797e..0606c752dccb 100644 --- a/drivers/char/drm/via_drv.h +++ b/drivers/char/drm/via_drv.h | |||
@@ -24,24 +24,26 @@ | |||
24 | #ifndef _VIA_DRV_H_ | 24 | #ifndef _VIA_DRV_H_ |
25 | #define _VIA_DRV_H_ | 25 | #define _VIA_DRV_H_ |
26 | 26 | ||
27 | #define DRIVER_AUTHOR "VIA" | 27 | #define DRIVER_AUTHOR "Various" |
28 | 28 | ||
29 | #define DRIVER_NAME "via" | 29 | #define DRIVER_NAME "via" |
30 | #define DRIVER_DESC "VIA Unichrome / Pro" | 30 | #define DRIVER_DESC "VIA Unichrome / Pro" |
31 | #define DRIVER_DATE "20050523" | 31 | #define DRIVER_DATE "20051022" |
32 | 32 | ||
33 | #define DRIVER_MAJOR 2 | 33 | #define DRIVER_MAJOR 2 |
34 | #define DRIVER_MINOR 6 | 34 | #define DRIVER_MINOR 7 |
35 | #define DRIVER_PATCHLEVEL 3 | 35 | #define DRIVER_PATCHLEVEL 2 |
36 | 36 | ||
37 | #include "via_verifier.h" | 37 | #include "via_verifier.h" |
38 | 38 | ||
39 | #include "via_dmablit.h" | ||
40 | |||
39 | #define VIA_PCI_BUF_SIZE 60000 | 41 | #define VIA_PCI_BUF_SIZE 60000 |
40 | #define VIA_FIRE_BUF_SIZE 1024 | 42 | #define VIA_FIRE_BUF_SIZE 1024 |
41 | #define VIA_NUM_IRQS 2 | 43 | #define VIA_NUM_IRQS 4 |
42 | 44 | ||
43 | typedef struct drm_via_ring_buffer { | 45 | typedef struct drm_via_ring_buffer { |
44 | drm_map_t map; | 46 | drm_local_map_t map; |
45 | char *virtual_start; | 47 | char *virtual_start; |
46 | } drm_via_ring_buffer_t; | 48 | } drm_via_ring_buffer_t; |
47 | 49 | ||
@@ -56,9 +58,9 @@ typedef struct drm_via_irq { | |||
56 | 58 | ||
57 | typedef struct drm_via_private { | 59 | typedef struct drm_via_private { |
58 | drm_via_sarea_t *sarea_priv; | 60 | drm_via_sarea_t *sarea_priv; |
59 | drm_map_t *sarea; | 61 | drm_local_map_t *sarea; |
60 | drm_map_t *fb; | 62 | drm_local_map_t *fb; |
61 | drm_map_t *mmio; | 63 | drm_local_map_t *mmio; |
62 | unsigned long agpAddr; | 64 | unsigned long agpAddr; |
63 | wait_queue_head_t decoder_queue[VIA_NR_XVMC_LOCKS]; | 65 | wait_queue_head_t decoder_queue[VIA_NR_XVMC_LOCKS]; |
64 | char *dma_ptr; | 66 | char *dma_ptr; |
@@ -82,8 +84,15 @@ typedef struct drm_via_private { | |||
82 | maskarray_t *irq_masks; | 84 | maskarray_t *irq_masks; |
83 | uint32_t irq_enable_mask; | 85 | uint32_t irq_enable_mask; |
84 | uint32_t irq_pending_mask; | 86 | uint32_t irq_pending_mask; |
87 | int *irq_map; | ||
88 | drm_via_blitq_t blit_queues[VIA_NUM_BLIT_ENGINES]; | ||
85 | } drm_via_private_t; | 89 | } drm_via_private_t; |
86 | 90 | ||
91 | enum via_family { | ||
92 | VIA_OTHER = 0, | ||
93 | VIA_PRO_GROUP_A, | ||
94 | }; | ||
95 | |||
87 | /* VIA MMIO register access */ | 96 | /* VIA MMIO register access */ |
88 | #define VIA_BASE ((dev_priv->mmio)) | 97 | #define VIA_BASE ((dev_priv->mmio)) |
89 | 98 | ||
@@ -92,12 +101,31 @@ typedef struct drm_via_private { | |||
92 | #define VIA_READ8(reg) DRM_READ8(VIA_BASE, reg) | 101 | #define VIA_READ8(reg) DRM_READ8(VIA_BASE, reg) |
93 | #define VIA_WRITE8(reg,val) DRM_WRITE8(VIA_BASE, reg, val) | 102 | #define VIA_WRITE8(reg,val) DRM_WRITE8(VIA_BASE, reg, val) |
94 | 103 | ||
104 | extern drm_ioctl_desc_t via_ioctls[]; | ||
105 | extern int via_max_ioctl; | ||
106 | |||
107 | extern int via_fb_init(DRM_IOCTL_ARGS); | ||
108 | extern int via_mem_alloc(DRM_IOCTL_ARGS); | ||
109 | extern int via_mem_free(DRM_IOCTL_ARGS); | ||
110 | extern int via_agp_init(DRM_IOCTL_ARGS); | ||
111 | extern int via_map_init(DRM_IOCTL_ARGS); | ||
112 | extern int via_decoder_futex(DRM_IOCTL_ARGS); | ||
113 | extern int via_dma_init(DRM_IOCTL_ARGS); | ||
114 | extern int via_cmdbuffer(DRM_IOCTL_ARGS); | ||
115 | extern int via_flush_ioctl(DRM_IOCTL_ARGS); | ||
116 | extern int via_pci_cmdbuffer(DRM_IOCTL_ARGS); | ||
117 | extern int via_cmdbuf_size(DRM_IOCTL_ARGS); | ||
118 | extern int via_wait_irq(DRM_IOCTL_ARGS); | ||
119 | extern int via_dma_blit_sync( DRM_IOCTL_ARGS ); | ||
120 | extern int via_dma_blit( DRM_IOCTL_ARGS ); | ||
121 | |||
122 | extern int via_driver_load(drm_device_t *dev, unsigned long chipset); | ||
123 | extern int via_driver_unload(drm_device_t *dev); | ||
124 | |||
95 | extern int via_init_context(drm_device_t * dev, int context); | 125 | extern int via_init_context(drm_device_t * dev, int context); |
96 | extern int via_final_context(drm_device_t * dev, int context); | 126 | extern int via_final_context(drm_device_t * dev, int context); |
97 | 127 | ||
98 | extern int via_do_cleanup_map(drm_device_t * dev); | 128 | extern int via_do_cleanup_map(drm_device_t * dev); |
99 | extern int via_map_init(struct inode *inode, struct file *filp, | ||
100 | unsigned int cmd, unsigned long arg); | ||
101 | extern int via_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence); | 129 | extern int via_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence); |
102 | 130 | ||
103 | extern irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS); | 131 | extern irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS); |
@@ -111,8 +139,10 @@ extern int via_driver_dma_quiescent(drm_device_t * dev); | |||
111 | extern void via_init_futex(drm_via_private_t * dev_priv); | 139 | extern void via_init_futex(drm_via_private_t * dev_priv); |
112 | extern void via_cleanup_futex(drm_via_private_t * dev_priv); | 140 | extern void via_cleanup_futex(drm_via_private_t * dev_priv); |
113 | extern void via_release_futex(drm_via_private_t * dev_priv, int context); | 141 | extern void via_release_futex(drm_via_private_t * dev_priv, int context); |
142 | extern int via_driver_irq_wait(drm_device_t * dev, unsigned int irq, | ||
143 | int force_sequence, unsigned int *sequence); | ||
114 | 144 | ||
115 | extern int via_parse_command_stream(drm_device_t * dev, const uint32_t * buf, | 145 | extern void via_dmablit_handler(drm_device_t *dev, int engine, int from_irq); |
116 | unsigned int size); | 146 | extern void via_init_dmablit(drm_device_t *dev); |
117 | 147 | ||
118 | #endif | 148 | #endif |