Merge tag 'LA.UM.9.12.r1-13800-SMxx50.0' of https://gitlab.com/codeaurora-mirror/quic/la/platform/hardware/qcom/display into lineage-20.0-caf-sm8250

"LA.UM.9.12.r1-13800-SMxx50.0"

# By lliu6
# Via Linux Build Service Account (1) and lliu6 (1)
* tag 'LA.UM.9.12.r1-13800-SMxx50.0' of https://gitlab.com/codeaurora-mirror/quic/la/platform/hardware/qcom/display:
  sdm: Clear cached panel brightness settings

Change-Id: I7a8d63a269d3ff9970a166d3f996500076655c37
diff --git a/.gitupstream b/.gitupstream
new file mode 100644
index 0000000..4c7783e
--- /dev/null
+++ b/.gitupstream
@@ -0,0 +1 @@
+https://git.codelinaro.org/clo/la/platform/hardware/qcom/display
diff --git a/Android.mk b/Android.mk
index 0a53f2a..c78f2e7 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,8 +1,10 @@
+ifeq ($(call my-dir),$(call project-path-for,qcom-display))
+
 sdm-libs := sdm/libs
 display-hals := include $(sdm-libs)/utils $(sdm-libs)/core libdebug gpu_tonemapper
 
 ifneq ($(TARGET_IS_HEADLESS), true)
-    display-hals += libcopybit liblight libmemtrack hdmi_cec \
+    display-hals += libcopybit libmemtrack hdmi_cec \
                     libdrmutils libhistogram drm.vendor
 endif
 
@@ -11,6 +13,10 @@
 display-hals += composer
 display-hals += init
 
+ifneq ($(TARGET_PROVIDES_LIBLIGHT),true)
+    display-hals += liblight
+endif
+
 ifeq ($(call is-vendor-board-platform,QCOM),true)
     include $(call all-named-subdir-makefiles,$(display-hals))
 else
@@ -18,3 +24,5 @@
     include $(call all-named-subdir-makefiles,$(display-hals))
 endif
 endif
+
+endif
diff --git a/common.mk b/common.mk
index 16b0574..c9c2773 100644
--- a/common.mk
+++ b/common.mk
@@ -43,29 +43,6 @@
     common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
 endif
 
-common_includes := system/core/base/include
-CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
-PLATFORM_SDK_NOUGAT = 25
-ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
-ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
-version_flag := -D__NOUGAT__
-
-# These include paths are deprecated post N
-common_includes += $(display_top)/libqdutils
-common_includes += $(display_top)/libqservice
-common_includes += $(display_top)/gpu_tonemapper
-ifneq ($(TARGET_IS_HEADLESS), true)
-    common_includes += $(display_top)/libcopybit
-endif
-
-common_includes += $(display_top)/include
-common_includes += $(display_top)/sdm/include
-common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
-endif
-endif
-
-common_header_export_path := qcom/display
-
 #Common libraries external to display HAL
 common_libs := liblog libutils libcutils libhardware
 common_deps  :=
diff --git a/composer/Android.mk b/composer/Android.mk
index 461396c..14c9f92 100644
--- a/composer/Android.mk
+++ b/composer/Android.mk
@@ -36,6 +36,10 @@
                                  libdisplayconfig.qti \
                                  libdrm libthermalclient
 
+ifeq ($(TARGET_USES_FOD_ZPOS), true)
+LOCAL_CFLAGS                  += -DFOD_ZPOS
+endif
+
 LOCAL_SRC_FILES               := QtiComposer.cpp QtiComposerClient.cpp service.cpp \
                                  QtiComposerHandleImporter.cpp \
                                  hwc_session.cpp \
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp
index 560dd33..3245ac8 100644
--- a/composer/hwc_display.cpp
+++ b/composer/hwc_display.cpp
@@ -699,6 +699,16 @@
       layer->flags.solid_fill = true;
     }
 
+#ifdef FOD_ZPOS
+    if (hwc_layer->IsFodPressed()) {
+      layer->flags.fod_pressed = true;
+      layer_stack_.flags.fod_pressed_present = true;
+    } else {
+      layer->flags.fod_pressed = false;
+      layer_stack_.flags.fod_pressed_present = false;
+    }
+#endif
+
     if (!hwc_layer->IsDataSpaceSupported()) {
       layer->flags.skip = true;
     }
diff --git a/composer/hwc_layers.cpp b/composer/hwc_layers.cpp
index a2c4227..7b74c44 100644
--- a/composer/hwc_layers.cpp
+++ b/composer/hwc_layers.cpp
@@ -623,6 +623,13 @@
 
 HWC2::Error HWCLayer::SetLayerZOrder(uint32_t z) {
   if (z_ != z) {
+#ifdef FOD_ZPOS
+    if (z & FOD_PRESSED_LAYER_ZORDER) {
+      fod_pressed_ = true;
+      z &= ~FOD_PRESSED_LAYER_ZORDER;
+    }
+#endif
+
     geometry_changes_ |= kZOrder;
     z_ = z;
   }
diff --git a/composer/hwc_layers.h b/composer/hwc_layers.h
index 852668f..8088f12 100644
--- a/composer/hwc_layers.h
+++ b/composer/hwc_layers.h
@@ -135,6 +135,9 @@
   void SetLayerAsMask();
   bool BufferLatched() { return buffer_flipped_; }
   void ResetBufferFlip() { buffer_flipped_ = false; }
+#ifdef FOD_ZPOS
+  bool IsFodPressed() { return fod_pressed_; }
+#endif
 
  private:
   Layer *layer_ = nullptr;
@@ -158,6 +161,9 @@
   bool color_transform_matrix_set_ = false;
   bool buffer_flipped_ = false;
   bool secure_ = false;
+#ifdef FOD_ZPOS
+  bool fod_pressed_ = false;
+#endif
 
   // Composition requested by client(SF)
   HWC2::Composition client_requested_ = HWC2::Composition::Device;
diff --git a/composer/hwc_session.cpp b/composer/hwc_session.cpp
index f12263b..cba0240 100644
--- a/composer/hwc_session.cpp
+++ b/composer/hwc_session.cpp
@@ -828,8 +828,8 @@
   for (size_t i = 0; i < pending_refresh_.size(); i++) {
     if (pending_refresh_.test(i)) {
       callbacks_.Refresh(i);
+      break;
     }
-    break;
   }
 
   pending_refresh_.reset();
diff --git a/gpu_tonemapper/Android.mk b/gpu_tonemapper/Android.mk
index ac0eb60..2c9708f 100644
--- a/gpu_tonemapper/Android.mk
+++ b/gpu_tonemapper/Android.mk
@@ -2,12 +2,6 @@
 include $(LOCAL_PATH)/../common.mk
 
 include $(CLEAR_VARS)
-LOCAL_COPY_HEADERS_TO     := $(common_header_export_path)
-LOCAL_COPY_HEADERS        := TonemapFactory.h Tonemapper.h
-LOCAL_VENDOR_MODULE       := true
-include $(BUILD_COPY_HEADERS)
-
-include $(CLEAR_VARS)
 LOCAL_MODULE              := libgpu_tonemapper
 LOCAL_SANITIZE            := integer_overflow
 LOCAL_VENDOR_MODULE       := true
diff --git a/gpu_tonemapper/glengine.cpp b/gpu_tonemapper/glengine.cpp
index 35e1932..bf3b58a 100644
--- a/gpu_tonemapper/glengine.cpp
+++ b/gpu_tonemapper/glengine.cpp
@@ -315,36 +315,30 @@
 //-----------------------------------------------------------------------------
 {
   for (GLint error = glGetError(); error; error = glGetError()) {
-    char *pError;
+    const char *pError = "<unknown error>";
     switch (error) {
       case GL_NO_ERROR:
-        pError = (char *)"GL_NO_ERROR";
+        pError = "GL_NO_ERROR";
         break;
       case GL_INVALID_ENUM:
-        pError = (char *)"GL_INVALID_ENUM";
+        pError = "GL_INVALID_ENUM";
         break;
       case GL_INVALID_VALUE:
-        pError = (char *)"GL_INVALID_VALUE";
+        pError = "GL_INVALID_VALUE";
         break;
       case GL_INVALID_OPERATION:
-        pError = (char *)"GL_INVALID_OPERATION";
+        pError = "GL_INVALID_OPERATION";
         break;
       case GL_OUT_OF_MEMORY:
-        pError = (char *)"GL_OUT_OF_MEMORY";
+        pError = "GL_OUT_OF_MEMORY";
         break;
       case GL_INVALID_FRAMEBUFFER_OPERATION:
-        pError = (char *)"GL_INVALID_FRAMEBUFFER_OPERATION";
+        pError = "GL_INVALID_FRAMEBUFFER_OPERATION";
         break;
-
-      default:
-        ALOGE("glError (0x%x) %s:%d\n", error, file, line);
-        return;
     }
 
     ALOGE("glError (%s) %s:%d\n", pError, file, line);
-    return;
   }
-  return;
 }
 
 //-----------------------------------------------------------------------------
@@ -357,59 +351,54 @@
       break;
     }
 
-    char *pError;
+    const char *pError = "<unknown error>";
     switch (error) {
       case EGL_SUCCESS:
-        pError = (char *)"EGL_SUCCESS";
+        pError = "EGL_SUCCESS";
         break;
       case EGL_NOT_INITIALIZED:
-        pError = (char *)"EGL_NOT_INITIALIZED";
+        pError = "EGL_NOT_INITIALIZED";
         break;
       case EGL_BAD_ACCESS:
-        pError = (char *)"EGL_BAD_ACCESS";
+        pError = "EGL_BAD_ACCESS";
         break;
       case EGL_BAD_ALLOC:
-        pError = (char *)"EGL_BAD_ALLOC";
+        pError = "EGL_BAD_ALLOC";
         break;
       case EGL_BAD_ATTRIBUTE:
-        pError = (char *)"EGL_BAD_ATTRIBUTE";
+        pError = "EGL_BAD_ATTRIBUTE";
         break;
       case EGL_BAD_CONTEXT:
-        pError = (char *)"EGL_BAD_CONTEXT";
+        pError = "EGL_BAD_CONTEXT";
         break;
       case EGL_BAD_CONFIG:
-        pError = (char *)"EGL_BAD_CONFIG";
+        pError = "EGL_BAD_CONFIG";
         break;
       case EGL_BAD_CURRENT_SURFACE:
-        pError = (char *)"EGL_BAD_CURRENT_SURFACE";
+        pError = "EGL_BAD_CURRENT_SURFACE";
         break;
       case EGL_BAD_DISPLAY:
-        pError = (char *)"EGL_BAD_DISPLAY";
+        pError = "EGL_BAD_DISPLAY";
         break;
       case EGL_BAD_SURFACE:
-        pError = (char *)"EGL_BAD_SURFACE";
+        pError = "EGL_BAD_SURFACE";
         break;
       case EGL_BAD_MATCH:
-        pError = (char *)"EGL_BAD_MATCH";
+        pError = "EGL_BAD_MATCH";
         break;
       case EGL_BAD_PARAMETER:
-        pError = (char *)"EGL_BAD_PARAMETER";
+        pError = "EGL_BAD_PARAMETER";
         break;
       case EGL_BAD_NATIVE_PIXMAP:
-        pError = (char *)"EGL_BAD_NATIVE_PIXMAP";
+        pError = "EGL_BAD_NATIVE_PIXMAP";
         break;
       case EGL_BAD_NATIVE_WINDOW:
-        pError = (char *)"EGL_BAD_NATIVE_WINDOW";
+        pError = "EGL_BAD_NATIVE_WINDOW";
         break;
       case EGL_CONTEXT_LOST:
-        pError = (char *)"EGL_CONTEXT_LOST";
+        pError = "EGL_CONTEXT_LOST";
         break;
-      default:
-        ALOGE("eglError (0x%x) %s:%d\n", error, file, line);
-        return;
     }
     ALOGE("eglError (%s) %s:%d\n", pError, file, line);
-    return;
   }
-  return;
 }
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index 8b9fb3e..8f22e3b 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -50,6 +50,17 @@
                                   android.hardware.graphics.mapper@4.0
 LOCAL_CFLAGS                  := $(common_flags) $(qmaa_flags) -DLOG_TAG=\"qdgralloc\" -Wno-sign-conversion \
                                  -D__QTI_DISPLAY_GRALLOC__
+
+ifeq ($(TARGET_USES_YCRCB_CAMERA_PREVIEW),true)
+    LOCAL_CFLAGS              += -DUSE_YCRCB_CAMERA_PREVIEW
+else ifeq ($(TARGET_USES_YCRCB_VENUS_CAMERA_PREVIEW),true)
+    LOCAL_CFLAGS              += -DUSE_YCRCB_CAMERA_PREVIEW_VENUS
+endif
+
+ifeq ($(TARGET_NO_RAW10_CUSTOM_FORMAT),true)
+    LOCAL_CFLAGS              += -DNO_RAW10_CUSTOM_FORMAT
+endif
+
 LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
 LOCAL_SRC_FILES               := gr_utils.cpp gr_adreno_info.cpp gr_camera_info.cpp
 include $(BUILD_SHARED_LIBRARY)
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 7c6265e..5d4eb86 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -162,8 +162,10 @@
     case HAL_PIXEL_FORMAT_NV12_UBWC_FLEX_8_BATCH:
     case HAL_PIXEL_FORMAT_MULTIPLANAR_FLEX:
     case HAL_PIXEL_FORMAT_RAW_OPAQUE:
+#ifndef NO_RAW10_CUSTOM_FORMAT
     case HAL_PIXEL_FORMAT_RAW10:
     case HAL_PIXEL_FORMAT_RAW12:
+#endif
       return true;
     default:
       break;
@@ -1393,7 +1395,13 @@
           gr_format = HAL_PIXEL_FORMAT_NV21_ZSL;  // NV21
         }
       } else {
+#ifdef USE_YCRCB_CAMERA_PREVIEW
+        gr_format = HAL_PIXEL_FORMAT_YCrCb_420_SP;  // NV21 preview
+#elif USE_YCRCB_CAMERA_PREVIEW_VENUS
+        gr_format = HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS;  // NV21 preview
+#else
         gr_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS;  // NV12 preview
+#endif
       }
     } else if (usage & BufferUsage::COMPOSER_OVERLAY) {
       // XXX: If we still haven't set a format, default to RGBA8888
diff --git a/include/Android.mk b/include/Android.mk
index aac2cec..c89137d 100644
--- a/include/Android.mk
+++ b/include/Android.mk
@@ -1,19 +1,3 @@
 LOCAL_PATH:= $(call my-dir)
 include $(LOCAL_PATH)/../common.mk
 include $(CLEAR_VARS)
-
-# Legacy header copy. This is deprecated.
-# Modules using these headers should shift to using
-# LOCAL_HEADER_LIBRARIES := display_headers
-LOCAL_VENDOR_MODULE           := true
-LOCAL_COPY_HEADERS_TO         := $(common_header_export_path)
-LOCAL_COPY_HEADERS            := display_properties.h \
-                                 dpps_control_interface.h \
-                                 ../libqdutils/qd_utils.h \
-                                 ../libqdutils/display_config.h \
-                                 ../libqservice/QServiceUtils.h \
-                                 ../libqservice/IQService.h \
-                                 ../libqservice/IQHDMIClient.h \
-                                 ../libqservice/IQClient.h
-
-include $(BUILD_COPY_HEADERS)
diff --git a/libcopybit/Android.mk b/libcopybit/Android.mk
index 8396d51..84e234a 100644
--- a/libcopybit/Android.mk
+++ b/libcopybit/Android.mk
@@ -15,9 +15,3 @@
 LOCAL_PATH:= $(call my-dir)
 include $(LOCAL_PATH)/../common.mk
 include $(CLEAR_VARS)
-
-LOCAL_VENDOR_MODULE           := true
-LOCAL_COPY_HEADERS_TO         := $(common_header_export_path)
-LOCAL_COPY_HEADERS            := copybit.h copybit_priv.h c2d2.h
-#Copy the headers regardless of whether copybit is built
-include $(BUILD_COPY_HEADERS)
diff --git a/libcopybit/c2d2.h b/libcopybit/c2d2.h
index 315a3ba..79a4c9b 100644
--- a/libcopybit/c2d2.h
+++ b/libcopybit/c2d2.h
@@ -72,6 +72,7 @@
     C2D_FORMAT_MACROTILED        = (1 << 16), /* tiled in macro level */
     C2D_FORMAT_TILED_4x4         = (1 << 17), /* 4x4 tiled format */
     C2D_FORMAT_SWAP_RB           = (1 << 18), /* Swap R & B color components */
+    C2D_FORMAT_BT601_FULLRANGE   = (1 << 20), /* YUV format is full range following BT 601 */
     C2D_FORMAT_UBWC_COMPRESSED   = (1 << 23), /* UBWC compressed format */
 } C2D_FORMAT_MODE;
 
@@ -207,6 +208,8 @@
     C2D_COLOR_FORMAT_422_Y42B     = 174,
 
     C2D_COLOR_FORMAT_800_Y800     = 190,
+    C2D_COLOR_FORMAT_420_TP10     = 191,
+    C2D_COLOR_FORMAT_420_P010     = 192,
 
 } C2D_YUV_FORMAT;
 
diff --git a/libdebug/Android.mk b/libdebug/Android.mk
index 4d18804..d99f9f6 100644
--- a/libdebug/Android.mk
+++ b/libdebug/Android.mk
@@ -9,7 +9,5 @@
 LOCAL_CFLAGS                  := -DLOG_TAG=\"SDM\" -Wall -Werror -fno-operator-names
 LOCAL_CLANG                   := true
 LOCAL_SRC_FILES               := debug_handler.cpp
-LOCAL_COPY_HEADERS_TO         := qcom/display
-LOCAL_COPY_HEADERS            := debug_handler.h
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/libdrmutils/Android.mk b/libdrmutils/Android.mk
index 4b49783..5a218c6 100644
--- a/libdrmutils/Android.mk
+++ b/libdrmutils/Android.mk
@@ -16,8 +16,6 @@
 LOCAL_CLANG                   := true
 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
 LOCAL_SRC_FILES               := drm_master.cpp drm_res_mgr.cpp drm_lib_loader.cpp
-LOCAL_COPY_HEADERS_TO         := qcom/display
-LOCAL_COPY_HEADERS            := drm_master.h drm_res_mgr.h drm_lib_loader.h drm_logger.h drm_interface.h
 
 include $(BUILD_SHARED_LIBRARY)
 endif
diff --git a/sde-drm/drm_connector.cpp b/sde-drm/drm_connector.cpp
index 4e8d565..6323c80 100644
--- a/sde-drm/drm_connector.cpp
+++ b/sde-drm/drm_connector.cpp
@@ -502,7 +502,7 @@
   fmt_str[blob->length] = '\0';
   stringstream stream(fmt_str);
   DRM_LOGI("stream str %s len %zu blob str %s len %d", stream.str().c_str(), stream.str().length(),
-           blob->data, blob->length);
+           static_cast<const char *>(blob->data), blob->length);
   string line = {};
   const string display_type = "display type=";
   const string panel_name = "panel name=";
@@ -590,7 +590,7 @@
   fmt_str[blob->length] = '\0';
   stringstream stream(fmt_str);
   DRM_LOGI("stream str %s len %zu blob str %s len %d", stream.str().c_str(), stream.str().length(),
-           blob->data, blob->length);
+           static_cast<const char *>(blob->data), blob->length);
 
   string line = {};
   const string mode_name = "mode_name=";
diff --git a/sde-drm/drm_crtc.cpp b/sde-drm/drm_crtc.cpp
index 1c53082..827866a 100644
--- a/sde-drm/drm_crtc.cpp
+++ b/sde-drm/drm_crtc.cpp
@@ -328,7 +328,7 @@
   fmt_str[blob->length] = '\0';
   stringstream stream(fmt_str);
   DRM_LOGI("stream str %s len %zu blob str %s len %d", stream.str().c_str(), stream.str().length(),
-           blob->data, blob->length);
+           static_cast<const char *>(blob->data), blob->length);
   string line = {};
   string max_blendstages = "max_blendstages=";
   string qseed_type = "qseed_type=";
diff --git a/sde-drm/drm_plane.cpp b/sde-drm/drm_plane.cpp
index eb58343..9da1033 100644
--- a/sde-drm/drm_plane.cpp
+++ b/sde-drm/drm_plane.cpp
@@ -452,7 +452,7 @@
   // like formats etc
   stringstream stream(fmt_str);
   DRM_LOGI("stream str %s len %zu blob str %s len %d", stream.str().c_str(), stream.str().length(),
-           blob->data, blob->length);
+           static_cast<const char *>(blob->data), blob->length);
 
   string line = {};
   string pixel_formats = "pixel_formats=";
diff --git a/sdm/include/core/layer_stack.h b/sdm/include/core/layer_stack.h
index e927a5e..a697721 100644
--- a/sdm/include/core/layer_stack.h
+++ b/sdm/include/core/layer_stack.h
@@ -44,6 +44,10 @@
 #include "layer_buffer.h"
 #include "sdm_types.h"
 
+#ifdef FOD_ZPOS
+#include <drm/sde_drm.h>
+#endif
+
 namespace sdm {
 
 /*! @brief This enum represents display layer blending types.
@@ -180,6 +184,10 @@
       uint32_t sde_preferred : 1;  //! This flag shall be set by client to indicate that this layer
                                    //! will be composed by display device, layer with this flag
                                    //! will have highest priority. To be used by OEMs only.
+#ifdef FOD_ZPOS
+      uint32_t fod_pressed : 1;    //!< This flag shall be set internally to mark the fod pressed
+                                   //!< layer
+#endif
     };
 
     uint32_t flags = 0;       //!< For initialization purpose only.
@@ -285,6 +293,8 @@
       uint32_t config_changed : 1;  //!< This flag indicates Display config must be validated.
 
       uint32_t scaling_rgb_layer_present : 1; //!< This flag indicates scaling rgb layer presense
+
+      uint32_t fod_pressed_present : 1;
     };
 
     uint32_t flags = 0;               //!< For initialization purpose only.
diff --git a/sdm/libs/core/Android.mk b/sdm/libs/core/Android.mk
index c6d6feb..4ee29be 100644
--- a/sdm/libs/core/Android.mk
+++ b/sdm/libs/core/Android.mk
@@ -22,6 +22,10 @@
     LOCAL_CFLAGS              += -DPP_DRM_ENABLE
 endif
 
+ifeq ($(TARGET_USES_FOD_ZPOS), true)
+    LOCAL_CFLAGS                  += -DFOD_ZPOS
+endif
+
 LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
 LOCAL_SRC_FILES               := core_interface.cpp \
                                  core_impl.cpp \
@@ -49,30 +53,3 @@
 endif
 
 include $(BUILD_SHARED_LIBRARY)
-
-SDM_HEADER_PATH := ../../include
-include $(CLEAR_VARS)
-LOCAL_VENDOR_MODULE           := true
-LOCAL_COPY_HEADERS_TO         := $(common_header_export_path)/sdm/core
-LOCAL_COPY_HEADERS             = $(SDM_HEADER_PATH)/core/buffer_allocator.h \
-                                 $(SDM_HEADER_PATH)/core/buffer_sync_handler.h \
-                                 $(SDM_HEADER_PATH)/core/core_interface.h \
-                                 $(SDM_HEADER_PATH)/core/display_interface.h \
-                                 $(SDM_HEADER_PATH)/core/layer_buffer.h \
-                                 $(SDM_HEADER_PATH)/core/layer_stack.h \
-                                 $(SDM_HEADER_PATH)/core/sdm_types.h \
-                                 $(SDM_HEADER_PATH)/core/socket_handler.h \
-                                 $(SDM_HEADER_PATH)/core/dpps_interface.h
-include $(BUILD_COPY_HEADERS)
-
-include $(CLEAR_VARS)
-LOCAL_VENDOR_MODULE           := true
-LOCAL_COPY_HEADERS_TO         := $(common_header_export_path)/sdm/private
-LOCAL_COPY_HEADERS             = $(SDM_HEADER_PATH)/private/color_interface.h \
-                                 $(SDM_HEADER_PATH)/private/color_params.h \
-                                 $(SDM_HEADER_PATH)/private/extension_interface.h \
-                                 $(SDM_HEADER_PATH)/private/hw_info_types.h \
-                                 $(SDM_HEADER_PATH)/private/partial_update_interface.h \
-                                 $(SDM_HEADER_PATH)/private/resource_interface.h \
-                                 $(SDM_HEADER_PATH)/private/strategy_interface.h
-include $(BUILD_COPY_HEADERS)
diff --git a/sdm/libs/core/drm/hw_device_drm.cpp b/sdm/libs/core/drm/hw_device_drm.cpp
index ac726fc..7b15b43 100644
--- a/sdm/libs/core/drm/hw_device_drm.cpp
+++ b/sdm/libs/core/drm/hw_device_drm.cpp
@@ -1220,7 +1220,17 @@
         if (update_config) {
           drm_atomic_intf_->Perform(DRMOps::PLANE_SET_ALPHA, pipe_id, layer.plane_alpha);
 
+#ifdef FOD_ZPOS
+          uint32_t z_order = pipe_info->z_order;
+          if (layer.flags.fod_pressed
+              || (hw_layer_info.stack->flags.fod_pressed_present
+                && i == hw_layer_count - 1)) {
+            z_order |= FOD_PRESSED_LAYER_ZORDER;
+          }
+          drm_atomic_intf_->Perform(DRMOps::PLANE_SET_ZORDER, pipe_id, z_order);
+#else
           drm_atomic_intf_->Perform(DRMOps::PLANE_SET_ZORDER, pipe_id, pipe_info->z_order);
+#endif
 
           DRMBlendType blending = {};
           SetBlending(layer.blending, &blending);
diff --git a/sdm/libs/utils/Android.mk b/sdm/libs/utils/Android.mk
index c474193..6a3b6a6 100644
--- a/sdm/libs/utils/Android.mk
+++ b/sdm/libs/utils/Android.mk
@@ -18,20 +18,3 @@
 
 LOCAL_SHARED_LIBRARIES        := libdisplaydebug
 include $(BUILD_SHARED_LIBRARY)
-
-SDM_HEADER_PATH := ../../include
-include $(CLEAR_VARS)
-LOCAL_VENDOR_MODULE           := true
-LOCAL_COPY_HEADERS_TO         := $(common_header_export_path)/sdm/utils
-LOCAL_COPY_HEADERS             = $(SDM_HEADER_PATH)/utils/constants.h \
-                                 $(SDM_HEADER_PATH)/utils/debug.h \
-                                 $(SDM_HEADER_PATH)/utils/formats.h \
-                                 $(SDM_HEADER_PATH)/utils/locker.h \
-                                 $(SDM_HEADER_PATH)/utils/rect.h \
-                                 $(SDM_HEADER_PATH)/utils/sys.h \
-                                 $(SDM_HEADER_PATH)/utils/sync_task.h \
-                                 $(SDM_HEADER_PATH)/utils/utils.h \
-                                 $(SDM_HEADER_PATH)/utils/fence.h \
-                                 $(SDM_HEADER_PATH)/utils/factory.h
-
-include $(BUILD_COPY_HEADERS)