gralloc: Add ITU-R standard info for YUV formats
These format qualifiers will help graphics decide which
standard to use when working with a YUV texture.
Change-Id: I6ad464e6b070d3b375c5e07f03228308d15407cd
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 703a2e6..0e7576e 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -103,6 +103,23 @@
}
}
+ if (bufferType == BUFFER_TYPE_VIDEO) {
+ if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE) {
+ if ((qdutils::MDPVersion::getInstance().getMDPVersion() <
+ qdutils::MDSS_V5)) { //A-Family
+ flags |= private_handle_t::PRIV_FLAGS_ITU_R_601_FR;
+ } else {
+ if (usage & (GRALLOC_USAGE_HW_TEXTURE |
+ GRALLOC_USAGE_HW_VIDEO_ENCODER))
+ flags |= private_handle_t::PRIV_FLAGS_ITU_R_709;
+ else if (usage & GRALLOC_USAGE_HW_CAMERA_ZSL)
+ flags |= private_handle_t::PRIV_FLAGS_ITU_R_601_FR;
+ }
+ } else {
+ flags |= private_handle_t::PRIV_FLAGS_ITU_R_601;
+ }
+ }
+
if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER ) {
flags |= private_handle_t::PRIV_FLAGS_VIDEO_ENCODER;
}