aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_drv.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-02-24 22:44:04 -0500
committerDave Airlie <airlied@redhat.com>2010-02-26 01:23:23 -0500
commiteb6b6d7cdd5548fa03a919d14615195600013be2 (patch)
treec499472ef28a903f94b09da9a24f66b021412813 /drivers/gpu/drm/radeon/radeon_drv.h
parent30d6c72c4a760cfc9069ee100786e4d6cf6de59d (diff)
parent383be5d1789d9a7a2e77dca1cb0aca89507d069e (diff)
Merge remote branch 'korg/drm-radeon-testing' into drm-next-stage
* korg/drm-radeon-testing: (62 commits) drm/radeon/kms: update new pll algo drm/radeon/kms: add support for square microtiles on r3xx-r5xx drm/radeon/kms: force pinning buffer into visible VRAM drm/radeon/kms/evergreen: fix typo in cursor code drm/radeon/kms: implement reading active PCIE lanes on R600+ drm/radeon/kms: for downclocking non-mobility check PERFORMANCE state drm/radeon/kms: simplify storing current and requested PM mode drm/radeon: fixes for r6xx/r7xx gfx init drm/radeon/rv740: fix backend setup drm/radeon/kms: fix R3XX/R4XX memory controller initialization [rfc] drm/radeon/kms: pm debugging check for vbl. drm/radeon: Fix memory allocation failures in the preKMS command stream checking. drm: Add generic multipart buffer. drm/radeon/kms: simplify memory controller setup V2 drm/radeon: Add asic hook for dma copy to r200 cards. drm/radeon/kms: Create asic structure for r300 pcie cards. drm/radeon/kms: remove unused r600_gart_clear_page drm/radeon/kms: remove HDP flushes from fence emit (v2) drm/radeon/kms: add LVDS pll quirk for Dell Studio 15 drm/radeon/kms: simplify picking power state ... Conflicts: drivers/gpu/drm/radeon/atom.c drivers/gpu/drm/radeon/atombios.h drivers/gpu/drm/radeon/atombios_dp.c drivers/gpu/drm/radeon/r600.c drivers/gpu/drm/radeon/r600_audio.c drivers/gpu/drm/radeon/r600_cp.c drivers/gpu/drm/radeon/radeon.h drivers/gpu/drm/radeon/radeon_connectors.c drivers/gpu/drm/radeon/radeon_ring.c drivers/gpu/drm/radeon/rv770.c
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_drv.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.h35
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
316struct drm_buffer;
317
313typedef struct drm_radeon_kcmd_buffer { 318typedef 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__ */