diff options
Diffstat (limited to 'drivers/char/drm/mga_drv.h')
-rw-r--r-- | drivers/char/drm/mga_drv.h | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h index 6059c5a5b105..461728e6a58a 100644 --- a/drivers/char/drm/mga_drv.h +++ b/drivers/char/drm/mga_drv.h | |||
@@ -62,14 +62,14 @@ typedef struct drm_mga_primary_buffer { | |||
62 | } drm_mga_primary_buffer_t; | 62 | } drm_mga_primary_buffer_t; |
63 | 63 | ||
64 | typedef struct drm_mga_freelist { | 64 | typedef struct drm_mga_freelist { |
65 | struct drm_mga_freelist *next; | 65 | struct drm_mga_freelist *next; |
66 | struct drm_mga_freelist *prev; | 66 | struct drm_mga_freelist *prev; |
67 | drm_mga_age_t age; | 67 | drm_mga_age_t age; |
68 | drm_buf_t *buf; | 68 | drm_buf_t *buf; |
69 | } drm_mga_freelist_t; | 69 | } drm_mga_freelist_t; |
70 | 70 | ||
71 | typedef struct { | 71 | typedef struct { |
72 | drm_mga_freelist_t *list_entry; | 72 | drm_mga_freelist_t *list_entry; |
73 | int discard; | 73 | int discard; |
74 | int dispatched; | 74 | int dispatched; |
75 | } drm_mga_buf_priv_t; | 75 | } drm_mga_buf_priv_t; |
@@ -78,8 +78,8 @@ typedef struct drm_mga_private { | |||
78 | drm_mga_primary_buffer_t prim; | 78 | drm_mga_primary_buffer_t prim; |
79 | drm_mga_sarea_t *sarea_priv; | 79 | drm_mga_sarea_t *sarea_priv; |
80 | 80 | ||
81 | drm_mga_freelist_t *head; | 81 | drm_mga_freelist_t *head; |
82 | drm_mga_freelist_t *tail; | 82 | drm_mga_freelist_t *tail; |
83 | 83 | ||
84 | unsigned int warp_pipe; | 84 | unsigned int warp_pipe; |
85 | unsigned long warp_pipe_phys[MGA_MAX_WARP_PIPES]; | 85 | unsigned long warp_pipe_phys[MGA_MAX_WARP_PIPES]; |
@@ -109,13 +109,13 @@ typedef struct drm_mga_private { | |||
109 | 109 | ||
110 | /** | 110 | /** |
111 | * \name MMIO region parameters. | 111 | * \name MMIO region parameters. |
112 | * | 112 | * |
113 | * \sa drm_mga_private_t::mmio | 113 | * \sa drm_mga_private_t::mmio |
114 | */ | 114 | */ |
115 | /*@{*/ | 115 | /*@{ */ |
116 | u32 mmio_base; /**< Bus address of base of MMIO. */ | 116 | u32 mmio_base; /**< Bus address of base of MMIO. */ |
117 | u32 mmio_size; /**< Size of the MMIO region. */ | 117 | u32 mmio_size; /**< Size of the MMIO region. */ |
118 | /*@}*/ | 118 | /*@} */ |
119 | 119 | ||
120 | u32 clear_cmd; | 120 | u32 clear_cmd; |
121 | u32 maccess; | 121 | u32 maccess; |
@@ -143,11 +143,14 @@ typedef struct drm_mga_private { | |||
143 | drm_local_map_t *warp; | 143 | drm_local_map_t *warp; |
144 | drm_local_map_t *primary; | 144 | drm_local_map_t *primary; |
145 | drm_local_map_t *agp_textures; | 145 | drm_local_map_t *agp_textures; |
146 | 146 | ||
147 | DRM_AGP_MEM *agp_mem; | 147 | DRM_AGP_MEM *agp_mem; |
148 | unsigned int agp_pages; | 148 | unsigned int agp_pages; |
149 | } drm_mga_private_t; | 149 | } drm_mga_private_t; |
150 | 150 | ||
151 | extern drm_ioctl_desc_t mga_ioctls[]; | ||
152 | extern int mga_max_ioctl; | ||
153 | |||
151 | /* mga_dma.c */ | 154 | /* mga_dma.c */ |
152 | extern int mga_driver_preinit(drm_device_t * dev, unsigned long flags); | 155 | extern int mga_driver_preinit(drm_device_t * dev, unsigned long flags); |
153 | extern int mga_dma_bootstrap(DRM_IOCTL_ARGS); | 156 | extern int mga_dma_bootstrap(DRM_IOCTL_ARGS); |
@@ -165,7 +168,7 @@ extern void mga_do_dma_flush(drm_mga_private_t * dev_priv); | |||
165 | extern void mga_do_dma_wrap_start(drm_mga_private_t * dev_priv); | 168 | extern void mga_do_dma_wrap_start(drm_mga_private_t * dev_priv); |
166 | extern void mga_do_dma_wrap_end(drm_mga_private_t * dev_priv); | 169 | extern void mga_do_dma_wrap_end(drm_mga_private_t * dev_priv); |
167 | 170 | ||
168 | extern int mga_freelist_put( drm_device_t *dev, drm_buf_t *buf ); | 171 | extern int mga_freelist_put(drm_device_t * dev, drm_buf_t * buf); |
169 | 172 | ||
170 | /* mga_warp.c */ | 173 | /* mga_warp.c */ |
171 | extern unsigned int mga_warp_microcode_size(const drm_mga_private_t * dev_priv); | 174 | extern unsigned int mga_warp_microcode_size(const drm_mga_private_t * dev_priv); |
@@ -196,7 +199,7 @@ extern long mga_compat_ioctl(struct file *filp, unsigned int cmd, | |||
196 | #define MGA_WRITE( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF( reg ) = val; } while (0) | 199 | #define MGA_WRITE( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF( reg ) = val; } while (0) |
197 | #define MGA_WRITE8( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF8( reg ) = val; } while (0) | 200 | #define MGA_WRITE8( reg, val ) do { DRM_WRITEMEMORYBARRIER(); MGA_DEREF8( reg ) = val; } while (0) |
198 | 201 | ||
199 | static inline u32 _MGA_READ(u32 *addr) | 202 | static inline u32 _MGA_READ(u32 * addr) |
200 | { | 203 | { |
201 | DRM_MEMORYBARRIER(); | 204 | DRM_MEMORYBARRIER(); |
202 | return *(volatile u32 *)addr; | 205 | return *(volatile u32 *)addr; |
@@ -218,8 +221,6 @@ static inline u32 _MGA_READ(u32 *addr) | |||
218 | #define DMAREG1(r) (u8)(((r - DWGREG1) >> 2) | 0x80) | 221 | #define DMAREG1(r) (u8)(((r - DWGREG1) >> 2) | 0x80) |
219 | #define DMAREG(r) (ISREG0(r) ? DMAREG0(r) : DMAREG1(r)) | 222 | #define DMAREG(r) (ISREG0(r) ? DMAREG0(r) : DMAREG1(r)) |
220 | 223 | ||
221 | |||
222 | |||
223 | /* ================================================================ | 224 | /* ================================================================ |
224 | * Helper macross... | 225 | * Helper macross... |
225 | */ | 226 | */ |
@@ -261,7 +262,6 @@ do { \ | |||
261 | } \ | 262 | } \ |
262 | } while (0) | 263 | } while (0) |
263 | 264 | ||
264 | |||
265 | /* ================================================================ | 265 | /* ================================================================ |
266 | * Primary DMA command stream | 266 | * Primary DMA command stream |
267 | */ | 267 | */ |
@@ -346,7 +346,6 @@ do { \ | |||
346 | write += DMA_BLOCK_SIZE; \ | 346 | write += DMA_BLOCK_SIZE; \ |
347 | } while (0) | 347 | } while (0) |
348 | 348 | ||
349 | |||
350 | /* Buffer aging via primary DMA stream head pointer. | 349 | /* Buffer aging via primary DMA stream head pointer. |
351 | */ | 350 | */ |
352 | 351 | ||
@@ -373,7 +372,6 @@ do { \ | |||
373 | } \ | 372 | } \ |
374 | } while (0) | 373 | } while (0) |
375 | 374 | ||
376 | |||
377 | #define MGA_ENGINE_IDLE_MASK (MGA_SOFTRAPEN | \ | 375 | #define MGA_ENGINE_IDLE_MASK (MGA_SOFTRAPEN | \ |
378 | MGA_DWGENGSTS | \ | 376 | MGA_DWGENGSTS | \ |
379 | MGA_ENDPRDMASTS) | 377 | MGA_ENDPRDMASTS) |
@@ -382,8 +380,6 @@ do { \ | |||
382 | 380 | ||
383 | #define MGA_DMA_DEBUG 0 | 381 | #define MGA_DMA_DEBUG 0 |
384 | 382 | ||
385 | |||
386 | |||
387 | /* A reduced set of the mga registers. | 383 | /* A reduced set of the mga registers. |
388 | */ | 384 | */ |
389 | #define MGA_CRTC_INDEX 0x1fd4 | 385 | #define MGA_CRTC_INDEX 0x1fd4 |
@@ -644,7 +640,6 @@ do { \ | |||
644 | # define MGA_G400_WR_MAGIC (1 << 6) | 640 | # define MGA_G400_WR_MAGIC (1 << 6) |
645 | # define MGA_G400_WR56_MAGIC 0x46480000 /* 12800.0f */ | 641 | # define MGA_G400_WR56_MAGIC 0x46480000 /* 12800.0f */ |
646 | 642 | ||
647 | |||
648 | #define MGA_ILOAD_ALIGN 64 | 643 | #define MGA_ILOAD_ALIGN 64 |
649 | #define MGA_ILOAD_MASK (MGA_ILOAD_ALIGN - 1) | 644 | #define MGA_ILOAD_MASK (MGA_ILOAD_ALIGN - 1) |
650 | 645 | ||
@@ -679,10 +674,10 @@ do { \ | |||
679 | 674 | ||
680 | /* Simple idle test. | 675 | /* Simple idle test. |
681 | */ | 676 | */ |
682 | static __inline__ int mga_is_idle( drm_mga_private_t *dev_priv ) | 677 | static __inline__ int mga_is_idle(drm_mga_private_t * dev_priv) |
683 | { | 678 | { |
684 | u32 status = MGA_READ( MGA_STATUS ) & MGA_ENGINE_IDLE_MASK; | 679 | u32 status = MGA_READ(MGA_STATUS) & MGA_ENGINE_IDLE_MASK; |
685 | return ( status == MGA_ENDPRDMASTS ); | 680 | return (status == MGA_ENDPRDMASTS); |
686 | } | 681 | } |
687 | 682 | ||
688 | #endif | 683 | #endif |