virtgpu: no YVU420_ANDROID blobs for SW access

Currently, there is no way to coordinate buffer metadata between the
host and guest for blobs, so blobs which the guest will access can only
be used if the format is fully defined. Android's YV12 format (which
resolves to YVU420_ANDROID) is sort of fully defined, but some backends
don't actually use metadata that matches what the virtgpu_virgl expects.
As such only use blobs for YVU420_ANDROID when no SW access is required
(which is probably never, but it's straightforward enough to treat the
format the same as NV12).

Android's specification for YV12 is complicated by the fact that it
actually has two slightly different requirements depending on the use
case. The format itself requires that its stride be aligned to 16 bytes.
However, if the format is used with the long deprecated camera v1 APIs,
the stride must be the smallest possible 16 byte aligned value. The
various minigbm backends fulfil the format's stride alignment
requirement, but none actually fulfil the old camera API requirement.
Since this doesn't seem to be causing any problems in practice, either
in CTS or in any known apps, let's just leave it as is.

BUG=b:193205558, b:192516923, b:187462083
TEST=android.media.cts.EncodeDecodeTest on zork-arc-r
TEST=android.media.cts.VideoDecoderRotationTest on zork-arc-r

Change-Id: I3567cb166ab1cc547defb328b1ae697b4c3f55fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3088673
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: David Stevens <stevensd@chromium.org>
Commit-Queue: David Stevens <stevensd@chromium.org>
1 file changed