From 8ba5fc98195585595ddb2a3778938300042640ae Mon Sep 17 00:00:00 2001 From: Chih-Yu Huang Date: Fri, 23 Oct 2020 12:00:01 +0900 Subject: [PATCH] virtio: video: clear output resources when the output queue is cleared Originally, we clear all the output resources when getting ProvidePictureBuffers command from VDA. At this point only VDA discards the output buffers. crosvm should keep the output resources until the output queue is cleared. Note that at crrev.com/c/2494602, GAVDA will ignore the output buffers after calling ProvidePictureBuffers(). So it's safe that crosvm passes the output buffers after getting ProvidePictureBuffers command. BUG=b:171442927 TEST=pass android.media.cts.AdaptivePlaybackTest#testVP9_adaptiveDrc Change-Id: I54dd364e7509c18fb3a3cd193da97dd107ceec44 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2494322 Tested-by: Chih-Yu Huang Tested-by: kokoro Reviewed-by: Alexandre Courbot Commit-Queue: Chih-Yu Huang --- devices/src/virtio/video/decoder/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/devices/src/virtio/video/decoder/mod.rs b/devices/src/virtio/video/decoder/mod.rs index c4f46e62ec..52c85946ab 100644 --- a/devices/src/virtio/video/decoder/mod.rs +++ b/devices/src/virtio/video/decoder/mod.rs @@ -261,9 +261,6 @@ impl Context { // No need to set `frame_rate`, as it's only for the encoder. ..Default::default() }; - - // All the output buffers at VDA are dropped. Clear the output resources. - self.out_res = Default::default(); } fn handle_picture_ready( @@ -745,7 +742,7 @@ impl<'a> Decoder<'a> { session.reset().map_err(VideoError::VdaError)?; } QueueType::Output => { - ctx.out_res.queued_res_ids.clear(); + ctx.out_res = Default::default(); } } Ok(())