summaryrefslogtreecommitdiff
path: root/src/radeon_exa_funcs.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-07-05 15:14:59 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-07-05 15:14:59 +0200
commit11cf8a28eb46f48d101888552266921bee8b63fc (patch)
treee085d081ed1ad1471ec250cd6c3f19d432d3d907 /src/radeon_exa_funcs.c
parent8d2f712eaf1e569fd92bbe2db5aceb43b7b367d1 (diff)
KMS CS fixes.
* Flush CS before running out of space. * Don't flush CS every time when switching between 2D and 3D engine, but make sure to re-initialize 2D/3D state after flushing. Doesn't seem quite perfect yet (some rendering seems to get dropped on the floor sometimes), but this should fix a lot of CS failures people have been seeing.
Diffstat (limited to 'src/radeon_exa_funcs.c')
-rw-r--r--src/radeon_exa_funcs.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index 5b723609..fb33b6fe 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -213,6 +213,17 @@ FUNC_NAME(RADEONSolid)(PixmapPtr pPix, int x1, int y1, int x2, int y2)
TRACE;
+#ifdef ACCEL_CP
+ if (info->cs && info->cs->cdw > 15 * 1024) {
+ struct radeon_cs_space_check bos[1];
+
+ radeon_cs_flush_indirect(pScrn);
+ radeon_add_pixmap(bos, 0, pPix, 0, RADEON_GEM_DOMAIN_VRAM);
+ radeon_cs_space_check(info->cs, bos, 1);
+ FUNC_NAME(Emit2DState)(pScrn, RADEON_2D_EXA_SOLID);
+ }
+#endif
+
if (info->accel_state->vsync)
FUNC_NAME(RADEONWaitForVLine)(pScrn, pPix, RADEONBiggerCrtcArea(pPix), y1, y2);
@@ -342,6 +353,21 @@ FUNC_NAME(RADEONCopy)(PixmapPtr pDst,
TRACE;
+#ifdef ACCEL_CP
+ if (info->cs && info->cs->cdw > 15 * 1024) {
+ struct radeon_cs_space_check bos[2];
+
+ radeon_cs_flush_indirect(pScrn);
+ bos[0].bo = info->state_2d.src_bo;
+ bos[0].read_domains = RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM;
+ bos[0].write_domain = 0;
+ bos[0].new_accounted = 0;
+ radeon_add_pixmap(bos, 1, pDst, 0, RADEON_GEM_DOMAIN_VRAM);
+ radeon_cs_space_check(info->cs, bos, 2);
+ FUNC_NAME(Emit2DState)(pScrn, RADEON_2D_EXA_COPY);
+ }
+#endif
+
if (info->accel_state->xdir < 0) {
srcX += w - 1;
dstX += w - 1;