summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Peng <robinpeng@google.com>2019-03-08 16:57:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-08 16:57:07 +0000
commit7c82c0a3a02a9529437c4ed95cd013a6a02692b4 (patch)
tree96a3a03820fd69802451a3b5a7f44677d2af4cbc
parent1284c3f5c329b2c6aa4057f172742aa724a84478 (diff)
parentc5b662efc4e0acafa6fc6d52d5ebaa0613e7392a (diff)
downloadandroid_hardware_qcom_sdm845_display-7c82c0a3a02a9529437c4ed95cd013a6a02692b4.tar.gz
android_hardware_qcom_sdm845_display-7c82c0a3a02a9529437c4ed95cd013a6a02692b4.tar.bz2
android_hardware_qcom_sdm845_display-7c82c0a3a02a9529437c4ed95cd013a6a02692b4.zip
Merge "Gralloc: Switch camera output from NV12 to NV21"
-rw-r--r--common.mk4
-rw-r--r--gralloc/gr_allocator.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/common.mk b/common.mk
index e241a408..fdfd1fff 100644
--- a/common.mk
+++ b/common.mk
@@ -51,6 +51,10 @@ ifeq ($(TARGET_USES_HWC2), true)
common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
endif
+ifeq ($(TARGET_USES_NV21_CAMERA_PREVIEW),true)
+ common_flags += -DUSE_NV21_CAMERA_PREVIEW
+endif
+
ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
common_flags += -DUSER_DEBUG
endif
diff --git a/gralloc/gr_allocator.cpp b/gralloc/gr_allocator.cpp
index 912ada03..4eb76203 100644
--- a/gralloc/gr_allocator.cpp
+++ b/gralloc/gr_allocator.cpp
@@ -212,7 +212,11 @@ int Allocator::GetImplDefinedFormat(uint64_t usage, int format) {
if (format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
gr_format = HAL_PIXEL_FORMAT_NV21_ZSL; // NV21
} else {
+#ifdef USE_NV21_CAMERA_PREVIEW
+ gr_format = HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS; // NV21 preview
+#else
gr_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS; // NV12 preview
+#endif
}
} else if (usage & BufferUsage::COMPOSER_OVERLAY) {
// XXX: If we still haven't set a format, default to RGBA8888