Module: Mesa
Branch: master
Commit: e4ad86952a197549894eb4c9a96af0c76dd95d18
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4ad86952a197549894eb4c9a96af0c76dd95d18

Author: Rob Clark <[email protected]>
Date:   Sun May 14 11:32:44 2017 -0400

freedreno: fix crash when flush() but no rendering

If we haven't created a batch, just bail in pipe->flush(), since there
is nothing to do.

Fixes crash in warsow, which creates a whole bunch of contexts used for
nothing but texture uploads.

Signed-off-by: Rob Clark <[email protected]>

---

 src/gallium/drivers/freedreno/freedreno_context.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/drivers/freedreno/freedreno_context.c 
b/src/gallium/drivers/freedreno/freedreno_context.c
index 8a86f0be14..450f4a803e 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -45,6 +45,12 @@ fd_context_flush(struct pipe_context *pctx, struct 
pipe_fence_handle **fence,
 {
        struct fd_context *ctx = fd_context(pctx);
 
+       if (!ctx->batch) {
+               if (fence)
+                       *fence = NULL;
+               return;
+       }
+
        if (flags & PIPE_FLUSH_FENCE_FD)
                ctx->batch->needs_out_fence_fd = true;
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to