summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnkit Goyal <layog@google.com>2023-03-14 11:42:13 -0700
committerAnkit Goyal <layog@google.com>2023-03-14 13:38:59 -0700
commitcfd1f8d71058b85da3bf3f83249d6dda8a6d5917 (patch)
treee7b36692e4bd7e1323cb87614a53ec3e65ae3e07
parentadea2928e12ed615bc7a7341977e3b7d67b00065 (diff)
downloadgchips-cfd1f8d71058b85da3bf3f83249d6dda8a6d5917.tar.gz
gralloc4: Map camera write YUV420_888 to NV21
Fix: 272679097 Bug: 272748251 Test: Chat app image capture Test: Image capture in user profile Test: Faceauth Test: Normal camera usage Change-Id: I684721db56290f6df546625c056d347c3369f207
-rw-r--r--gralloc4/src/core/mali_gralloc_formats.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/gralloc4/src/core/mali_gralloc_formats.cpp b/gralloc4/src/core/mali_gralloc_formats.cpp
index dcc527a..402d138 100644
--- a/gralloc4/src/core/mali_gralloc_formats.cpp
+++ b/gralloc4/src/core/mali_gralloc_formats.cpp
@@ -1430,25 +1430,20 @@ uint32_t get_base_format(const uint64_t req_format,
{
base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN;
}
- else if ((usage & GRALLOC_USAGE_HW_TEXTURE) && (usage & GRALLOC_USAGE_HW_CAMERA_WRITE))
+ else if (usage & GRALLOC_USAGE_HW_CAMERA_WRITE)
{
- // Camera flexible YUV format output maps to NV21.
- base_format = HAL_PIXEL_FORMAT_YCrCb_420_SP;
- }
- else if (usage & (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE))
- {
- base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN;
- }
- else if ((usage & GRALLOC_USAGE_HW_CAMERA_WRITE) &&
- (usage & GRALLOC_USAGE_HW_CAMERA_READ) &&
- (usage & GRALLOC_USAGE_PROTECTED))
- {
- // Faceauth requires NV21 format
+ // Catchall for camera write. DO NOT CHANGE WITHOUT TESTING THESE SCENARIOS:
+ // 1. Camera capture and initial photo processing
+ // 2. Other major camera operations - video recording, portrait etc
+ // 3. Faceauth
+ // 4. Multi-profile user photo add
+ // 5. Capture and resize - use chat app to capture a photo
+ // Re-run these steps with GPU composition:
+ // adb shell service call SurfaceFlinger 1008 i32 1
base_format = HAL_PIXEL_FORMAT_YCrCb_420_SP;
}
else
{
- // Flexible framework-accessible YUV format;
base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SPN;
}
}