summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_batch.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-05-07 22:26:22 -0700
committerKenneth Graunke <[email protected]>2019-05-09 16:49:07 -0700
commit343f41781c17a9db37f8872f1c4018cd58330417 (patch)
tree9a17f7d5cd8720c34ec804454ad489a1f93d80ed /src/gallium/drivers/iris/iris_batch.c
parentc5c12bdd004994abfe0f5723e2d285cc69706b1a (diff)
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.
Diffstat (limited to 'src/gallium/drivers/iris/iris_batch.c')
-rw-r--r--src/gallium/drivers/iris/iris_batch.c7
1 files changed, 7 insertions, 0 deletions
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;
}