summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2020-07-25 06:02:22 -0700
committerAlistair Delva <adelva@google.com>2020-08-29 17:56:15 +0000
commitaa65a6a67cd41390d4e8a0f87e20d3191db2994d (patch)
tree3abe06a6afa4c24164f64c3105797b6e42645c55
parent06fb002d01d3a837ef54251713472d41845cddc7 (diff)
downloadminigbm-android11-qpr3-release.tar.gz
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.cc7
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);