Merge remote-tracking branch 'goog/qcom/release/LA.UM.7.8.9.08.00.00.478.122' into pi-dev

Bug: 119743470
Change-Id: Ib13d11696dac9c61fbf7c69f2152719e546b277a
diff --git a/Android.mk b/Android.mk
index 707acf1..6c2a702 100644
--- a/Android.mk
+++ b/Android.mk
@@ -9,6 +9,7 @@
 
 display-hals += gralloc
 
+ifneq ($(BUILD_WITHOUT_VENDOR),true)
 ifeq ($(call is-vendor-board-platform,QCOM),true)
     include $(call all-named-subdir-makefiles,$(display-hals))
 else
@@ -16,4 +17,5 @@
     include $(call all-named-subdir-makefiles,$(display-hals))
 endif
 endif
+endif
 endif #TARGET_DISABLE_DISPLAY
diff --git a/common.mk b/common.mk
index 23c9529..c4b97bc 100644
--- a/common.mk
+++ b/common.mk
@@ -1,13 +1,13 @@
 #Common headers
 display_top := $(call my-dir)
 display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
+    if [ -d "$(TOP)/vendor/qcom/codeaurora/interfaces/vendor/display/config/1.1" ];\
     then echo DISPLAY_CONFIG_1_1; fi)
 display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\
+    if [ -d "$(TOP)/vendor/qcom/codeaurora/interfaces/vendor/display/config/1.2" ];\
     then echo DISPLAY_CONFIG_1_2; fi)
 display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\
+    if [ -d "$(TOP)/vendor/qcom/codeaurora/interfaces/vendor/display/config/1.3" ];\
     then echo DISPLAY_CONFIG_1_3; fi)
 
 #Common C flags
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index b97b5df..f2184aa 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -7,7 +7,7 @@
 LOCAL_VENDOR_MODULE           := true
 LOCAL_MODULE_RELATIVE_PATH    := hw
 LOCAL_MODULE_TAGS             := optional
-LOCAL_C_INCLUDES              := $(common_includes)
+LOCAL_C_INCLUDES              := $(common_includes) $(kernel_includes)
 
 LOCAL_HEADER_LIBRARIES        := display_headers
 LOCAL_SHARED_LIBRARIES        := $(common_libs) libqdMetaData libsync libgrallocutils \
@@ -15,7 +15,6 @@
                                  [email protected] \
                                  [email protected]
 LOCAL_CFLAGS                  := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wall -std=c++14 -Werror
-LOCAL_CFLAGS                  += -isystem  $(kernel_includes)
 LOCAL_CLANG                   := true
 LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
 LOCAL_SRC_FILES               := gr_device_impl.cpp
diff --git a/gralloc/gr_allocator.cpp b/gralloc/gr_allocator.cpp
index 912ada0..2e2b423 100644
--- a/gralloc/gr_allocator.cpp
+++ b/gralloc/gr_allocator.cpp
@@ -212,7 +212,7 @@
       if (format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
         gr_format = HAL_PIXEL_FORMAT_NV21_ZSL;  // NV21
       } else {
-        gr_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS;  // NV12 preview
+        gr_format = HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS;  // NV21 preview
       }
     } else if (usage & BufferUsage::COMPOSER_OVERLAY) {
       // XXX: If we still haven't set a format, default to RGBA8888
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 8fd2906..901af53 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -850,7 +850,13 @@
       aligned_w = ALIGN(width * 12 / 8, 16);
       break;
     case HAL_PIXEL_FORMAT_RAW10:
-      aligned_w = ALIGN(width * 10 / 8, 16);
+      {
+        const unsigned int gpu_alignment =
+            AdrenoMemInfo::GetInstance()->GetGpuPixelAlignment();
+        // gpu_alignment can return 1. Make sure it's at least 8.
+        const unsigned int raw10_alignment = std::max(gpu_alignment, 8u);
+        aligned_w = ALIGN(width * 10 / 8, raw10_alignment);
+      }
       break;
     case HAL_PIXEL_FORMAT_RAW8:
       aligned_w = ALIGN(width, 16);
diff --git a/os_pickup.bp b/os_pickup.bp
new file mode 100644
index 0000000..ac8388c
--- /dev/null
+++ b/os_pickup.bp
@@ -0,0 +1,3 @@
+//we are creating the namespace hardware/qcom/sdm710, hardware/qcom/sdm710/Android.bp links to this file
+soong_namespace {
+}
diff --git a/os_pickup.mk b/os_pickup.mk
new file mode 100644
index 0000000..9e13c0f
--- /dev/null
+++ b/os_pickup.mk
@@ -0,0 +1,5 @@
+ifeq ($(TARGET_BOARD_PLATFORM),sdm710)
+LOCAL_PATH := $(call my-dir)
+include $(call first-makefiles-under,$(LOCAL_PATH))
+endif
+
diff --git a/sdm/libs/core/drm/hw_peripheral_drm.cpp b/sdm/libs/core/drm/hw_peripheral_drm.cpp
index 71437d4..e4da108 100644
--- a/sdm/libs/core/drm/hw_peripheral_drm.cpp
+++ b/sdm/libs/core/drm/hw_peripheral_drm.cpp
@@ -275,7 +275,6 @@
   if (first_cycle_) {
     return kErrorNone;
   }
-
   drm_atomic_intf_->Perform(sde_drm::DRMOps::CRTC_SET_IDLE_PC_STATE, token_.crtc_id,
                             sde_drm::DRMIdlePCState::ENABLE);
   DisplayError err = HWDeviceDRM::PowerOn(release_fence);
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 2850e9d..867d805 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -546,7 +546,8 @@
       layer_stack_.flags.hdr_present = true;
     }
 
-    if (hwc_layer->IsNonIntegralSourceCrop() && !is_secure && !is_video) {
+    if (hwc_layer->IsNonIntegralSourceCrop() && !is_secure && !layer->flags.solid_fill &&
+        !is_video) {
       layer->flags.skip = true;
     }