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>
This commit is contained in:
Yiwei Zhang 2021-09-17 08:20:21 +00:00 committed by Commit Bot
parent 9f390d92a4
commit c1413ea43a
13 changed files with 51 additions and 16 deletions

8
drv.c
View file

@ -659,6 +659,14 @@ uint32_t drv_resolve_format(struct driver *drv, uint32_t format, uint64_t use_fl
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;