minibgm: update GRALLOC_DRM_GET_BUFFER_INFO query

Vulkan on Android relis on VkImageDrmFormatModifierExplicitCreateInfoEXT
to import the gralloc allocated buffer, which requires buffer info of
the host storage.

BUG=b:186679287
TEST=venus wsi on arcvm and egl/gles
TEST=CtsNativeHardwareTestCases and related CtsGraphicsTestCases

Change-Id: I7ab0e80ab67a2daae9ea547a8d5abe9417af17d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2862161
Tested-by: 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-04-30 07:01:55 +00:00 committed by Commit Bot
parent b2917b28c2
commit a1e93fd6f1
9 changed files with 32 additions and 16 deletions

5
drv.c
View file

@ -683,15 +683,16 @@ void drv_log_prefix(const char *prefix, const char *file, int line, const char *
}
int drv_resource_info(struct bo *bo, uint32_t strides[DRV_MAX_PLANES],
uint32_t offsets[DRV_MAX_PLANES])
uint32_t offsets[DRV_MAX_PLANES], uint64_t *format_modifier)
{
for (uint32_t plane = 0; plane < bo->meta.num_planes; plane++) {
strides[plane] = bo->meta.strides[plane];
offsets[plane] = bo->meta.offsets[plane];
}
*format_modifier = bo->meta.format_modifier;
if (bo->drv->backend->resource_info)
return bo->drv->backend->resource_info(bo, strides, offsets);
return bo->drv->backend->resource_info(bo, strides, offsets, format_modifier);
return 0;
}