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

Author: Mike Blumenkrantz <[email protected]>
Date:   Sun Apr  4 13:10:40 2021 -0400

zink: use new ctx device lost checker function

make this handling more consistent

Reviewed-by: Dave Airlie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10509>

---

 src/gallium/drivers/zink/zink_context.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.c 
b/src/gallium/drivers/zink/zink_context.c
index 61107298864..cb1a3c1b00b 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1255,9 +1255,8 @@ flush_batch(struct zink_context *ctx, bool sync)
    if (sync)
       sync_flush(ctx, ctx->batch.state);
 
-   if (ctx->batch.state->is_device_lost && ctx->reset.reset) {
-      ctx->is_device_lost = true;
-      ctx->reset.reset(ctx->reset.data, PIPE_GUILTY_CONTEXT_RESET);
+   if (ctx->batch.state->is_device_lost) {
+      check_device_lost(ctx);
    } else {
       incr_curr_batch(ctx);
 
@@ -1745,10 +1744,8 @@ zink_flush(struct pipe_context *pctx,
           struct zink_batch_state *last = zink_batch_state(ctx->last_fence);
           if (last) {
              sync_flush(ctx, last);
-             if (last->is_device_lost && ctx->reset.reset) {
-                ctx->is_device_lost = true;
-                ctx->reset.reset(ctx->reset.data, PIPE_GUILTY_CONTEXT_RESET);
-             }
+             if (last->is_device_lost)
+                check_device_lost(ctx);
           }
        }
    } else {
@@ -1852,8 +1849,8 @@ timeline_wait(struct zink_context *ctx, uint32_t 
batch_id, uint64_t timeout)
 
    if (success)
       zink_screen_update_last_finished(screen, batch_id);
-   else if (screen->device_lost && ctx->reset.reset)
-      ctx->reset.reset(ctx->reset.data, PIPE_GUILTY_CONTEXT_RESET);
+   else
+      check_device_lost(ctx);
 
    return success;
 }

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

Reply via email to