From 6f188cf7efa3a6460a7ad234002e2c23d8678dec Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Thu, 26 Dec 2024 21:58:41 +0100 Subject: [PATCH] graphics/fbcond: Unmap old offscreen buffer on handoff and resize --- graphics/fbcond/src/display.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/graphics/fbcond/src/display.rs b/graphics/fbcond/src/display.rs index 053b585563..cf2dbc528a 100644 --- a/graphics/fbcond/src/display.rs +++ b/graphics/fbcond/src/display.rs @@ -65,6 +65,10 @@ impl Display { match display_fd_map(width, height, &mut new_display_file) { Ok(offscreen) => { + unsafe { + display_fd_unmap(self.offscreen); + } + self.offscreen = offscreen; self.width = width; self.height = height; @@ -109,6 +113,10 @@ impl Display { pub fn resize(&mut self, width: usize, height: usize) { match display_fd_map(width, height, &mut self.display_file) { Ok(offscreen) => { + unsafe { + display_fd_unmap(self.offscreen); + } + self.offscreen = offscreen; self.width = width; self.height = height;