display: Add metadata types for allocated width and height
The standard metadata types for width and height return the
values requested by the client, rather than the width and height
of the allocated buffer. This change adds internal metadata types
so clients can query the allocated values.
CRs-Fixed: 2638621
Change-Id: I7c69cff65512c30e27eb86ef33f67079c979eeb6
diff --git a/gralloc/QtiGralloc.cpp b/gralloc/QtiGralloc.cpp
index 47be7dd..19ff2ab 100644
--- a/gralloc/QtiGralloc.cpp
+++ b/gralloc/QtiGralloc.cpp
@@ -152,6 +152,10 @@
return MetadataType_FD;
case QTI_PRIVATE_FLAGS:
return MetadataType_PrivateFlags;
+ case QTI_ALIGNED_WIDTH_IN_PIXELS:
+ return MetadataType_AlignedWidthInPixels;
+ case QTI_ALIGNED_HEIGHT_IN_PIXELS:
+ return MetadataType_AlignedHeightInPixels;
default:
return MetadataType_Invalid;
}
@@ -229,6 +233,14 @@
err = static_cast<Error>(android::gralloc4::decodeInt32(qtigralloc::MetadataType_PrivateFlags,
bytestream, (int32_t *)param));
break;
+ case QTI_ALIGNED_WIDTH_IN_PIXELS:
+ err = static_cast<Error>(android::gralloc4::decodeUint32(
+ qtigralloc::MetadataType_AlignedWidthInPixels, bytestream, (uint32_t *)param));
+ break;
+ case QTI_ALIGNED_HEIGHT_IN_PIXELS:
+ err = static_cast<Error>(android::gralloc4::decodeUint32(
+ qtigralloc::MetadataType_AlignedHeightInPixels, bytestream, (uint32_t *)param));
+ break;
default:
param = nullptr;
return Error::UNSUPPORTED;