minigbm: conditionally fallback to strip scanout use_flag
Only 2d virtgpu backend needs to fallback here because virtio primary
plane only allows DRM_FORMAT_XRGB8888.
Most our platforms cannot display YV12 (except msm), thus the fallback
is required for the converted DRM_FORMAT_YVU420_ANDROID. For virgl
backend, additionally append a BO_USE_LINEAR as a replacement for the
hack inside compute_virgl_bind_flags.
BUG=b:199524294
TEST=CQ
TEST=gralloctest alloc_combinations
TEST=android.media.cts.VideoDecoderRotationTest
Change-Id: Ic87838ea2aae2b0abf87ed898ad75a3d7e556471
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3166775
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Auto-Submit: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
diff --git a/drv.c b/drv.c
index acaec03..119b5d5 100644
--- a/drv.c
+++ b/drv.c
@@ -659,6 +659,14 @@
return format;
}
+uint64_t drv_resolve_use_flags(struct driver *drv, uint32_t format, uint64_t use_flags)
+{
+ if (drv->backend->resolve_use_flags)
+ return drv->backend->resolve_use_flags(format, use_flags);
+
+ return use_flags;
+}
+
uint32_t drv_num_buffers_per_bo(struct bo *bo)
{
uint32_t count = 0;