virtgpu_virgl: use blobs for ABGR8888

This is slightly modified version of another patch originally created by
David Stevens ([email protected]), but since reverted.

https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3256451

Use blob buffers for ABGR8888 format buffers. This is necessary on ARCVM
to mitigate a performance problem with the
`testSurfaceTransaction_setEnableBackPressure` test from the
`CtsViewTestCases`, as the test expects to be able to read back rendered
buffers at 60fps.

Almost all the code is the same, with the only differences (besides some
minor conflict resolutions resurrecting this patch) being in the
switch statement in `should_use_blob` in `virtgpu_virgl.c` where a check
for ABGR8888 is added.

The rest of the change is as authored by stevensd@, which requires
knowing the host buffer layout before creating the blob resource, and
using an LRU cache of layouts to avoid the overhead of querying the host
every time a buffer is created.

As noted in stevensd@'s CL, virgpu_cross_domain will be the preferred
replacement to virgpu_virgl, and which is expected to have better
performance without this kludge.

TEST=CtsViewTestCases on hatch
BUG=b:235308831

Change-Id: Ia58573a8477e0c17239d6a0768ee53782fac1dd3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/4505920
Reviewed-by: Yiwei Zhang <[email protected]>
Commit-Queue: Yiwei Zhang <[email protected]>
Commit-Queue: Lloyd Pique <[email protected]>
Auto-Submit: Lloyd Pique <[email protected]>
Tested-by: Lloyd Pique <[email protected]>
3 files changed