aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_drv.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.h46
1 files changed, 45 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h
index c57ad606504d..ec55f2b23c22 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.h
+++ b/drivers/gpu/drm/radeon/radeon_drv.h
@@ -268,6 +268,8 @@ typedef struct drm_radeon_private {
268 268
269 u32 scratch_ages[5]; 269 u32 scratch_ages[5];
270 270
271 int have_z_offset;
272
271 /* starting from here on, data is preserved accross an open */ 273 /* starting from here on, data is preserved accross an open */
272 uint32_t flags; /* see radeon_chip_flags */ 274 uint32_t flags; /* see radeon_chip_flags */
273 resource_size_t fb_aper_offset; 275 resource_size_t fb_aper_offset;
@@ -295,6 +297,9 @@ typedef struct drm_radeon_private {
295 int r700_sc_prim_fifo_size; 297 int r700_sc_prim_fifo_size;
296 int r700_sc_hiz_tile_fifo_size; 298 int r700_sc_hiz_tile_fifo_size;
297 int r700_sc_earlyz_tile_fifo_fize; 299 int r700_sc_earlyz_tile_fifo_fize;
300 int r600_group_size;
301 int r600_npipes;
302 int r600_nbanks;
298 303
299 struct mutex cs_mutex; 304 struct mutex cs_mutex;
300 u32 cs_id_scnt; 305 u32 cs_id_scnt;
@@ -310,9 +315,11 @@ typedef struct drm_radeon_buf_priv {
310 u32 age; 315 u32 age;
311} drm_radeon_buf_priv_t; 316} drm_radeon_buf_priv_t;
312 317
318struct drm_buffer;
319
313typedef struct drm_radeon_kcmd_buffer { 320typedef struct drm_radeon_kcmd_buffer {
314 int bufsz; 321 int bufsz;
315 char *buf; 322 struct drm_buffer *buffer;
316 int nbox; 323 int nbox;
317 struct drm_clip_rect __user *boxes; 324 struct drm_clip_rect __user *boxes;
318} drm_radeon_kcmd_buffer_t; 325} drm_radeon_kcmd_buffer_t;
@@ -455,6 +462,15 @@ extern void r600_blit_swap(struct drm_device *dev,
455 int sx, int sy, int dx, int dy, 462 int sx, int sy, int dx, int dy,
456 int w, int h, int src_pitch, int dst_pitch, int cpp); 463 int w, int h, int src_pitch, int dst_pitch, int cpp);
457 464
465/* atpx handler */
466#if defined(CONFIG_VGA_SWITCHEROO)
467void radeon_register_atpx_handler(void);
468void radeon_unregister_atpx_handler(void);
469#else
470static inline void radeon_register_atpx_handler(void) {}
471static inline void radeon_unregister_atpx_handler(void) {}
472#endif
473
458/* Flags for stats.boxes 474/* Flags for stats.boxes
459 */ 475 */
460#define RADEON_BOX_DMA_IDLE 0x1 476#define RADEON_BOX_DMA_IDLE 0x1
@@ -2122,4 +2138,32 @@ extern void radeon_commit_ring(drm_radeon_private_t *dev_priv);
2122 write &= mask; \ 2138 write &= mask; \
2123} while (0) 2139} while (0)
2124 2140
2141/**
2142 * Copy given number of dwords from drm buffer to the ring buffer.
2143 */
2144#define OUT_RING_DRM_BUFFER(buf, sz) do { \
2145 int _size = (sz) * 4; \
2146 struct drm_buffer *_buf = (buf); \
2147 int _part_size; \
2148 while (_size > 0) { \
2149 _part_size = _size; \
2150 \
2151 if (write + _part_size/4 > mask) \
2152 _part_size = ((mask + 1) - write)*4; \
2153 \
2154 if (drm_buffer_index(_buf) + _part_size > PAGE_SIZE) \
2155 _part_size = PAGE_SIZE - drm_buffer_index(_buf);\
2156 \
2157 \
2158 \
2159 memcpy(ring + write, &_buf->data[drm_buffer_page(_buf)] \
2160 [drm_buffer_index(_buf)], _part_size); \
2161 \
2162 _size -= _part_size; \
2163 write = (write + _part_size/4) & mask; \
2164 drm_buffer_advance(_buf, _part_size); \
2165 } \
2166} while (0)
2167
2168
2125#endif /* __RADEON_DRV_H__ */ 2169#endif /* __RADEON_DRV_H__ */