rutabaga_gfx: Handle rutabaga gfx update
Having both renderers running at the same time can work,
but not without changes. For now, allowing building both
at the same time.
BUG=b:181869105, b:182174209
Test: launch_cvd --gpu_mode=gfxstream
Test: launch_cvd --gpu_mode=virgl_renderer
Change-Id: Ib8a3fd4927401b9f7ebc4a4425a3ddba6621a3e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3092405
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
diff --git a/rutabaga_gfx/src/rutabaga_core.rs b/rutabaga_gfx/src/rutabaga_core.rs
index 39a227c..8913d28 100644
--- a/rutabaga_gfx/src/rutabaga_core.rs
+++ b/rutabaga_gfx/src/rutabaga_core.rs
@@ -719,7 +719,7 @@
rutabaga_components.insert(RutabagaComponentType::Rutabaga2D, rutabaga_2d);
} else {
#[cfg(feature = "virgl_renderer")]
- {
+ if self.default_component == RutabagaComponentType::VirglRenderer {
let virglrenderer_flags = self
.virglrenderer_flags
.ok_or(RutabagaError::InvalidRutabagaBuild)?;
@@ -742,7 +742,7 @@
}
#[cfg(feature = "gfxstream")]
- {
+ if self.default_component == RutabagaComponentType::Gfxstream {
let display_width = self
.display_width
.ok_or(RutabagaError::InvalidRutabagaBuild)?;