mm-video-v4l2: Disable UBWC in bengal
Disable UBWC in bengal target.
CRs-Fixed: 2558184
Change-Id: Ifd46a54bc67672d27d0ef9a2f653b324278fd49c
diff --git a/mm-video-v4l2/vidc/vdec/Android.mk b/mm-video-v4l2/vidc/vdec/Android.mk
index 08d3490..892046c 100644
--- a/mm-video-v4l2/vidc/vdec/Android.mk
+++ b/mm-video-v4l2/vidc/vdec/Android.mk
@@ -37,6 +37,10 @@
libmm-vdec-def += -D_UBWC_
+ifeq ($(TARGET_BOARD_PLATFORM),bengal)
+libmm-vdec-def += -U_UBWC_
+endif
+
ifeq ($(TARGET_USES_ION),true)
libmm-vdec-def += -DUSE_ION
endif
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
index 2313861..0266d62 100644
--- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
+++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2_params.cpp
@@ -732,8 +732,13 @@
portFmt->eColorFormat == OMX_COLOR_FormatYUV420Planar ||
portFmt->eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar ||
portFmt->eColorFormat == OMX_COLOR_Format16bitRGB565) {
- op_format = (enum vdec_output_format)VDEC_YUV_FORMAT_NV12_UBWC;
- fmt.fmt.pix_mp.pixelformat = capture_capability = V4L2_PIX_FMT_NV12_UBWC;
+ if (!m_disable_ubwc_mode) {
+ op_format = (enum vdec_output_format)VDEC_YUV_FORMAT_NV12_UBWC;
+ fmt.fmt.pix_mp.pixelformat = capture_capability = V4L2_PIX_FMT_NV12_UBWC;
+ } else {
+ op_format = (enum vdec_output_format)VDEC_YUV_FORMAT_NV12;
+ fmt.fmt.pix_mp.pixelformat = capture_capability = V4L2_PIX_FMT_NV12;
+ }
//check if the required color format is a supported flexible format
is_flexible_format = check_supported_flexible_formats(portFmt->eColorFormat);
} else {
diff --git a/mm-video-v4l2/vidc/venc/Android.mk b/mm-video-v4l2/vidc/venc/Android.mk
index adf9aed..d20a800 100644
--- a/mm-video-v4l2/vidc/venc/Android.mk
+++ b/mm-video-v4l2/vidc/venc/Android.mk
@@ -33,6 +33,10 @@
libmm-venc-def += -D_UBWC_
+ifeq ($(TARGET_BOARD_PLATFORM),bengal)
+libmm-venc-def += -U_UBWC_
+endif
+
ifeq ($(call is-board-platform-in-list, $(TARGETS_THAT_USE_FLAG_MSM8226)),true)
libmm-venc-def += -D_MSM8226_
endif
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp
index 0ddc8ce..3e38a05 100644
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2_params.cpp
@@ -42,8 +42,10 @@
/* Initialize to zero & update as per required color format */
*usage = 0;
- /* Configure UBWC as default */
+ /* Configure UBWC as default if target supports */
+#ifdef _UBWC_
*usage |= GRALLOC_USAGE_PRIVATE_ALLOC_UBWC;
+#endif
if (hevc &&
(eProfile == (OMX_U32)OMX_VIDEO_HEVCProfileMain10HDR10 ||