summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-12-29 10:03:43 -0700
committerBrian Paul <[email protected]>2018-01-11 08:06:38 -0700
commitbb951d45f23f29310b8f2edc395a8b774f9e1ab9 (patch)
treefee3c1901625e48979ad6dc3a28b6ab1d8ffe6c3
parent8f884b83d4fbad92a2f4017e03bdfb23d34fc252 (diff)
svga: simplify failure code in emit_rss_vgpu9()
No need for a goto. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_state_rss.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/gallium/drivers/svga/svga_state_rss.c b/src/gallium/drivers/svga/svga_state_rss.c
index 515155d3ae8..0cf8be8efbd 100644
--- a/src/gallium/drivers/svga/svga_state_rss.c
+++ b/src/gallium/drivers/svga/svga_state_rss.c
@@ -275,29 +275,24 @@ emit_rss_vgpu9(struct svga_context *svga, unsigned dirty)
if (queue.rs_count) {
SVGA3dRenderState *rs;
- if (SVGA3D_BeginSetRenderState(svga->swc,
- &rs,
- queue.rs_count) != PIPE_OK)
- goto fail;
+ if (SVGA3D_BeginSetRenderState(svga->swc, &rs, queue.rs_count)
+ != PIPE_OK) {
+ /* XXX: need to poison cached hardware state on failure to ensure
+ * dirty state gets re-emitted. Fix this by re-instating partial
+ * FIFOCommit command and only updating cached hw state once the
+ * initial allocation has succeeded.
+ */
+ memset(svga->state.hw_draw.rs, 0xcd, sizeof(svga->state.hw_draw.rs));
+
+ return PIPE_ERROR_OUT_OF_MEMORY;
+ }
- memcpy(rs,
- queue.rs,
- queue.rs_count * sizeof queue.rs[0]);
+ memcpy(rs, queue.rs, queue.rs_count * sizeof queue.rs[0]);
SVGA_FIFOCommitAll(svga->swc);
}
return PIPE_OK;
-
-fail:
- /* XXX: need to poison cached hardware state on failure to ensure
- * dirty state gets re-emitted. Fix this by re-instating partial
- * FIFOCommit command and only updating cached hw state once the
- * initial allocation has succeeded.
- */
- memset(svga->state.hw_draw.rs, 0xcd, sizeof(svga->state.hw_draw.rs));
-
- return PIPE_ERROR_OUT_OF_MEMORY;
}