aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/savage_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/savage_drv.h')
-rw-r--r--drivers/char/drm/savage_drv.h61
1 files changed, 32 insertions, 29 deletions
diff --git a/drivers/char/drm/savage_drv.h b/drivers/char/drm/savage_drv.h
index a45434944658..a4b0fa998a95 100644
--- a/drivers/char/drm/savage_drv.h
+++ b/drivers/char/drm/savage_drv.h
@@ -65,7 +65,7 @@ typedef struct drm_savage_dma_page {
65 drm_savage_age_t age; 65 drm_savage_age_t age;
66 unsigned int used, flushed; 66 unsigned int used, flushed;
67} drm_savage_dma_page_t; 67} drm_savage_dma_page_t;
68#define SAVAGE_DMA_PAGE_SIZE 1024 /* in dwords */ 68#define SAVAGE_DMA_PAGE_SIZE 1024 /* in dwords */
69/* Fake DMA buffer size in bytes. 4 pages. Allows a maximum command 69/* Fake DMA buffer size in bytes. 4 pages. Allows a maximum command
70 * size of 16kbytes or 4k entries. Minimum requirement would be 70 * size of 16kbytes or 4k entries. Minimum requirement would be
71 * 10kbytes for 255 40-byte vertices in one drawing command. */ 71 * 10kbytes for 255 40-byte vertices in one drawing command. */
@@ -104,6 +104,9 @@ enum savage_family {
104 S3_LAST 104 S3_LAST
105}; 105};
106 106
107extern drm_ioctl_desc_t savage_ioctls[];
108extern int savage_max_ioctl;
109
107#define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX)) 110#define S3_SAVAGE3D_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
108 111
109#define S3_SAVAGE4_SERIES(chip) ((chip==S3_SAVAGE4) \ 112#define S3_SAVAGE4_SERIES(chip) ((chip==S3_SAVAGE4) \
@@ -184,13 +187,13 @@ typedef struct drm_savage_private {
184 unsigned int waiting; 187 unsigned int waiting;
185 188
186 /* config/hardware-dependent function pointers */ 189 /* config/hardware-dependent function pointers */
187 int (*wait_fifo)(struct drm_savage_private *dev_priv, unsigned int n); 190 int (*wait_fifo) (struct drm_savage_private * dev_priv, unsigned int n);
188 int (*wait_evnt)(struct drm_savage_private *dev_priv, uint16_t e); 191 int (*wait_evnt) (struct drm_savage_private * dev_priv, uint16_t e);
189 /* Err, there is a macro wait_event in include/linux/wait.h. 192 /* Err, there is a macro wait_event in include/linux/wait.h.
190 * Avoid unwanted macro expansion. */ 193 * Avoid unwanted macro expansion. */
191 void (*emit_clip_rect)(struct drm_savage_private *dev_priv, 194 void (*emit_clip_rect) (struct drm_savage_private * dev_priv,
192 drm_clip_rect_t *pbox); 195 drm_clip_rect_t * pbox);
193 void (*dma_flush)(struct drm_savage_private *dev_priv); 196 void (*dma_flush) (struct drm_savage_private * dev_priv);
194} drm_savage_private_t; 197} drm_savage_private_t;
195 198
196/* ioctls */ 199/* ioctls */
@@ -198,23 +201,23 @@ extern int savage_bci_cmdbuf(DRM_IOCTL_ARGS);
198extern int savage_bci_buffers(DRM_IOCTL_ARGS); 201extern int savage_bci_buffers(DRM_IOCTL_ARGS);
199 202
200/* BCI functions */ 203/* BCI functions */
201extern uint16_t savage_bci_emit_event(drm_savage_private_t *dev_priv, 204extern uint16_t savage_bci_emit_event(drm_savage_private_t * dev_priv,
202 unsigned int flags); 205 unsigned int flags);
203extern void savage_freelist_put(drm_device_t *dev, drm_buf_t *buf); 206extern void savage_freelist_put(drm_device_t * dev, drm_buf_t * buf);
204extern void savage_dma_reset(drm_savage_private_t *dev_priv); 207extern void savage_dma_reset(drm_savage_private_t * dev_priv);
205extern void savage_dma_wait(drm_savage_private_t *dev_priv, unsigned int page); 208extern void savage_dma_wait(drm_savage_private_t * dev_priv, unsigned int page);
206extern uint32_t *savage_dma_alloc(drm_savage_private_t *dev_priv, 209extern uint32_t *savage_dma_alloc(drm_savage_private_t * dev_priv,
207 unsigned int n); 210 unsigned int n);
208extern int savage_preinit(drm_device_t *dev, unsigned long chipset); 211extern int savage_preinit(drm_device_t * dev, unsigned long chipset);
209extern int savage_postcleanup(drm_device_t *dev); 212extern int savage_postcleanup(drm_device_t * dev);
210extern int savage_do_cleanup_bci(drm_device_t *dev); 213extern int savage_do_cleanup_bci(drm_device_t * dev);
211extern void savage_reclaim_buffers(drm_device_t *dev, DRMFILE filp); 214extern void savage_reclaim_buffers(drm_device_t * dev, DRMFILE filp);
212 215
213/* state functions */ 216/* state functions */
214extern void savage_emit_clip_rect_s3d(drm_savage_private_t *dev_priv, 217extern void savage_emit_clip_rect_s3d(drm_savage_private_t * dev_priv,
215 drm_clip_rect_t *pbox); 218 drm_clip_rect_t * pbox);
216extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv, 219extern void savage_emit_clip_rect_s4(drm_savage_private_t * dev_priv,
217 drm_clip_rect_t *pbox); 220 drm_clip_rect_t * pbox);
218 221
219#define SAVAGE_FB_SIZE_S3 0x01000000 /* 16MB */ 222#define SAVAGE_FB_SIZE_S3 0x01000000 /* 16MB */
220#define SAVAGE_FB_SIZE_S4 0x02000000 /* 32MB */ 223#define SAVAGE_FB_SIZE_S4 0x02000000 /* 32MB */
@@ -222,10 +225,10 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv,
222#define SAVAGE_APERTURE_OFFSET 0x02000000 /* 32MB */ 225#define SAVAGE_APERTURE_OFFSET 0x02000000 /* 32MB */
223#define SAVAGE_APERTURE_SIZE 0x05000000 /* 5 tiled surfaces, 16MB each */ 226#define SAVAGE_APERTURE_SIZE 0x05000000 /* 5 tiled surfaces, 16MB each */
224 227
225#define SAVAGE_BCI_OFFSET 0x00010000 /* offset of the BCI region 228#define SAVAGE_BCI_OFFSET 0x00010000 /* offset of the BCI region
226 * inside the MMIO region */ 229 * inside the MMIO region */
227#define SAVAGE_BCI_FIFO_SIZE 32 /* number of entries in on-chip 230#define SAVAGE_BCI_FIFO_SIZE 32 /* number of entries in on-chip
228 * BCI FIFO */ 231 * BCI FIFO */
229 232
230/* 233/*
231 * MMIO registers 234 * MMIO registers
@@ -278,7 +281,7 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv,
278#define SAVAGE_TEXADDR1_S4 0x23 281#define SAVAGE_TEXADDR1_S4 0x23
279#define SAVAGE_TEXBLEND0_S4 0x24 282#define SAVAGE_TEXBLEND0_S4 0x24
280#define SAVAGE_TEXBLEND1_S4 0x25 283#define SAVAGE_TEXBLEND1_S4 0x25
281#define SAVAGE_TEXXPRCLR_S4 0x26 /* never used */ 284#define SAVAGE_TEXXPRCLR_S4 0x26 /* never used */
282#define SAVAGE_TEXDESCR_S4 0x27 285#define SAVAGE_TEXDESCR_S4 0x27
283#define SAVAGE_FOGTABLE_S4 0x28 286#define SAVAGE_FOGTABLE_S4 0x28
284#define SAVAGE_FOGCTRL_S4 0x30 287#define SAVAGE_FOGCTRL_S4 0x30
@@ -293,7 +296,7 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv,
293#define SAVAGE_TEXBLENDCOLOR_S4 0x39 296#define SAVAGE_TEXBLENDCOLOR_S4 0x39
294/* Savage3D/MX/IX 3D registers */ 297/* Savage3D/MX/IX 3D registers */
295#define SAVAGE_TEXPALADDR_S3D 0x18 298#define SAVAGE_TEXPALADDR_S3D 0x18
296#define SAVAGE_TEXXPRCLR_S3D 0x19 /* never used */ 299#define SAVAGE_TEXXPRCLR_S3D 0x19 /* never used */
297#define SAVAGE_TEXADDR_S3D 0x1A 300#define SAVAGE_TEXADDR_S3D 0x1A
298#define SAVAGE_TEXDESCR_S3D 0x1B 301#define SAVAGE_TEXDESCR_S3D 0x1B
299#define SAVAGE_TEXCTRL_S3D 0x1C 302#define SAVAGE_TEXCTRL_S3D 0x1C
@@ -305,7 +308,7 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv,
305#define SAVAGE_DESTCTRL_S3D 0x34 308#define SAVAGE_DESTCTRL_S3D 0x34
306#define SAVAGE_SCSTART_S3D 0x35 309#define SAVAGE_SCSTART_S3D 0x35
307#define SAVAGE_SCEND_S3D 0x36 310#define SAVAGE_SCEND_S3D 0x36
308#define SAVAGE_ZWATERMARK_S3D 0x37 311#define SAVAGE_ZWATERMARK_S3D 0x37
309#define SAVAGE_DESTTEXRWWATERMARK_S3D 0x38 312#define SAVAGE_DESTTEXRWWATERMARK_S3D 0x38
310/* common stuff */ 313/* common stuff */
311#define SAVAGE_VERTBUFADDR 0x3e 314#define SAVAGE_VERTBUFADDR 0x3e
@@ -313,9 +316,9 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv,
313#define SAVAGE_DMABUFADDR 0x51 316#define SAVAGE_DMABUFADDR 0x51
314 317
315/* texture enable bits (needed for tex addr checking) */ 318/* texture enable bits (needed for tex addr checking) */
316#define SAVAGE_TEXCTRL_TEXEN_MASK 0x00010000 /* S3D */ 319#define SAVAGE_TEXCTRL_TEXEN_MASK 0x00010000 /* S3D */
317#define SAVAGE_TEXDESCR_TEX0EN_MASK 0x02000000 /* S4 */ 320#define SAVAGE_TEXDESCR_TEX0EN_MASK 0x02000000 /* S4 */
318#define SAVAGE_TEXDESCR_TEX1EN_MASK 0x04000000 /* S4 */ 321#define SAVAGE_TEXDESCR_TEX1EN_MASK 0x04000000 /* S4 */
319 322
320/* Global fields in Savage4/Twister/ProSavage 3D registers: 323/* Global fields in Savage4/Twister/ProSavage 3D registers:
321 * 324 *
@@ -576,4 +579,4 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t *dev_priv,
576#define TEST_AGE( age, e, w ) \ 579#define TEST_AGE( age, e, w ) \
577 ( (age)->wrap < (w) || ( (age)->wrap == (w) && (age)->event <= (e) ) ) 580 ( (age)->wrap < (w) || ( (age)->wrap == (w) && (age)->event <= (e) ) )
578 581
579#endif /* __SAVAGE_DRV_H__ */ 582#endif /* __SAVAGE_DRV_H__ */