diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2021-05-06 06:06:41 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-05-06 06:06:41 +0000 |
commit | c2cfa754a77b588184e906c54d88587d53c91adf (patch) | |
tree | 0068dd0351f2e33ec9b57372f41473490d0768bf | |
parent | a5e93fd2993094c97c7afd0dea08d403fc066694 (diff) | |
parent | 5e790379ac6345ce1cbc14e5a10c34bc1466eab5 (diff) | |
download | crosvm-c2cfa754a77b588184e906c54d88587d53c91adf.tar.gz |
Merge "Not remove surface when resource_id is 0" am: 96334c56f6 am: d3897fd9fb am: 5e790379acandroid-12.0.0_r32android-12.0.0_r29android-12.0.0_r28android-12.0.0_r27android-12.0.0_r26android-12.0.0_r21android-12.0.0_r20android-12.0.0_r19android-12.0.0_r18android-12.0.0_r16android12-qpr1-releaseandroid12-qpr1-d-s3-releaseandroid12-qpr1-d-s2-releaseandroid12-qpr1-d-s1-releaseandroid12-qpr1-d-releaseandroid12-dev
Original change: https://android-review.googlesource.com/c/platform/external/crosvm/+/1696174
Change-Id: Iecf62c0084e4650b68affef488cdbda67845cb29
-rw-r--r-- | devices/src/virtio/gpu/virtio_gpu.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/devices/src/virtio/gpu/virtio_gpu.rs b/devices/src/virtio/gpu/virtio_gpu.rs index 00086903a..2e7abb32d 100644 --- a/devices/src/virtio/gpu/virtio_gpu.rs +++ b/devices/src/virtio/gpu/virtio_gpu.rs @@ -215,14 +215,13 @@ impl VirtioGpu { scanout_data: Option<VirtioScanoutBlobData>, ) -> VirtioGpuResult { let mut display = self.display.borrow_mut(); - if resource_id == 0 { - if let Some(surface_id) = self.scanout_surface_id.take() { - display.release_surface(surface_id); - } - self.scanout_resource_id = None; - return Ok(OkNoData); - } - + /// b/186580833. + /// Remove the part of deleting surface when resource_id is 0. + /// This is a workaround to solve the issue of black display. + /// Observation is when Surfaceflinger falls back to client composition, + /// host receives set_scanout 0 0, and then set scanout 0 <some valid resid>. + /// The first 0 0 removes the surface, the second creates a new surface + /// with id++, which will be more than 0 and be ignorned in vnc or webrtc let resource = self .resources .get_mut(&resource_id) |