From c2f46bf38356d8acf57f4d58be8af8a36409af66 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Sun, 12 Apr 2026 12:39:09 +0700 Subject: [PATCH] drivers/graphics: Add API to check if shadow buffer present --- drivers/graphics/graphics-ipc/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/graphics/graphics-ipc/src/lib.rs b/drivers/graphics/graphics-ipc/src/lib.rs index 5c24df1d0f..285b304372 100644 --- a/drivers/graphics/graphics-ipc/src/lib.rs +++ b/drivers/graphics/graphics-ipc/src/lib.rs @@ -82,6 +82,10 @@ impl CpuBackedBuffer { &self.buffer } + pub fn has_shadow_buf(&self) -> bool { + self.shadow.is_some() + } + pub fn shadow_buf(&mut self) -> &mut [u8] { self.shadow.as_deref_mut().unwrap_or(&mut *self.map) }