From 11e39e75a4f9e87bfcb0343496b73c1697e1c79d Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Thu, 4 Feb 2021 10:13:26 -0800 Subject: [PATCH] rutabaga_gfx: rutabaga_gralloc: fix Kokoro unhappiness Should fix the following error: ---- rutabaga_gralloc::gralloc::tests::create_render_target stdout ---- thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Unsupported', rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs:314:64 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace BUG=b:173630595 TEST=cargo test locally Change-Id: Ieb24166f3975d4d7c99c08a3d0824ee64668c93e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2675231 Tested-by: Gurchetan Singh Commit-Queue: Gurchetan Singh Reviewed-by: Dylan Reid --- rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs b/rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs index 60847a556f..4222ba945a 100644 --- a/rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs +++ b/rutabaga_gfx/src/rutabaga_gralloc/gralloc.rs @@ -245,9 +245,13 @@ impl RutabagaGralloc { // choose the most shiny backend that the user has built. The rationale is "why would you // build it if you don't want to use it". let mut _backend = GrallocBackend::System; + #[cfg(feature = "minigbm")] { - _backend = GrallocBackend::Minigbm; + // See note on "wl-dmabuf" and Kokoro in Gralloc::new(). + if self.grallocs.contains_key(&GrallocBackend::Minigbm) { + _backend = GrallocBackend::Minigbm; + } } #[cfg(feature = "vulkano")]