summaryrefslogtreecommitdiff
path: root/gralloc4
diff options
context:
space:
mode:
authorYichi Chen <yichichen@google.com>2021-03-30 17:24:42 +0800
committerYichi Chen <yichichen@google.com>2021-04-21 19:34:05 +0800
commit9f647cc0361d5c61056c07e34583115fe5bd2b48 (patch)
tree2d491831fc86a5149b1c7cb9ab1ea1fe8771a77b /gralloc4
parentb596509bd3f2f9ad68081e9144205b353fa71958 (diff)
downloadgchips-9f647cc0361d5c61056c07e34583115fe5bd2b48.tar.gz
gralloc4: Enable SBWC when vpu is specified as consumer
There is still an architecture problem in media frameworks that the buffer usage is limited to 32 bit. It results the MFC IP flag cannot be successfully passed to Gralloc module. Before Media frameworks resolves the limitation in usage flag, the patch considers MFC as the only consumer when VIDEO_ENCODER is specified. Bug: b/163821791 Test: Enable Front Cam and Rear Cam Test: 3P App compatibility test. Change-Id: I404d49ed33762d3b621523761be2c8bb7c383498
Diffstat (limited to 'gralloc4')
-rw-r--r--gralloc4/src/core/mali_gralloc_formats.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/gralloc4/src/core/mali_gralloc_formats.cpp b/gralloc4/src/core/mali_gralloc_formats.cpp
index 3d09f43..052cc75 100644
--- a/gralloc4/src/core/mali_gralloc_formats.cpp
+++ b/gralloc4/src/core/mali_gralloc_formats.cpp
@@ -22,6 +22,7 @@
#include <log/log.h>
#include <assert.h>
#include <vector>
+#include <cutils/properties.h>
#include "gralloc_priv.h"
#include "mali_gralloc_bufferallocation.h"
@@ -87,8 +88,8 @@ static uint16_t get_vpu_consumer(uint64_t usage)
if (usage & GRALLOC_USAGE_GOOGLE_IP_BO)
return GOOGLE_GRALLOC_CONSUMER_BO;
- MALI_GRALLOC_LOGV("Video consumer IP not specified, falling back to default VPU consumer");
- return MALI_GRALLOC_CONSUMER_VPU;
+ // TODO(b/185896428): Support 64-bits usage version for GraphicBufferSource
+ return GOOGLE_GRALLOC_CONSUMER_MFC;
}
/*
@@ -1396,7 +1397,11 @@ uint32_t get_base_format(const uint64_t req_format,
else if ((producers & MALI_GRALLOC_PRODUCER_CAM) && (consumers == GOOGLE_GRALLOC_CONSUMER_MFC))
{
// Allocated buffer is SBWC compressed when MFC is the sole consumer for camera buffers
- base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_SBWC;
+ if (property_get_bool("debug.vendor.gpu.record_sbwc", true)) {
+ base_format = HAL_PIXEL_FORMAT_EXYNOS_YCbCr_420_SP_M_SBWC;
+ } else {
+ base_format = HAL_PIXEL_FORMAT_EXYNOS_YCrCb_420_SP_M;
+ }
}
else if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER)
{