summaryrefslogtreecommitdiff
path: root/src/radeon.h
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.h
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.h')
-rw-r--r--src/radeon.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 82136c83..ad62a613 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -672,9 +672,15 @@ struct radeon_accel_state {
#define EXA_ENGINEMODE_2D 1
#define EXA_ENGINEMODE_3D 2
+ int composite_op;
+ PicturePtr dst_pic;
+ PicturePtr msk_pic;
+ PicturePtr src_pic;
+ PixmapPtr dst_pix;
+ PixmapPtr msk_pix;
+ PixmapPtr src_pix;
Bool is_transform[2];
PictTransform *transform[2];
- Bool has_mask;
/* Whether we are tiling horizontally and vertically */
Bool need_src_tile_x;
Bool need_src_tile_y;
@@ -1513,8 +1519,10 @@ do { \
uint32_t flush = 0; \
switch (info->accel_state->engineMode) { \
case EXA_ENGINEMODE_UNKNOWN: \
- case EXA_ENGINEMODE_3D: \
flush = 1; \
+ break; \
+ case EXA_ENGINEMODE_3D: \
+ flush = info->cs == NULL || info->cs->cdw > 15 * 1024; \
case EXA_ENGINEMODE_2D: \
break; \
} \
@@ -1532,8 +1540,10 @@ do { \
uint32_t flush = 0; \
switch (info->accel_state->engineMode) { \
case EXA_ENGINEMODE_UNKNOWN: \
- case EXA_ENGINEMODE_2D: \
flush = 1; \
+ break; \
+ case EXA_ENGINEMODE_2D: \
+ flush = info->cs == NULL || info->cs->cdw > 15 * 1024; \
case EXA_ENGINEMODE_3D: \
break; \
} \
@@ -1542,8 +1552,9 @@ do { \
radeon_cs_flush_indirect(pScrn); \
else if (info->directRenderingEnabled) \
RADEONCPFlushIndirect(pScrn, 1); \
- RADEONInit3DEngine(pScrn); \
} \
+ if (!info->accel_state->XInited3D) \
+ RADEONInit3DEngine(pScrn); \
info->accel_state->engineMode = EXA_ENGINEMODE_3D; \
} while (0);
#else