Merge "hwc2: Couple SetActiveConfig to commit" into display.lnx.5.1
diff --git a/common.mk b/common.mk
index fbfe96f..6c17458 100644
--- a/common.mk
+++ b/common.mk
@@ -1,57 +1,6 @@
 #Common headers
 display_top := $(call my-dir)
 
-#Get the highest display config version available
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.10" ];\
-    then echo DISPLAY_CONFIG_1_10; fi)
-
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.9" ];\
-    then echo DISPLAY_CONFIG_1_9; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.8" ];\
-    then echo DISPLAY_CONFIG_1_8; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.7" ];\
-    then echo DISPLAY_CONFIG_1_7; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.6" ];\
-    then echo DISPLAY_CONFIG_1_6; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.5" ];\
-    then echo DISPLAY_CONFIG_1_5; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\
-    then echo DISPLAY_CONFIG_1_4; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\
-    then echo DISPLAY_CONFIG_1_3; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\
-    then echo DISPLAY_CONFIG_1_2; fi)
-endif
-ifeq ($(display_config_version),)
-display_config_version := $(shell \
-    if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
-    then echo DISPLAY_CONFIG_1_1; fi)
-endif
-
 #Common C flags
 common_flags := -Wno-missing-field-initializers
 common_flags += -Wconversion -Wall -Werror -std=c++14
@@ -61,49 +10,6 @@
     LOCAL_CLANG := false
 endif
 
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
-    common_flags += -DDISPLAY_CONFIG_1_1
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
-    common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
-    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
-    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2
-    common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_5)
-    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
-    common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_6)
-    common_flags += -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4
-    common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_7)
-    common_flags += -DDISPLAY_CONFIG_1_7
-    common_flags += -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4
-    common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_8)
-    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
-    common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
-    common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_9)
-    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
-    common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
-    common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DDISPLAY_CONFIG_1_9
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_10)
-    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
-    common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
-    common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DDISPLAY_CONFIG_1_9
-    common_flags += -DDISPLAY_CONFIG_1_10
-endif
-
 ifeq ($(TARGET_USES_COLOR_METADATA), true)
     common_flags += -DUSE_COLOR_METADATA
 endif
diff --git a/config/display-product.mk b/config/display-product.mk
index ad8e47e..a20dfbe 100644
--- a/config/display-product.mk
+++ b/config/display-product.mk
@@ -71,6 +71,9 @@
 #QDCM calibration xml file base on nt36672
 PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_trinket_default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_nt36672_truly_fhd_video_mode_dsi_panel.xml
 
+#QDCM calibration xml file base on Rennell FHD+ visionox panel
+PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_rm69299_amoled_fhd+_video_mode_dsi_visionox_panel.xml
+
 PRODUCT_PROPERTY_OVERRIDES += \
     persist.demo.hdmirotationlock=false \
     persist.sys.sf.color_saturation=1.0 \
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index 387eaca..1236ed5 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -59,7 +59,7 @@
         /* Enable/Disable/Set refresh rate dynamically */
         CONFIGURE_DYN_REFRESH_RATE = 18,
         CONTROL_PARTIAL_UPDATE = 19,   // Provides ability to enable/disable partial update
-        TOGGLE_SCREEN_UPDATES = 20, // Provides ability to set the panel brightness
+        TOGGLE_SCREEN_UPDATES = 20, // Provides ability to pause/resume display updates
         SET_FRAME_DUMP_CONFIG = 21,  // Provides ability to set the frame dump config
         SET_S3D_MODE = 22, // Set the 3D mode as specified in msm_hdmi_modes.h
         CONNECT_HDMI_CLIENT = 23,  // Connect HDMI CEC HAL Client
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index d6a257b..60e082b 100755
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -578,7 +578,7 @@
   if (error == kErrorNone) {
     active_ = active;
     state_ = state;
-    comp_manager_->SetDisplayState(display_comp_ctx_, state, *release_fence);
+    comp_manager_->SetDisplayState(display_comp_ctx_, state, release_fence ? *release_fence : -1);
   }
 
   return error;
diff --git a/sdm/libs/hwc2/Android.mk b/sdm/libs/hwc2/Android.mk
index 8aa8020..b573cd2 100644
--- a/sdm/libs/hwc2/Android.mk
+++ b/sdm/libs/hwc2/Android.mk
@@ -22,89 +22,23 @@
                                  libutils libcutils libsync libqdutils libqdMetaData \
                                  libdisplaydebug libsdmutils libc++ liblog libgrallocutils libui \
                                  libgpu_tonemapper libhidlbase libhidltransport \
-                                 vendor.display.config@1.0 \
                                  android.hardware.graphics.mapper@2.0 \
                                  android.hardware.graphics.mapper@2.1 \
                                  android.hardware.graphics.mapper@3.0 \
                                  android.hardware.graphics.allocator@2.0 \
                                  android.hardware.graphics.allocator@3.0 \
                                  android.hardware.graphics.composer@2.2 \
-
-$(info IDisplayConfig version: $(display_config_version))
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2 vendor.display.config@1.1
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_5)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.5
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_6)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.5
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.6
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_7)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.5
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.6
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.7
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_8)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.5
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.6
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.7
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.8
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_9)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.5
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.6
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.7
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.8
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.9
-endif
-ifeq ($(display_config_version), DISPLAY_CONFIG_1_10)
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.2
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.3
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.4
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.5
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.6
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.7
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.8
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.9
-LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.10
-endif
+                                 vendor.display.config@1.0 \
+                                 vendor.display.config@1.1 \
+                                 vendor.display.config@1.2 \
+                                 vendor.display.config@1.3 \
+                                 vendor.display.config@1.4 \
+                                 vendor.display.config@1.5 \
+                                 vendor.display.config@1.6 \
+                                 vendor.display.config@1.7 \
+                                 vendor.display.config@1.8 \
+                                 vendor.display.config@1.9 \
+                                 vendor.display.config@1.10
 
 ifeq ($(TARGET_BOARD_AUTO), true)
 LOCAL_CFLAGS                  += -DCONFIG_BASEID_FROM_PROP
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 03156a9..0fbf32f 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -158,10 +158,6 @@
     return error;
   }
 
-  if (current_color_mode_ == mode && current_render_intent_ == intent) {
-    return HWC2::Error::None;
-  }
-
   current_color_mode_ = mode;
   current_render_intent_ = intent;
   apply_mode_ = true;
diff --git a/sdm/libs/hwc2/hwc_display.h b/sdm/libs/hwc2/hwc_display.h
index 52ee563..80dd963 100644
--- a/sdm/libs/hwc2/hwc_display.h
+++ b/sdm/libs/hwc2/hwc_display.h
@@ -84,6 +84,7 @@
   ColorMode GetCurrentColorMode() { return current_color_mode_; }
   HWC2::Error ApplyCurrentColorModeWithRenderIntent(bool hdr_present);
   HWC2::Error CacheColorModeWithRenderIntent(ColorMode mode, RenderIntent intent);
+  RenderIntent GetCurrentRenderIntent() { return current_render_intent_; }
 
  private:
   static const uint32_t kColorTransformMatrixCount = 16;
@@ -232,6 +233,9 @@
   ColorMode GetCurrentColorMode() {
     return (color_mode_ ? color_mode_->GetCurrentColorMode() : ColorMode::SRGB);
   }
+  RenderIntent GetCurrentRenderIntent() {
+    return (color_mode_ ? color_mode_->GetCurrentRenderIntent() : RenderIntent::COLORIMETRIC);
+  }
   bool HasClientComposition() { return has_client_composition_; }
   bool HWCClientNeedsValidate() {
     return (has_client_composition_ || layer_stack_.flags.single_buffered_layer_present);
diff --git a/sdm/libs/hwc2/hwc_display_virtual.h b/sdm/libs/hwc2/hwc_display_virtual.h
index c325a7f..4de0d34 100644
--- a/sdm/libs/hwc2/hwc_display_virtual.h
+++ b/sdm/libs/hwc2/hwc_display_virtual.h
@@ -52,6 +52,9 @@
                                          int32_t format, bool post_processed);
   virtual HWC2::Error GetDisplayType(int32_t *out_type);
   virtual HWC2::Error SetColorMode(ColorMode mode);
+  virtual HWC2::Error SetColorModeWithRenderIntent(ColorMode mode, RenderIntent intent) {
+    return HWC2::Error::None;
+  }
   virtual HWC2::Error SetPanelLuminanceAttributes(float min_lum, float max_lum);
   HWC2::Error SetOutputBuffer(buffer_handle_t buf, int32_t release_fence);
 
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index c83b887..64af926 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -1896,18 +1896,8 @@
   auto f_in = static_cast<uint32_t>(input_parcel->readInt32());
   auto f_out = static_cast<uint32_t>(input_parcel->readInt32());
 
-#ifdef DISPLAY_CONFIG_1_5
   return static_cast<android::status_t>(SetDisplayDppsAdROI(display_id, h_s, h_e, v_s,
                                                             v_e, f_in, f_out));
-#else
-  auto err = CallDisplayFunction(static_cast<hwc2_device_t *>(this), display_id,
-                                 &HWCDisplay::SetDisplayDppsAdROI, h_s, h_e, v_s, v_e,
-                                 f_in, f_out);
-  if (err != HWC2_ERROR_NONE)
-    return -EINVAL;
-
-  return 0;
-#endif
 }
 
 android::status_t HWCSession::SetColorModeWithRenderIntentOverride(
@@ -2993,7 +2983,8 @@
         DLOGE("%d mode for display = %d failed with error = %d", mode, display, status);
       }
       ColorMode color_mode = hwc_display_[display]->GetCurrentColorMode();
-      status = hwc_display_[display]->SetColorMode(color_mode);
+      RenderIntent intent = hwc_display_[display]->GetCurrentRenderIntent();
+      status = hwc_display_[display]->SetColorModeWithRenderIntent(color_mode, intent);
       if (status != HWC2::Error::None) {
         DLOGE("SetColorMode failed for display = %d error = %d", display, status);
       }
@@ -3317,36 +3308,7 @@
   auto enable = input_parcel->readInt32();
   auto synchronous = input_parcel->readInt32();
 
-#ifdef DISPLAY_CONFIG_1_3
   return static_cast<android::status_t>(controlIdlePowerCollapse(enable, synchronous));
-#else
-  {
-    hwc2_display_t active_builtin_disp_id = GetActiveBuiltinDisplay();
-    if (active_builtin_disp_id >= HWCCallbacks::kNumDisplays) {
-      DLOGE("No active displays");
-      return -EINVAL;
-    }
-    SEQUENCE_WAIT_SCOPE_LOCK(locker_[active_builtin_disp_id]);
-    if (hwc_display_[active_builtin_disp_id]) {
-      DLOGE("Primary display is not ready");
-      return -EINVAL;
-    }
-    auto err = hwc_display_[active_builtin_disp_id]->ControlIdlePowerCollapse(enable, synchronous);
-    if (err != kErrorNone) {
-      return (err == kErrorNotSupported) ? 0 : -EINVAL;
-    }
-    if (!enable) {
-      Refresh(active_builtin_disp_id);
-      int32_t error = locker_[active_builtin_disp_id].WaitFinite(kCommitDoneTimeoutMs);
-      if (error == ETIMEDOUT) {
-        DLOGE("Timed out!! Next frame commit done event not received!!");
-        return error;
-      }
-    }
-    DLOGI("Idle PC %s!!", enable ? "enabled" : "disabled");
-  }
-  return 0;
-#endif
 }
 
 hwc2_display_t HWCSession::GetActiveBuiltinDisplay() {
diff --git a/sdm/libs/hwc2/hwc_session.h b/sdm/libs/hwc2/hwc_session.h
index 75b288b..fd6a4b7 100644
--- a/sdm/libs/hwc2/hwc_session.h
+++ b/sdm/libs/hwc2/hwc_session.h
@@ -20,29 +20,7 @@
 #ifndef __HWC_SESSION_H__
 #define __HWC_SESSION_H__
 
-#ifdef DISPLAY_CONFIG_1_10
 #include <vendor/display/config/1.10/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_9
-#include <vendor/display/config/1.9/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_8
-#include <vendor/display/config/1.8/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_7
-#include <vendor/display/config/1.7/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_6
-#include <vendor/display/config/1.6/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_5
-#include <vendor/display/config/1.5/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_4
-#include <vendor/display/config/1.4/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_3
-#include <vendor/display/config/1.3/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_2
-#include <vendor/display/config/1.2/IDisplayConfig.h>
-#elif DISPLAY_CONFIG_1_1
-#include <vendor/display/config/1.1/IDisplayConfig.h>
-#else
-#include <vendor/display/config/1.0/IDisplayConfig.h>
-#endif
 
 #include <core/core_interface.h>
 #include <utils/locker.h>
@@ -67,34 +45,8 @@
 
 namespace sdm {
 
-#ifdef DISPLAY_CONFIG_1_10
 using vendor::display::config::V1_10::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_9
-using vendor::display::config::V1_9::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_8
-using vendor::display::config::V1_8::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_7
-using vendor::display::config::V1_7::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_6
-using vendor::display::config::V1_6::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_5
-using vendor::display::config::V1_5::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_4
-using vendor::display::config::V1_4::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_3
-using vendor::display::config::V1_3::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_2
-using vendor::display::config::V1_2::IDisplayConfig;
-#elif DISPLAY_CONFIG_1_1
-using vendor::display::config::V1_1::IDisplayConfig;
-#else
-using vendor::display::config::V1_0::IDisplayConfig;
-#endif
-
-#ifdef DISPLAY_CONFIG_1_10
-// Need to be declarated for any version 10 or above.
 using vendor::display::config::V1_10::IDisplayCWBCallback;
-#endif
 
 using ::android::hardware::Return;
 using ::android::hardware::hidl_string;
@@ -351,30 +303,16 @@
                                   getHDRCapabilities_cb _hidl_cb) override;
   Return<int32_t> setCameraLaunchStatus(uint32_t on) override;
   Return<void> displayBWTransactionPending(displayBWTransactionPending_cb _hidl_cb) override;
-#ifdef DISPLAY_CONFIG_1_1
   Return<int32_t> setDisplayAnimating(uint64_t display_id, bool animating) override;
-#endif
-  // Methods from ::android::hardware::display::config::V1_2::IDisplayConfig follow.
-#ifdef DISPLAY_CONFIG_1_2
   Return<int32_t> setDisplayIndex(IDisplayConfig::DisplayTypeExt disp_type,
                                   uint32_t base, uint32_t count) override;
-#endif
-#ifdef DISPLAY_CONFIG_1_3
   Return<int32_t> controlIdlePowerCollapse(bool enable, bool synchronous) override;
-#endif
-#ifdef DISPLAY_CONFIG_1_4
   Return<void> getWriteBackCapabilities(getWriteBackCapabilities_cb _hidl_cb) override;
-#endif
-#ifdef DISPLAY_CONFIG_1_5
   Return<int32_t> SetDisplayDppsAdROI(uint32_t dispaly_id, uint32_t h_start, uint32_t h_end,
                                       uint32_t v_start, uint32_t v_end, uint32_t factor_in,
                                       uint32_t factor_out) override;
-#endif
-#ifdef DISPLAY_CONFIG_1_6
   Return<int32_t> updateVSyncSourceOnPowerModeOff() override;
   Return<int32_t> updateVSyncSourceOnPowerModeDoze() override;
-#endif
-#ifdef DISPLAY_CONFIG_1_7
   Return<int32_t> setPowerMode(uint32_t disp_id, PowerMode power_mode) override;
   Return<bool> isPowerModeOverrideSupported(uint32_t disp_id) override;
   Return<bool> isHDRSupported(uint32_t disp_id) override;
@@ -382,19 +320,10 @@
   Return<int32_t> setLayerAsMask(uint32_t disp_id, uint64_t layer_id) override;
   Return<void> getDebugProperty(const hidl_string &prop_name,
                                 getDebugProperty_cb _hidl_cb) override;
-#endif
-
-#ifdef DISPLAY_CONFIG_1_8
   Return<void> getActiveBuiltinDisplayAttributes(getDisplayAttributes_cb _hidl_cb) override;
-#endif
-
-#ifdef DISPLAY_CONFIG_1_9
   Return<int32_t> setPanelLuminanceAttributes(uint32_t disp_id, float min_lum,
                                               float max_lum) override;
   Return<bool> isBuiltInDisplay(uint32_t disp_id) override;
-#endif
-
-#ifdef DISPLAY_CONFIG_1_10
   Return<void> getSupportedDSIBitClks(uint32_t disp_id,
                                       getSupportedDSIBitClks_cb _hidl_cb) override;
   Return<uint64_t> getDSIClk(uint32_t disp_id) override;
@@ -402,7 +331,6 @@
   Return<int32_t> setCWBOutputBuffer(const ::android::sp<IDisplayCWBCallback> &callback,
                                      uint32_t disp_id, const Rect &rect, bool post_processed,
                                      const hidl_handle& buffer) override;
-#endif
 
   // QClient methods
   virtual android::status_t notifyCallback(uint32_t command, const android::Parcel *input_parcel,
diff --git a/sdm/libs/hwc2/hwc_session_services.cpp b/sdm/libs/hwc2/hwc_session_services.cpp
index a3f5228..cb6b80f 100644
--- a/sdm/libs/hwc2/hwc_session_services.cpp
+++ b/sdm/libs/hwc2/hwc_session_services.cpp
@@ -556,21 +556,16 @@
   return Void();
 }
 
-#ifdef DISPLAY_CONFIG_1_1
 Return<int32_t> HWCSession::setDisplayAnimating(uint64_t display_id, bool animating ) {
   return CallDisplayFunction(static_cast<hwc2_device_t *>(this), display_id,
                              &HWCDisplay::SetDisplayAnimating, animating);
 }
-#endif
 
-#ifdef DISPLAY_CONFIG_1_2
 Return<int32_t> HWCSession::setDisplayIndex(IDisplayConfig::DisplayTypeExt disp_type,
                                             uint32_t base, uint32_t count) {
   return -1;
 }
-#endif  // DISPLAY_CONFIG_1_2
 
-#ifdef DISPLAY_CONFIG_1_3
 Return<int32_t> HWCSession::controlIdlePowerCollapse(bool enable, bool synchronous) {
   hwc2_display_t active_builtin_disp_id = GetActiveBuiltinDisplay();
   if (active_builtin_disp_id >= HWCCallbacks::kNumDisplays) {
@@ -613,8 +608,6 @@
   DLOGW("Display = %d is not connected.", active_builtin_disp_id);
   return -ENODEV;
 }
-#endif  // DISPLAY_CONFIG_1_3
-
 
 int32_t HWCSession::IsWbUbwcSupported(int *value) {
   HWDisplaysInfo hw_displays_info = {};
@@ -633,7 +626,6 @@
   return error;
 }
 
-#ifdef DISPLAY_CONFIG_1_4
 Return<void> HWCSession::getWriteBackCapabilities(getWriteBackCapabilities_cb _hidl_cb) {
   int value = 0;
   IDisplayConfig::WriteBackCapabilities wb_caps = {};
@@ -643,9 +635,7 @@
 
   return Void();
 }
-#endif  // DISPLAY_CONFIG_1_4
 
-#ifdef DISPLAY_CONFIG_1_5
 Return<int32_t> HWCSession::SetDisplayDppsAdROI(uint32_t display_id, uint32_t h_start,
                                                 uint32_t h_end, uint32_t v_start, uint32_t v_end,
                                                 uint32_t factor_in, uint32_t factor_out) {
@@ -653,9 +643,7 @@
                              &HWCDisplay::SetDisplayDppsAdROI, h_start, h_end, v_start, v_end,
                              factor_in, factor_out);
 }
-#endif  // DISPLAY_CONFIG_1_5
 
-#ifdef DISPLAY_CONFIG_1_6
 Return<int32_t> HWCSession::updateVSyncSourceOnPowerModeOff() {
   return 0;
 }
@@ -663,9 +651,7 @@
 Return<int32_t> HWCSession::updateVSyncSourceOnPowerModeDoze() {
   return 0;
 }
-#endif
 
-#ifdef DISPLAY_CONFIG_1_7
 Return<bool> HWCSession::isPowerModeOverrideSupported(uint32_t disp_id) {
   if (!async_powermode_ || (disp_id > HWCCallbacks::kNumRealDisplays)) {
     return false;
@@ -775,9 +761,7 @@
 
   return Void();
 }
-#endif
 
-#ifdef DISPLAY_CONFIG_1_8
 Return<void> HWCSession::getActiveBuiltinDisplayAttributes(
                                           getDisplayAttributes_cb _hidl_cb) {
   int32_t error = -EINVAL;
@@ -812,9 +796,7 @@
 
   return Void();
 }
-#endif  // DISPLAY_CONFIG_1_8
 
-#ifdef DISPLAY_CONFIG_1_9
 Return<int32_t> HWCSession::setPanelLuminanceAttributes(uint32_t disp_id, float pan_min_lum,
                                                         float pan_max_lum) {
   // currently doing only for virtual display
@@ -842,9 +824,7 @@
 
   return false;
 }
-#endif  // DISPLAY_CONFIG_1_9
 
-#ifdef DISPLAY_CONFIG_1_10
 Return<void> HWCSession::getSupportedDSIBitClks(uint32_t disp_id,
                                                 getSupportedDSIBitClks_cb _hidl_cb) {
   SCOPE_LOCK(locker_[disp_id]);
@@ -887,6 +867,5 @@
                                                bool post_processed, const hidl_handle& buffer) {
   return -1;
 }
-#endif  // DISPLAY_CONFIG_1_10
 
 }  // namespace sdm