Unable to use with minigbm in QEMU/virgl
Since commit 5621f5fd, I am unable to use drm_hwcomposer with AOSP minigbm in QEMU/virgl running Android 12.
My Android build uses the following:
- Android 12 (android-platform-12.0.0_r5) / 12L (android-platform-12.1.0_r1)
- kernel 5.10.106 (AOSP kernel/common @ android12-5.10-lts)
- AOSP mesa3d
- AOSP minigbm
- drm_hwcomposer (
main
branch)
Since the referenced commit, when running in QEMU/virgl with GRALLOC=minigbm and HWC=drm_minigbm, nothing is displayed in QEMU window and logcat is filled with:
03-22 16:20:12.491 1220 1389 E hwc-platform-drm-generic: could not create drm fb -22
03-22 16:20:12.491 1220 1389 E hwc-platform-drm-generic: Failed to rm fb
03-22 16:20:12.492 1220 1389 E hwc-drm-utils: Failed to import buffer
I compared the result of BufferInfoMinigbm::ConvertBoInfo
before and after the commit, and noticed 2 differences:
-
bo->usage
is0
-
bo->pitches[i]
is1
For the usage
difference, I may be wrong, but it doesn't look like drm_hwcomposer is calling CROS_GRALLOC_DRM_GET_USAGE
with the right arguments [1]. These should be req_usage
and out_gralloc_usage
, but the first argument is handle
.
For the pitch
/stride
difference, I believe the 1
value is coming from the fact that I'm using kernel 5.10 and according to [2], it's just the value of drm_virtgpu_resource_info_cros.type
being equal to VIRTGPU_RESOURCE_INFO_TYPE_EXTENDED
.
These might just be cases of this is not supposed to work and I should not be using this combination in QEMU. If that's the case, then please feel free to close this but report.
[1] https://android.googlesource.com/platform/external/minigbm/+/refs/tags/android-platform-12.1.0_r1/cros_gralloc/gralloc0/gralloc0.cc#299 [2] https://android.googlesource.com/platform/external/minigbm/+/refs/tags/android-platform-12.1.0_r1/external/virtgpu_drm.h#121