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.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/char/drm/savage_drv.h b/drivers/char/drm/savage_drv.h
index a4b0fa998a95..dd46cb85439c 100644
--- a/drivers/char/drm/savage_drv.h
+++ b/drivers/char/drm/savage_drv.h
@@ -1,5 +1,5 @@
1/* savage_drv.h -- Private header for the savage driver 1/* savage_drv.h -- Private header for the savage driver */
2 * 2/*
3 * Copyright 2004 Felix Kuehling 3 * Copyright 2004 Felix Kuehling
4 * All Rights Reserved. 4 * All Rights Reserved.
5 * 5 *
@@ -192,7 +192,7 @@ typedef struct drm_savage_private {
192 /* 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.
193 * Avoid unwanted macro expansion. */ 193 * Avoid unwanted macro expansion. */
194 void (*emit_clip_rect) (struct drm_savage_private * dev_priv, 194 void (*emit_clip_rect) (struct drm_savage_private * dev_priv,
195 drm_clip_rect_t * pbox); 195 const drm_clip_rect_t * pbox);
196 void (*dma_flush) (struct drm_savage_private * dev_priv); 196 void (*dma_flush) (struct drm_savage_private * dev_priv);
197} drm_savage_private_t; 197} drm_savage_private_t;
198 198
@@ -208,16 +208,18 @@ extern void savage_dma_reset(drm_savage_private_t * dev_priv);
208extern 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);
209extern uint32_t *savage_dma_alloc(drm_savage_private_t * dev_priv, 209extern uint32_t *savage_dma_alloc(drm_savage_private_t * dev_priv,
210 unsigned int n); 210 unsigned int n);
211extern int savage_preinit(drm_device_t * dev, unsigned long chipset); 211extern int savage_driver_load(drm_device_t *dev, unsigned long chipset);
212extern int savage_postcleanup(drm_device_t * dev); 212extern int savage_driver_firstopen(drm_device_t *dev);
213extern void savage_driver_lastclose(drm_device_t *dev);
214extern int savage_driver_unload(drm_device_t *dev);
213extern int savage_do_cleanup_bci(drm_device_t * dev); 215extern int savage_do_cleanup_bci(drm_device_t * dev);
214extern void savage_reclaim_buffers(drm_device_t * dev, DRMFILE filp); 216extern void savage_reclaim_buffers(drm_device_t * dev, DRMFILE filp);
215 217
216/* state functions */ 218/* state functions */
217extern void savage_emit_clip_rect_s3d(drm_savage_private_t * dev_priv, 219extern void savage_emit_clip_rect_s3d(drm_savage_private_t * dev_priv,
218 drm_clip_rect_t * pbox); 220 const drm_clip_rect_t * pbox);
219extern void savage_emit_clip_rect_s4(drm_savage_private_t * dev_priv, 221extern void savage_emit_clip_rect_s4(drm_savage_private_t * dev_priv,
220 drm_clip_rect_t * pbox); 222 const drm_clip_rect_t * pbox);
221 223
222#define SAVAGE_FB_SIZE_S3 0x01000000 /* 16MB */ 224#define SAVAGE_FB_SIZE_S3 0x01000000 /* 16MB */
223#define SAVAGE_FB_SIZE_S4 0x02000000 /* 32MB */ 225#define SAVAGE_FB_SIZE_S4 0x02000000 /* 32MB */
@@ -500,15 +502,6 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t * dev_priv,
500 502
501#define BCI_WRITE( val ) *bci_ptr++ = (uint32_t)(val) 503#define BCI_WRITE( val ) *bci_ptr++ = (uint32_t)(val)
502 504
503#define BCI_COPY_FROM_USER(src,n) do { \
504 unsigned int i; \
505 for (i = 0; i < n; ++i) { \
506 uint32_t val; \
507 DRM_GET_USER_UNCHECKED(val, &((uint32_t*)(src))[i]); \
508 BCI_WRITE(val); \
509 } \
510} while(0)
511
512/* 505/*
513 * command DMA support 506 * command DMA support
514 */ 507 */
@@ -534,8 +527,8 @@ extern void savage_emit_clip_rect_s4(drm_savage_private_t * dev_priv,
534 527
535#define DMA_WRITE( val ) *dma_ptr++ = (uint32_t)(val) 528#define DMA_WRITE( val ) *dma_ptr++ = (uint32_t)(val)
536 529
537#define DMA_COPY_FROM_USER(src,n) do { \ 530#define DMA_COPY(src, n) do { \
538 DRM_COPY_FROM_USER_UNCHECKED(dma_ptr, (src), (n)*4); \ 531 memcpy(dma_ptr, (src), (n)*4); \
539 dma_ptr += n; \ 532 dma_ptr += n; \
540} while(0) 533} while(0)
541 534