hwc: Enforce HWC integrity with IDisplayConfig interfaces

- Ensure that HWC implementation for IDisplayConfig interfaces
  is added only if corresponding interfaces are present. Remove
  all featurizations.

Change-Id: I8e825903e48f5610de8277b33666510a1687c855
CRs-Fixed: 2497956
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/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_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index 0037461..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(
@@ -3318,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