crosvm: Delay RutabagaGralloc creation

RutabagaGralloc::new can cause a thread to be spawned
inside the crosvm process (via libgdm). This is not
allowed before crosvm has forked off its device
process children.

BUG=b:192823933
TEST=Build and deploy on nami, no problems detected with
Crostini graphics.

Change-Id: I9d86e299923c7c4ca3cdd6c54ad03c13e3011564
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3005196
Auto-Submit: Nicholas Verne <nverne@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Nicholas Verne <nverne@chromium.org>
This commit is contained in:
Nicholas Verne 2021-07-05 19:11:39 +10:00 committed by Commit Bot
parent 4cad30a560
commit b57c124e86

View file

@ -2600,7 +2600,6 @@ where
(&cfg.battery_type, None)
};
let gralloc = RutabagaGralloc::new().map_err(Error::CreateGrallocError)?;
let map_request: Arc<Mutex<Option<ExternalMapping>>> = Arc::new(Mutex::new(None));
let fs_count = cfg
@ -2695,6 +2694,7 @@ where
irqs.push(direct_irq);
}
let gralloc = RutabagaGralloc::new().map_err(Error::CreateGrallocError)?;
run_control(
linux,
sys_allocator,