From 1d0ac2d320891c829e21d5532fb50bdf4a8aee69 Mon Sep 17 00:00:00 2001 From: Yichi Chen Date: Wed, 5 May 2021 14:59:59 +0800 Subject: gralloc4: Disable SBWC on Camera buffer when GPU is one of producers GPU process is still involved in camera EAF and EIF handling. The patch respects to the GPU usage in the producer flag and disables SBWC accordingly. Bug: 186092174 Test: Enable Camera BlurRefinement with correct resolution Change-Id: I3b8715aaede8594296bfd31ca737b882bdb7b005 --- gralloc4/src/core/mali_gralloc_formats.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gralloc4/src') diff --git a/gralloc4/src/core/mali_gralloc_formats.cpp b/gralloc4/src/core/mali_gralloc_formats.cpp index 052cc75..38a35b5 100644 --- a/gralloc4/src/core/mali_gralloc_formats.cpp +++ b/gralloc4/src/core/mali_gralloc_formats.cpp @@ -1394,9 +1394,14 @@ uint32_t get_base_format(const uint64_t req_format, { base_format = HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M; //NV21M narrow } - else if ((producers & MALI_GRALLOC_PRODUCER_CAM) && (consumers == GOOGLE_GRALLOC_CONSUMER_MFC)) + else if ((producers & MALI_GRALLOC_PRODUCER_CAM) && + !(producers & MALI_GRALLOC_PRODUCER_GPU) && + (consumers == GOOGLE_GRALLOC_CONSUMER_MFC)) { - // Allocated buffer is SBWC compressed when MFC is the sole consumer for camera buffers + // Allocated camera buffer is SBWC compressed when + // 1. Camera is one of the producers + // 2. GPU is not one of the producers + // 3. MFC is the sole consumer if (property_get_bool("debug.vendor.gpu.record_sbwc", true)) { base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_SBWC; } else { -- cgit v1.2.3