From 664a721dd452b165dec9f189a6d1c3121e6a0ed2 Mon Sep 17 00:00:00 2001 From: "Mi, Yanfeng" Date: Tue, 1 Aug 2023 13:54:46 +0800 Subject: [PATCH] iris: Avoid abort() if kernel can't allocate memory Handle ENOSPC and ENOMEM return by kernel with same operation Tracked-On: OAM-111148 --- src/gallium/drivers/iris/iris_batch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index c7a08a0e1f5..c84ff794244 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -1092,9 +1092,9 @@ _iris_batch_flush(struct iris_batch *batch, const char *file, int line) * with a new logical context, and inform iris_context that all state * has been lost and needs to be re-initialized. If this succeeds, * dubiously claim success... - * Also handle ENOMEM here. + * Also handle ENOMEM and ENOSPC here. */ - if ((ret == -EIO || ret == -ENOMEM) && replace_kernel_ctx(batch)) { + if ((ret == -EIO || ret == -ENOMEM || ret == -ENOSPC) && replace_kernel_ctx(batch)) { if (batch->reset->reset) { /* Tell gallium frontends the device is lost and it was our fault. */ batch->reset->reset(batch->reset->data, PIPE_GUILTY_CONTEXT_RESET);