From 1bf184747ea17671c827f48b48c0943f572f5a39 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 15 May 2024 13:47:42 +0200 Subject: [PATCH] rusticl/mesa/context: flush context before destruction Drivers might still be busy doing things and not properly clean things up. Fixes a rare crash on applicatione exits with some drivers. Fixes: 50e981a0504 ("rusticl/mesa: add fencing support") Part-of: (cherry picked from commit f1662e9bc96705fd1ae596db6eba8d0b873eec61) --- .pick_status.json | 2 +- src/gallium/frontends/rusticl/mesa/pipe/context.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 725cb9dff59..465c255cac4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1224,7 +1224,7 @@ "description": "rusticl/mesa/context: flush context before destruction", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "50e981a0504bf0a94b7cd93105ff250707e6850d", "notes": null diff --git a/src/gallium/frontends/rusticl/mesa/pipe/context.rs b/src/gallium/frontends/rusticl/mesa/pipe/context.rs index b01e24ebf28..b2ff2cfeb2f 100644 --- a/src/gallium/frontends/rusticl/mesa/pipe/context.rs +++ b/src/gallium/frontends/rusticl/mesa/pipe/context.rs @@ -658,6 +658,7 @@ impl PipeContext { impl Drop for PipeContext { fn drop(&mut self) { + self.flush().wait(); unsafe { self.pipe.as_ref().destroy.unwrap()(self.pipe.as_ptr()); }