From 343f41781c17a9db37f8872f1c4018cd58330417 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 7 May 2019 22:26:22 -0700 Subject: iris: Hook up device reset callbacks This mechanism lets the driver inform the state tracker about GPU resets, say for destroying a robust API context and reporting a "device lost" error to the application, making it take action to deal with this. --- src/gallium/drivers/iris/iris_batch.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/drivers/iris/iris_batch.c') diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index f3d2e569aa7..881531b9782 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -163,6 +163,7 @@ iris_init_batch(struct iris_batch *batch, struct iris_screen *screen, struct iris_vtable *vtbl, struct pipe_debug_callback *dbg, + struct pipe_device_reset_callback *reset, struct iris_batch *all_batches, enum iris_batch_name name, uint8_t engine, @@ -171,6 +172,7 @@ iris_init_batch(struct iris_batch *batch, batch->screen = screen; batch->vtbl = vtbl; batch->dbg = dbg; + batch->reset = reset; batch->name = name; /* engine should be one of I915_EXEC_RENDER, I915_EXEC_BLT, etc. */ @@ -611,6 +613,11 @@ _iris_batch_flush(struct iris_batch *batch, const char *file, int line) * dubiously claim success... */ if (ret == -EIO && replace_hw_ctx(batch)) { + if (batch->reset->reset) { + /* Tell the state tracker the device is lost and it was our fault. */ + batch->reset->reset(batch->reset->data, PIPE_GUILTY_CONTEXT_RESET); + } + ret = 0; } -- cgit v1.2.3