summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/svga/drm
diff options
context:
space:
mode:
authorSinclair Yeh <[email protected]>2015-10-13 12:58:26 -0700
committerBrian Paul <[email protected]>2015-10-22 17:19:20 -0600
commit231d53923918f4a885e74da0a063dcbf1a4353e3 (patch)
tree30362cdb09562bf5e306ff8bfbbba5615f293da0 /src/gallium/winsys/svga/drm
parent99effaa9658a34eb07255bb1964569c8a86e8dda (diff)
svga: Condition preemptive flush on draw emission
On ultra high resolution modes, the preemptive flush flag can be set midway through command submission, a condition that cannot be recovered from a flush-retry, causing rendering artifacts. This patch prevents a preemtive_flush until a draw has been emitted. Signed-off-by: Sinclair Yeh <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/winsys/svga/drm')
-rw-r--r--src/gallium/winsys/svga/drm/vmw_context.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/winsys/svga/drm/vmw_context.c b/src/gallium/winsys/svga/drm/vmw_context.c
index 1675af4cbc8..4dc32366d61 100644
--- a/src/gallium/winsys/svga/drm/vmw_context.c
+++ b/src/gallium/winsys/svga/drm/vmw_context.c
@@ -251,6 +251,7 @@ vmw_swc_flush(struct svga_winsys_context *swc,
vswc->must_flush = FALSE;
debug_flush_flush(vswc->fctx);
#endif
+ swc->hints &= ~SVGA_HINT_FLAG_DRAW_EMITTED;
vswc->preemptive_flush = FALSE;
vswc->seen_surfaces = 0;
vswc->seen_regions = 0;
@@ -372,7 +373,8 @@ vmw_swc_region_relocation(struct svga_winsys_context *swc,
if (vmw_swc_add_validate_buffer(vswc, reloc->buffer, flags)) {
vswc->seen_regions += reloc->buffer->size;
- if(vswc->seen_regions >= VMW_GMR_POOL_SIZE/5)
+ if ((swc->hints & SVGA_HINT_FLAG_DRAW_EMITTED) &&
+ vswc->seen_regions >= VMW_GMR_POOL_SIZE/5)
vswc->preemptive_flush = TRUE;
}
@@ -413,8 +415,10 @@ vmw_swc_mob_relocation(struct svga_winsys_context *swc,
if (vmw_swc_add_validate_buffer(vswc, pb_buffer, flags)) {
vswc->seen_mobs += pb_buffer->size;
- /* divide by 5, tested for best performance */
- if (vswc->seen_mobs >= vswc->vws->ioctl.max_mob_memory / VMW_MAX_MOB_MEM_FACTOR)
+
+ if ((swc->hints & SVGA_HINT_FLAG_DRAW_EMITTED) &&
+ vswc->seen_mobs >=
+ vswc->vws->ioctl.max_mob_memory / VMW_MAX_MOB_MEM_FACTOR)
vswc->preemptive_flush = TRUE;
}
@@ -475,8 +479,9 @@ vmw_swc_surface_only_relocation(struct svga_winsys_context *swc,
++vswc->surface.staged;
vswc->seen_surfaces += vsurf->size;
- /* divide by 5 not well tuned for performance */
- if (vswc->seen_surfaces >= vswc->vws->ioctl.max_surface_memory / VMW_MAX_SURF_MEM_FACTOR)
+ if ((swc->hints & SVGA_HINT_FLAG_DRAW_EMITTED) &&
+ vswc->seen_surfaces >=
+ vswc->vws->ioctl.max_surface_memory / VMW_MAX_SURF_MEM_FACTOR)
vswc->preemptive_flush = TRUE;
}