mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-11 04:26:38 +00:00
Currently the video device only accepts virtio objects (as file descriptors) for resources, and file descriptors are hard-coded a bit all over the place to represent buffers and frames. This causes two issues: 1) Multiple buffers cannot currently be used to represent frames, i.e. 1 frame is exactly one virtio object, 2) Resources that are not virtio objects, like guest memory, cannot be used at the moment. This patch introduces more flexibility in the way resources are handled: first, all the resource-related code, including their resolution using the resource bridge, is consolidated into a new resource module. Then, the command module does not arbitrarily decide that all resources are virtio objects, and leaves that decision to the queues. Finally, resources now have their enum type that can unfold into any of the resource types we will support (currently only virtio objects). This forces consumers of resources to check their type before using them. Semantically, very little should change. The only noticeable side-effect should be that we now call the resource bridge only once per input buffer instead of once per decoder operation. BUG=b:161774071 BUG=b:169295147 TEST=arc.VideoDecodeAccel.h264_vm passes on hatch TEST=arc.VideoEncodeAccel.h264_360p_i420_vm passes on hatch Change-Id: I93b203117b5c96e91d4f1b8007e95ec5c501ea5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2983095 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Alexandre Courbot <acourbot@chromium.org> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> |
||
---|---|---|
.. | ||
src | ||
.build_test_serial | ||
Cargo.toml |