From cc7070b284bb69bc5f7f13a1f7f48fa1946eee0b Mon Sep 17 00:00:00 2001 From: Jason Macnak Date: Wed, 6 Nov 2019 14:48:12 -0800 Subject: Support configurable screen sizes This change enables Cuttlefish to run with a user specified display size on top of virtio gpu accelerated graphics rendering. This change makes the width and height an argument/flag and adds the necessary plumbing to pass this width and height through the gpu backend. BUG=b:134086390 TEST=built crosvm and booted cuttlefish locally Change-Id: Idabf7ef083b2377e3ebf3b50dd0296f4bf7e8ddc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1927872 Tested-by: kokoro Tested-by: Dylan Reid Reviewed-by: Dylan Reid Commit-Queue: Jason Macnak --- src/linux.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/linux.rs') diff --git a/src/linux.rs b/src/linux.rs index 0cc341d..1dd1004 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -618,6 +618,7 @@ fn create_gpu_device( NonZeroU8::new(1).unwrap(), // number of scanouts gpu_sockets, display_backends, + cfg.gpu_parameters.as_ref().unwrap(), ); let jail = match simple_jail(&cfg, "gpu_device.policy")? { @@ -970,7 +971,7 @@ fn create_virtio_devices( #[cfg(feature = "gpu")] { - if cfg.gpu { + if cfg.gpu_parameters.is_some() { let (wl_socket, gpu_socket) = virtio::resource_bridge::pair().map_err(Error::CreateSocket)?; resource_bridges.push(gpu_socket); @@ -988,7 +989,7 @@ fn create_virtio_devices( #[cfg(feature = "gpu")] { - if cfg.gpu { + if cfg.gpu_parameters.is_some() { devs.push(create_gpu_device( cfg, _exit_evt, -- cgit 1.4.1