mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
svga: simplify failure code in emit_rss_vgpu9()
No need for a goto. Reviewed-by: Neha Bhende <bhenden@vmware.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com>
This commit is contained in:
parent
8f884b83d4
commit
bb951d45f2
1 changed files with 12 additions and 17 deletions
|
|
@ -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));
|
||||
|
||||
memcpy(rs,
|
||||
queue.rs,
|
||||
queue.rs_count * sizeof queue.rs[0]);
|
||||
return PIPE_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue