diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_drv.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h index c57ad606504d..88f4d8669d84 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h | |||
@@ -295,6 +295,9 @@ typedef struct drm_radeon_private { | |||
295 | int r700_sc_prim_fifo_size; | 295 | int r700_sc_prim_fifo_size; |
296 | int r700_sc_hiz_tile_fifo_size; | 296 | int r700_sc_hiz_tile_fifo_size; |
297 | int r700_sc_earlyz_tile_fifo_fize; | 297 | int r700_sc_earlyz_tile_fifo_fize; |
298 | int r600_group_size; | ||
299 | int r600_npipes; | ||
300 | int r600_nbanks; | ||
298 | 301 | ||
299 | struct mutex cs_mutex; | 302 | struct mutex cs_mutex; |
300 | u32 cs_id_scnt; | 303 | u32 cs_id_scnt; |
@@ -310,9 +313,11 @@ typedef struct drm_radeon_buf_priv { | |||
310 | u32 age; | 313 | u32 age; |
311 | } drm_radeon_buf_priv_t; | 314 | } drm_radeon_buf_priv_t; |
312 | 315 | ||
316 | struct drm_buffer; | ||
317 | |||
313 | typedef struct drm_radeon_kcmd_buffer { | 318 | typedef struct drm_radeon_kcmd_buffer { |
314 | int bufsz; | 319 | int bufsz; |
315 | char *buf; | 320 | struct drm_buffer *buffer; |
316 | int nbox; | 321 | int nbox; |
317 | struct drm_clip_rect __user *boxes; | 322 | struct drm_clip_rect __user *boxes; |
318 | } drm_radeon_kcmd_buffer_t; | 323 | } drm_radeon_kcmd_buffer_t; |
@@ -2122,4 +2127,32 @@ extern void radeon_commit_ring(drm_radeon_private_t *dev_priv); | |||
2122 | write &= mask; \ | 2127 | write &= mask; \ |
2123 | } while (0) | 2128 | } while (0) |
2124 | 2129 | ||
2130 | /** | ||
2131 | * Copy given number of dwords from drm buffer to the ring buffer. | ||
2132 | */ | ||
2133 | #define OUT_RING_DRM_BUFFER(buf, sz) do { \ | ||
2134 | int _size = (sz) * 4; \ | ||
2135 | struct drm_buffer *_buf = (buf); \ | ||
2136 | int _part_size; \ | ||
2137 | while (_size > 0) { \ | ||
2138 | _part_size = _size; \ | ||
2139 | \ | ||
2140 | if (write + _part_size/4 > mask) \ | ||
2141 | _part_size = ((mask + 1) - write)*4; \ | ||
2142 | \ | ||
2143 | if (drm_buffer_index(_buf) + _part_size > PAGE_SIZE) \ | ||
2144 | _part_size = PAGE_SIZE - drm_buffer_index(_buf);\ | ||
2145 | \ | ||
2146 | \ | ||
2147 | \ | ||
2148 | memcpy(ring + write, &_buf->data[drm_buffer_page(_buf)] \ | ||
2149 | [drm_buffer_index(_buf)], _part_size); \ | ||
2150 | \ | ||
2151 | _size -= _part_size; \ | ||
2152 | write = (write + _part_size/4) & mask; \ | ||
2153 | drm_buffer_advance(_buf, _part_size); \ | ||
2154 | } \ | ||
2155 | } while (0) | ||
2156 | |||
2157 | |||
2125 | #endif /* __RADEON_DRV_H__ */ | 2158 | #endif /* __RADEON_DRV_H__ */ |