devices: virtio_gpu: update scanout size on guest modeset

When modesetting happens in the guest, the virtio-gpu driver issues a
VIRTIO_GPU_CMD_SET_SCANOUT hypercall with the new scanout parameters
(see virtio_gpu_primary_plane_update), including the updated size.
The crosvm-side callback, VirtioGpu::set_scanout, currently does not
respect such changes.

This change makes crosvm aware of scanout size changes, and in such
events re-creates an underlying display surface matching the new size.

Bug: b/382364037
Test: `cvd create` with two displays; within the guest, set display \
      resolution for the second display from Settings app
Change-Id: I0d4538cd652725b1250b8c104bb1509b1510f70e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/6275272
Reviewed-by: Jason Macnak <natsu@google.com>
Commit-Queue: Shao-Chuan Lee <shaochuan@chromium.org>
Reviewed-by: Kaiyi Li <kaiyili@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Auto-Submit: Shao-Chuan Lee <shaochuan@chromium.org>
2 files changed
tree: 2653c5d5fceba7ebb0ff8169cfb49162bff78e69
  1. .cargo/
  2. .config/
  3. .devcontainer/
  4. .github/
  5. .vscode/
  6. aarch64/
  7. acpi_tables/
  8. android_audio/
  9. arch/
  10. argh_helpers/
  11. audio_streams_conformance_test/
  12. audio_util/
  13. base/
  14. base_tokio/
  15. bit_field/
  16. broker_ipc/
  17. common/
  18. cros_async/
  19. cros_fdt/
  20. cros_tracing/
  21. cros_tracing_types/
  22. crosvm_cli/
  23. crosvm_control/
  24. crosvm_plugin/
  25. devices/
  26. disk/
  27. docs/
  28. e2e_tests/
  29. ext2/
  30. fuse/
  31. fuzz/
  32. gpu_display/
  33. hypervisor/
  34. infra/
  35. io_uring/
  36. jail/
  37. kernel_cmdline/
  38. kernel_loader/
  39. kvm/
  40. kvm_sys/
  41. libcras_stub/
  42. linux_input_sys/
  43. logo/
  44. media/
  45. metrics/
  46. metrics_events/
  47. net_sys/
  48. net_util/
  49. perfetto/
  50. power_monitor/
  51. prebuilts/
  52. proto_build_tools/
  53. protos/
  54. resources/
  55. riscv64/
  56. rutabaga_gfx/
  57. sandbox/
  58. serde_keyvalue/
  59. snapshot/
  60. src/
  61. swap/
  62. system_api/
  63. tests/
  64. third_party/
  65. tools/
  66. tube_transporter/
  67. usb_sys/
  68. usb_util/
  69. vendor/
  70. vfio_sys/
  71. vhost/
  72. virtio_sys/
  73. vm_control/
  74. vm_memory/
  75. win_audio/
  76. win_util/
  77. x86_64/
  78. .dockerignore
  79. .envrc
  80. .gitattributes
  81. .gitignore
  82. .gitmodules
  83. .rustfmt.toml
  84. ARCHITECTURE.md
  85. Cargo.lock
  86. Cargo.toml
  87. CONTRIBUTING.md
  88. DIR_METADATA
  89. LICENSE
  90. mypy.ini
  91. OWNERS
  92. OWNERS_COUNCIL
  93. PRESUBMIT.cfg
  94. pyproject.toml
  95. README.chromeos.md
  96. README.md
  97. rust-toolchain
README.md

crosvm - The ChromeOS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on ChromeOS devices.

Logo