dash: Conditional compilation for UBWC features

Change-Id: Ib45ded17dc1160338d4f4a41119f176f237d918b
diff --git a/Android.mk b/Android.mk
index 6cabf55..55c872a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
-ifeq ($(call is-board-platform-in-list,msm8909 msm8916 msm8994),true)
+ifeq ($(call is-board-platform-in-list,msm8909 msm8916 msm8974 msm8994),true)
 
 QCOM_MEDIA_ROOT := $(call my-dir)
 ifneq ($(TARGET_DISABLE_DASH),true)
diff --git a/dashplayer/Android.mk b/dashplayer/Android.mk
index 4466c47..09dddb8 100644
--- a/dashplayer/Android.mk
+++ b/dashplayer/Android.mk
@@ -53,6 +53,10 @@
 
 LOCAL_MODULE_TAGS := eng
 
+ifeq ($(call is-board-platform-in-list,msm8994),true)
+    LOCAL_CFLAGS += -DHAVE_UBWC
+endif
+
 ifeq ($(TARGET_ENABLE_QC_AV_ENHANCEMENTS), true)
  include $(BUILD_SHARED_LIBRARY)
 endif
diff --git a/dashplayer/DashPlayer.cpp b/dashplayer/DashPlayer.cpp
index ffe7c74..2f81097 100644
--- a/dashplayer/DashPlayer.cpp
+++ b/dashplayer/DashPlayer.cpp
@@ -1836,6 +1836,7 @@
                                               * VENUS_UV_SCANLINES(COLOR_FMT_NV12, mCurrentHeight));
                 allocLen = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, mCurrentWidth, mCurrentHeight);
               }
+#ifdef HAVE_UBWC
               else if (mColorFormat == 0x7FA30C06 /*QOMX_COLOR_FORMATYUV420PackedSemiPlanar32mCompressed*/)
               {
                 unsigned int y_stride = VENUS_Y_STRIDE(COLOR_FMT_NV12_UBWC, mCurrentWidth);
@@ -1854,7 +1855,7 @@
                 filledLen = y_ubwc_plane + uv_ubwc_plane + y_meta_plane + uv_meta_plane;
                 allocLen = VENUS_BUFFER_SIZE(COLOR_FMT_NV12_UBWC, mCurrentWidth, mCurrentHeight);
               }
-
+#endif
               if (filledLen > 0 && allocLen > 0)
               {
                 size_t offset = buffer->offset();