aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
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/drivers/svga
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/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_cmd.c2
-rw-r--r--src/gallium/drivers/svga/svga_cmd_vgpu10.c6
-rw-r--r--src/gallium/drivers/svga/svga_winsys.h7
3 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_cmd.c b/src/gallium/drivers/svga/svga_cmd.c
index d3cf52f08e2..0e1e332d6cb 100644
--- a/src/gallium/drivers/svga/svga_cmd.c
+++ b/src/gallium/drivers/svga/svga_cmd.c
@@ -1016,6 +1016,8 @@ SVGA3D_BeginDrawPrimitives(struct svga_winsys_context *swc,
*decls = declArray;
*ranges = rangeArray;
+ swc->hints |= SVGA_HINT_FLAG_DRAW_EMITTED;
+
return PIPE_OK;
}
diff --git a/src/gallium/drivers/svga/svga_cmd_vgpu10.c b/src/gallium/drivers/svga/svga_cmd_vgpu10.c
index 596ba953cd2..5c121089f91 100644
--- a/src/gallium/drivers/svga/svga_cmd_vgpu10.c
+++ b/src/gallium/drivers/svga/svga_cmd_vgpu10.c
@@ -535,6 +535,7 @@ SVGA3D_vgpu10_Draw(struct svga_winsys_context *swc,
SVGA3D_COPY_BASIC_2(vertexCount, startVertexLocation);
+ swc->hints |= SVGA_HINT_FLAG_DRAW_EMITTED;
swc->commit(swc);
return PIPE_OK;
}
@@ -550,6 +551,7 @@ SVGA3D_vgpu10_DrawIndexed(struct svga_winsys_context *swc,
SVGA3D_COPY_BASIC_3(indexCount, startIndexLocation,
baseVertexLocation);
+ swc->hints |= SVGA_HINT_FLAG_DRAW_EMITTED;
swc->commit(swc);
return PIPE_OK;
}
@@ -566,6 +568,7 @@ SVGA3D_vgpu10_DrawInstanced(struct svga_winsys_context *swc,
SVGA3D_COPY_BASIC_4(vertexCountPerInstance, instanceCount,
startVertexLocation, startInstanceLocation);
+ swc->hints |= SVGA_HINT_FLAG_DRAW_EMITTED;
swc->commit(swc);
return PIPE_OK;
}
@@ -584,6 +587,8 @@ SVGA3D_vgpu10_DrawIndexedInstanced(struct svga_winsys_context *swc,
startIndexLocation, baseVertexLocation,
startInstanceLocation);
+
+ swc->hints |= SVGA_HINT_FLAG_DRAW_EMITTED;
swc->commit(swc);
return PIPE_OK;
}
@@ -593,6 +598,7 @@ SVGA3D_vgpu10_DrawAuto(struct svga_winsys_context *swc)
{
SVGA3D_CREATE_COMMAND(DrawAuto, DRAW_AUTO);
+ swc->hints |= SVGA_HINT_FLAG_DRAW_EMITTED;
swc->commit(swc);
return PIPE_OK;
}
diff --git a/src/gallium/drivers/svga/svga_winsys.h b/src/gallium/drivers/svga/svga_winsys.h
index c750603989f..3129e46ed06 100644
--- a/src/gallium/drivers/svga/svga_winsys.h
+++ b/src/gallium/drivers/svga/svga_winsys.h
@@ -85,6 +85,8 @@ struct winsys_handle;
#define SVGA_QUERY_FLAG_SET (1 << 0)
#define SVGA_QUERY_FLAG_REF (1 << 1)
+#define SVGA_HINT_FLAG_DRAW_EMITTED (1 << 0)
+
/** Opaque surface handle */
struct svga_winsys_surface;
@@ -213,6 +215,11 @@ struct svga_winsys_context
uint32 cid;
/**
+ * Flags to hint the current context state
+ */
+ uint32 hints;
+
+ /**
** BEGIN new functions for guest-backed surfaces.
**/