summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2020-07-25 06:02:22 -0700
committerAlistair Delva <adelva@google.com>2020-07-28 04:31:04 +0000
commiteef8dbea1e5f3e3a7109c601a5af3f1aa2cbed01 (patch)
tree3abe06a6afa4c24164f64c3105797b6e42645c55
parentae970ef16b5c582e8109799c6e0222c5320c191f (diff)
downloadplatform_external_minigbm-android11-gsi.tar.gz
platform_external_minigbm-android11-gsi.tar.bz2
platform_external_minigbm-android11-gsi.zip
cros_gralloc: map custom drm fourcc back to standard fourccandroid11-gsi
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);