diff options
Diffstat (limited to 'drivers/char/drm/r128_drv.h')
-rw-r--r-- | drivers/char/drm/r128_drv.h | 73 |
1 files changed, 34 insertions, 39 deletions
diff --git a/drivers/char/drm/r128_drv.h b/drivers/char/drm/r128_drv.h index 0fb687c9505e..5c79e40eb88f 100644 --- a/drivers/char/drm/r128_drv.h +++ b/drivers/char/drm/r128_drv.h | |||
@@ -52,14 +52,13 @@ | |||
52 | #define DRIVER_MINOR 5 | 52 | #define DRIVER_MINOR 5 |
53 | #define DRIVER_PATCHLEVEL 0 | 53 | #define DRIVER_PATCHLEVEL 0 |
54 | 54 | ||
55 | |||
56 | #define GET_RING_HEAD(dev_priv) R128_READ( R128_PM4_BUFFER_DL_RPTR ) | 55 | #define GET_RING_HEAD(dev_priv) R128_READ( R128_PM4_BUFFER_DL_RPTR ) |
57 | 56 | ||
58 | typedef struct drm_r128_freelist { | 57 | typedef struct drm_r128_freelist { |
59 | unsigned int age; | 58 | unsigned int age; |
60 | drm_buf_t *buf; | 59 | drm_buf_t *buf; |
61 | struct drm_r128_freelist *next; | 60 | struct drm_r128_freelist *next; |
62 | struct drm_r128_freelist *prev; | 61 | struct drm_r128_freelist *prev; |
63 | } drm_r128_freelist_t; | 62 | } drm_r128_freelist_t; |
64 | 63 | ||
65 | typedef struct drm_r128_ring_buffer { | 64 | typedef struct drm_r128_ring_buffer { |
@@ -83,13 +82,11 @@ typedef struct drm_r128_private { | |||
83 | int cce_fifo_size; | 82 | int cce_fifo_size; |
84 | int cce_running; | 83 | int cce_running; |
85 | 84 | ||
86 | drm_r128_freelist_t *head; | 85 | drm_r128_freelist_t *head; |
87 | drm_r128_freelist_t *tail; | 86 | drm_r128_freelist_t *tail; |
88 | 87 | ||
89 | int usec_timeout; | 88 | int usec_timeout; |
90 | int is_pci; | 89 | int is_pci; |
91 | unsigned long phys_pci_gart; | ||
92 | dma_addr_t bus_pci_gart; | ||
93 | unsigned long cce_buffers_offset; | 90 | unsigned long cce_buffers_offset; |
94 | 91 | ||
95 | atomic_t idle_count; | 92 | atomic_t idle_count; |
@@ -120,6 +117,7 @@ typedef struct drm_r128_private { | |||
120 | drm_local_map_t *cce_ring; | 117 | drm_local_map_t *cce_ring; |
121 | drm_local_map_t *ring_rptr; | 118 | drm_local_map_t *ring_rptr; |
122 | drm_local_map_t *agp_textures; | 119 | drm_local_map_t *agp_textures; |
120 | drm_ati_pcigart_info gart_info; | ||
123 | } drm_r128_private_t; | 121 | } drm_r128_private_t; |
124 | 122 | ||
125 | typedef struct drm_r128_buf_priv { | 123 | typedef struct drm_r128_buf_priv { |
@@ -127,34 +125,37 @@ typedef struct drm_r128_buf_priv { | |||
127 | int prim; | 125 | int prim; |
128 | int discard; | 126 | int discard; |
129 | int dispatched; | 127 | int dispatched; |
130 | drm_r128_freelist_t *list_entry; | 128 | drm_r128_freelist_t *list_entry; |
131 | } drm_r128_buf_priv_t; | 129 | } drm_r128_buf_priv_t; |
132 | 130 | ||
131 | extern drm_ioctl_desc_t r128_ioctls[]; | ||
132 | extern int r128_max_ioctl; | ||
133 | |||
133 | /* r128_cce.c */ | 134 | /* r128_cce.c */ |
134 | extern int r128_cce_init( DRM_IOCTL_ARGS ); | 135 | extern int r128_cce_init(DRM_IOCTL_ARGS); |
135 | extern int r128_cce_start( DRM_IOCTL_ARGS ); | 136 | extern int r128_cce_start(DRM_IOCTL_ARGS); |
136 | extern int r128_cce_stop( DRM_IOCTL_ARGS ); | 137 | extern int r128_cce_stop(DRM_IOCTL_ARGS); |
137 | extern int r128_cce_reset( DRM_IOCTL_ARGS ); | 138 | extern int r128_cce_reset(DRM_IOCTL_ARGS); |
138 | extern int r128_cce_idle( DRM_IOCTL_ARGS ); | 139 | extern int r128_cce_idle(DRM_IOCTL_ARGS); |
139 | extern int r128_engine_reset( DRM_IOCTL_ARGS ); | 140 | extern int r128_engine_reset(DRM_IOCTL_ARGS); |
140 | extern int r128_fullscreen( DRM_IOCTL_ARGS ); | 141 | extern int r128_fullscreen(DRM_IOCTL_ARGS); |
141 | extern int r128_cce_buffers( DRM_IOCTL_ARGS ); | 142 | extern int r128_cce_buffers(DRM_IOCTL_ARGS); |
142 | 143 | ||
143 | extern void r128_freelist_reset( drm_device_t *dev ); | 144 | extern void r128_freelist_reset(drm_device_t * dev); |
144 | 145 | ||
145 | extern int r128_wait_ring( drm_r128_private_t *dev_priv, int n ); | 146 | extern int r128_wait_ring(drm_r128_private_t * dev_priv, int n); |
146 | 147 | ||
147 | extern int r128_do_cce_idle( drm_r128_private_t *dev_priv ); | 148 | extern int r128_do_cce_idle(drm_r128_private_t * dev_priv); |
148 | extern int r128_do_cleanup_cce( drm_device_t *dev ); | 149 | extern int r128_do_cleanup_cce(drm_device_t * dev); |
149 | 150 | ||
150 | extern int r128_driver_vblank_wait(drm_device_t *dev, unsigned int *sequence); | 151 | extern int r128_driver_vblank_wait(drm_device_t * dev, unsigned int *sequence); |
151 | 152 | ||
152 | extern irqreturn_t r128_driver_irq_handler( DRM_IRQ_ARGS ); | 153 | extern irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS); |
153 | extern void r128_driver_irq_preinstall( drm_device_t *dev ); | 154 | extern void r128_driver_irq_preinstall(drm_device_t * dev); |
154 | extern void r128_driver_irq_postinstall( drm_device_t *dev ); | 155 | extern void r128_driver_irq_postinstall(drm_device_t * dev); |
155 | extern void r128_driver_irq_uninstall( drm_device_t *dev ); | 156 | extern void r128_driver_irq_uninstall(drm_device_t * dev); |
156 | extern void r128_driver_pretakedown(drm_device_t *dev); | 157 | extern void r128_driver_pretakedown(drm_device_t * dev); |
157 | extern void r128_driver_prerelease(drm_device_t *dev, DRMFILE filp); | 158 | extern void r128_driver_prerelease(drm_device_t * dev, DRMFILE filp); |
158 | 159 | ||
159 | extern long r128_compat_ioctl(struct file *filp, unsigned int cmd, | 160 | extern long r128_compat_ioctl(struct file *filp, unsigned int cmd, |
160 | unsigned long arg); | 161 | unsigned long arg); |
@@ -266,7 +267,6 @@ extern long r128_compat_ioctl(struct file *filp, unsigned int cmd, | |||
266 | # define R128_EVENT_CRTC_OFFSET (1 << 0) | 267 | # define R128_EVENT_CRTC_OFFSET (1 << 0) |
267 | #define R128_WINDOW_XY_OFFSET 0x1bcc | 268 | #define R128_WINDOW_XY_OFFSET 0x1bcc |
268 | 269 | ||
269 | |||
270 | /* CCE registers | 270 | /* CCE registers |
271 | */ | 271 | */ |
272 | #define R128_PM4_BUFFER_OFFSET 0x0700 | 272 | #define R128_PM4_BUFFER_OFFSET 0x0700 |
@@ -317,7 +317,6 @@ extern long r128_compat_ioctl(struct file *filp, unsigned int cmd, | |||
317 | #define R128_PM4_FIFO_DATA_EVEN 0x1000 | 317 | #define R128_PM4_FIFO_DATA_EVEN 0x1000 |
318 | #define R128_PM4_FIFO_DATA_ODD 0x1004 | 318 | #define R128_PM4_FIFO_DATA_ODD 0x1004 |
319 | 319 | ||
320 | |||
321 | /* CCE command packets | 320 | /* CCE command packets |
322 | */ | 321 | */ |
323 | #define R128_CCE_PACKET0 0x00000000 | 322 | #define R128_CCE_PACKET0 0x00000000 |
@@ -395,7 +394,6 @@ do { \ | |||
395 | R128_WRITE(R128_CLOCK_CNTL_DATA, (val)); \ | 394 | R128_WRITE(R128_CLOCK_CNTL_DATA, (val)); \ |
396 | } while (0) | 395 | } while (0) |
397 | 396 | ||
398 | |||
399 | #define CCE_PACKET0( reg, n ) (R128_CCE_PACKET0 | \ | 397 | #define CCE_PACKET0( reg, n ) (R128_CCE_PACKET0 | \ |
400 | ((n) << 16) | ((reg) >> 2)) | 398 | ((n) << 16) | ((reg) >> 2)) |
401 | #define CCE_PACKET1( reg0, reg1 ) (R128_CCE_PACKET1 | \ | 399 | #define CCE_PACKET1( reg0, reg1 ) (R128_CCE_PACKET1 | \ |
@@ -404,13 +402,11 @@ do { \ | |||
404 | #define CCE_PACKET3( pkt, n ) (R128_CCE_PACKET3 | \ | 402 | #define CCE_PACKET3( pkt, n ) (R128_CCE_PACKET3 | \ |
405 | (pkt) | ((n) << 16)) | 403 | (pkt) | ((n) << 16)) |
406 | 404 | ||
407 | 405 | static __inline__ void r128_update_ring_snapshot(drm_r128_private_t * dev_priv) | |
408 | static __inline__ void | ||
409 | r128_update_ring_snapshot( drm_r128_private_t *dev_priv ) | ||
410 | { | 406 | { |
411 | drm_r128_ring_buffer_t *ring = &dev_priv->ring; | 407 | drm_r128_ring_buffer_t *ring = &dev_priv->ring; |
412 | ring->space = (GET_RING_HEAD( dev_priv ) - ring->tail) * sizeof(u32); | 408 | ring->space = (GET_RING_HEAD(dev_priv) - ring->tail) * sizeof(u32); |
413 | if ( ring->space <= 0 ) | 409 | if (ring->space <= 0) |
414 | ring->space += ring->size; | 410 | ring->space += ring->size; |
415 | } | 411 | } |
416 | 412 | ||
@@ -451,7 +447,6 @@ do { \ | |||
451 | OUT_RING( R128_EVENT_CRTC_OFFSET ); \ | 447 | OUT_RING( R128_EVENT_CRTC_OFFSET ); \ |
452 | } while (0) | 448 | } while (0) |
453 | 449 | ||
454 | |||
455 | /* ================================================================ | 450 | /* ================================================================ |
456 | * Ring control | 451 | * Ring control |
457 | */ | 452 | */ |
@@ -521,4 +516,4 @@ do { \ | |||
521 | write &= tail_mask; \ | 516 | write &= tail_mask; \ |
522 | } while (0) | 517 | } while (0) |
523 | 518 | ||
524 | #endif /* __R128_DRV_H__ */ | 519 | #endif /* __R128_DRV_H__ */ |