diff options
author | Jason Macnak <natsu@google.com> | 2020-07-25 06:02:22 -0700 |
---|---|---|
committer | Alistair Delva <adelva@google.com> | 2020-08-29 17:56:15 +0000 |
commit | aa65a6a67cd41390d4e8a0f87e20d3191db2994d (patch) | |
tree | 3abe06a6afa4c24164f64c3105797b6e42645c55 | |
parent | 06fb002d01d3a837ef54251713472d41845cddc7 (diff) | |
download | minigbm-android11-qpr3-release.tar.gz |
cros_gralloc: map custom drm fourcc back to standard fourccandroid-11.0.0_r46android-11.0.0_r43android-11.0.0_r40android-11.0.0_r39android-11.0.0_r38android-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android-11.0.0_r30android11-qpr3-s1-releaseandroid11-qpr3-releaseandroid11-qpr2-releaseandroid11-qpr1-c-release
Minigbm uses a custom fourcc DRM_FORMAT_YVU420_ANDROID to
specify a DRM_FORMAT_YVU420 format with the extra Android
specific alignment requirement. Mapper should map this
custom code back into the standard one for metadata get().
Bug: b/146515640
Test: launch_cvd, open youtube video, observe no hwc warning
Change-Id: Id9ac2bb233837b6c7aa093eddbea81da0bdf3c1b
-rw-r--r-- | cros_gralloc/gralloc4/CrosGralloc4Mapper.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc b/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc index 47e24ac..2a3f4c0 100644 --- a/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc +++ b/cros_gralloc/gralloc4/CrosGralloc4Mapper.cc @@ -467,7 +467,12 @@ Return<void> CrosGralloc4Mapper::get(cros_gralloc_handle_t crosHandle, PixelFormat pixelFormat = static_cast<PixelFormat>(crosHandle->droid_format); status = android::gralloc4::encodePixelFormatRequested(pixelFormat, &encodedMetadata); } else if (metadataType == android::gralloc4::MetadataType_PixelFormatFourCC) { - status = android::gralloc4::encodePixelFormatFourCC(crosHandle->format, &encodedMetadata); + uint32_t format = crosHandle->format; + // Map internal fourcc codes back to standard fourcc codes. + if (format == DRM_FORMAT_YVU420_ANDROID) { + format = DRM_FORMAT_YVU420; + } + status = android::gralloc4::encodePixelFormatFourCC(format, &encodedMetadata); } else if (metadataType == android::gralloc4::MetadataType_PixelFormatModifier) { status = android::gralloc4::encodePixelFormatModifier(crosHandle->format_modifier, &encodedMetadata); |