sdm: comply with treble guidelines

Modify the property names and use macros in place of them

CRs-Fixed: 2206249
Change-Id: I0ccc09fc8335560654e487e78552f79ff7a083de
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index 7a0f3cd..56bb750 100644
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -139,7 +139,7 @@
     DisplayBase::SetMaxMixerStages(max_mixer_stages);
   }
 
-  Debug::GetProperty("sdm.disable_hdr_lut_gen", &disable_hdr_lut_gen_);
+  Debug::GetProperty(DISABLE_HDR_LUT_GEN, &disable_hdr_lut_gen_);
   // TODO(user): Temporary changes, to be removed when DRM driver supports
   // Partial update with Destination scaler enabled.
   SetPUonDestScaler();
diff --git a/sdm/libs/core/display_hdmi.cpp b/sdm/libs/core/display_hdmi.cpp
index c72bc1e..3165f73 100644
--- a/sdm/libs/core/display_hdmi.cpp
+++ b/sdm/libs/core/display_hdmi.cpp
@@ -55,7 +55,7 @@
 
   uint32_t active_mode_index;
   char value[64] = "0";
-  Debug::GetProperty("sdm.hdmi.s3d_mode", value);
+  Debug::GetProperty(HDMI_S3D_MODE_PROP, value);
   HWS3DMode mode = (HWS3DMode)atoi(value);
   if (mode > kS3DModeNone && mode < kS3DModeMax) {
     active_mode_index = GetBestConfig(mode);
diff --git a/sdm/libs/core/drm/hw_events_drm.cpp b/sdm/libs/core/drm/hw_events_drm.cpp
index d2aa668..7703bda 100644
--- a/sdm/libs/core/drm/hw_events_drm.cpp
+++ b/sdm/libs/core/drm/hw_events_drm.cpp
@@ -233,7 +233,7 @@
   RegisterIdlePowerCollapse(true);
 
   int value = 0;
-  if (Debug::Get()->GetProperty("sdm.debug.disable_hw_recovery", &value) == kErrorNone) {
+  if (Debug::Get()->GetProperty(DISABLE_HW_RECOVERY_PROP, &value) == kErrorNone) {
     disable_hw_recovery_ = (value == 1);
   }
   DLOGI("disable_hw_recovery set to %d", disable_hw_recovery_);
diff --git a/sdm/libs/core/drm/hw_info_drm.cpp b/sdm/libs/core/drm/hw_info_drm.cpp
index 9cefc8b..2ba7e92 100644
--- a/sdm/libs/core/drm/hw_info_drm.cpp
+++ b/sdm/libs/core/drm/hw_info_drm.cpp
@@ -208,7 +208,7 @@
   // through property
   int value = 0;
   bool disable_dest_scalar = false;
-  if (Debug::GetProperty("sdm.debug.disable_dest_scalar", &value) == kErrorNone) {
+  if (Debug::GetProperty(DISABLE_DESTINATION_SCALER_PROP, &value) == kErrorNone) {
     disable_dest_scalar = (value == 1);
   }
   DynLib extension_lib;
@@ -333,7 +333,7 @@
   uint32_t dma_pipe_count = 0;
   uint32_t virtual_pipe_count = 0;
   int disable_src_tonemap = 0;
-  Debug::Get()->GetProperty("sdm.disable_src_tonemap", &disable_src_tonemap);
+  Debug::Get()->GetProperty(DISABLE_SRC_TONEMAP_PROP, &disable_src_tonemap);
 
   for (auto &pipe_obj : planes) {
     if (max_vig_pipes && max_dma_pipes) {
diff --git a/sdm/libs/hwc2/cpuhint.cpp b/sdm/libs/hwc2/cpuhint.cpp
index 551fa24..ca88ead 100644
--- a/sdm/libs/hwc2/cpuhint.cpp
+++ b/sdm/libs/hwc2/cpuhint.cpp
@@ -46,7 +46,7 @@
   }
 
   int pre_enable_window = -1;
-  debug_handler->GetProperty("sdm.perf_hint_window", &pre_enable_window);
+  debug_handler->GetProperty(PERF_HINT_WINDOW_PROP, &pre_enable_window);
   if (pre_enable_window <= 0) {
     DLOGI("Invalid CPU Hint Pre-enable Window %d", pre_enable_window);
     return kErrorNotSupported;
diff --git a/sdm/libs/hwc2/hwc_debugger.cpp b/sdm/libs/hwc2/hwc_debugger.cpp
index 39416c5..82f0e47 100644
--- a/sdm/libs/hwc2/hwc_debugger.cpp
+++ b/sdm/libs/hwc2/hwc_debugger.cpp
@@ -29,6 +29,7 @@
 
 #include <utils/constants.h>
 #include <cutils/properties.h>
+#include <display_properties.h>
 
 #include "hwc_debugger.h"
 
@@ -211,7 +212,7 @@
 
 int  HWCDebugHandler::GetIdleTimeoutMs() {
   int value = IDLE_TIMEOUT_DEFAULT_MS;
-  debug_handler_.GetProperty("sdm.idle_time", &value);
+  debug_handler_.GetProperty(IDLE_TIME_PROP, &value);
 
   return value;
 }
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 186bb28..77a93f8 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -351,7 +351,7 @@
 int HWCDisplay::Init() {
   DisplayError error = kErrorNone;
 
-  HWCDebugHandler::Get()->GetProperty("sdm.debug.enable_null_display", &null_display_mode_);
+  HWCDebugHandler::Get()->GetProperty(ENABLE_NULL_DISPLAY_PROP, &null_display_mode_);
 
   if (null_display_mode_) {
     DisplayNull *disp_null = new DisplayNull();
@@ -369,7 +369,7 @@
   }
 
   validated_ = false;
-  HWCDebugHandler::Get()->GetProperty("sys.hwc_disable_hdr", &disable_hdr_handling_);
+  HWCDebugHandler::Get()->GetProperty(DISABLE_HDR, &disable_hdr_handling_);
   if (disable_hdr_handling_) {
     DLOGI("HDR Handling disabled");
   }
@@ -383,7 +383,7 @@
   client_target_ = new HWCLayer(id_, buffer_allocator_);
 
   int blit_enabled = 0;
-  HWCDebugHandler::Get()->GetProperty("persist.hwc.blit.comp", &blit_enabled);
+  HWCDebugHandler::Get()->GetProperty(DISABLE_BLIT_COMPOSITION_PROP, &blit_enabled);
   if (needs_blit_ && blit_enabled) {
     // TODO(user): Add blit engine when needed
   }
@@ -1535,7 +1535,7 @@
 
   // By default UBWC is enabled and below property is global enable/disable for all
   // buffers allocated through gralloc , including framebuffer targets.
-  HWCDebugHandler::Get()->GetProperty("debug.gralloc.gfx_ubwc_disable", &ubwc_disabled);
+  HWCDebugHandler::Get()->GetProperty(DISABLE_UBWC_PROP, &ubwc_disabled);
   if (!ubwc_disabled) {
     usage |= GRALLOC_USAGE_PRIVATE_ALLOC_UBWC;
     flags |= private_handle_t::PRIV_FLAGS_UBWC_ALIGNED;
diff --git a/sdm/libs/hwc2/hwc_display_external.cpp b/sdm/libs/hwc2/hwc_display_external.cpp
index 8e253de..998bedb 100644
--- a/sdm/libs/hwc2/hwc_display_external.cpp
+++ b/sdm/libs/hwc2/hwc_display_external.cpp
@@ -77,7 +77,7 @@
       external_height = primary_height;
     } else {
       int downscale_enabled = 0;
-      HWCDebugHandler::Get()->GetProperty("sdm.debug.downscale_external", &downscale_enabled);
+      HWCDebugHandler::Get()->GetProperty(ENABLE_EXTERNAL_DOWNSCALE_PROP, &downscale_enabled);
       if (downscale_enabled) {
         GetDownscaleResolution(primary_width, primary_height, &external_width, &external_height);
       }
@@ -267,8 +267,8 @@
 void HWCDisplayExternal::GetUnderScanConfig() {
   if (!display_intf_->IsUnderscanSupported()) {
     // Read user defined underscan width and height
-    HWCDebugHandler::Get()->GetProperty("sdm.external_action_safe_width", &underscan_width_);
-    HWCDebugHandler::Get()->GetProperty("sdm.external_action_safe_height", &underscan_height_);
+    HWCDebugHandler::Get()->GetProperty(EXTERNAL_ACTION_SAFE_WIDTH_PROP, &underscan_width_);
+    HWCDebugHandler::Get()->GetProperty(EXTERNAL_ACTION_SAFE_HEIGHT_PROP, &underscan_height_);
   }
 }
 
diff --git a/sdm/libs/hwc2/hwc_display_primary.cpp b/sdm/libs/hwc2/hwc_display_primary.cpp
index 8b98958..c68081a 100644
--- a/sdm/libs/hwc2/hwc_display_primary.cpp
+++ b/sdm/libs/hwc2/hwc_display_primary.cpp
@@ -62,8 +62,8 @@
 
   hwc_display_primary->GetMixerResolution(&primary_width, &primary_height);
   int width = 0, height = 0;
-  HWCDebugHandler::Get()->GetProperty("sdm.fb_size_width", &width);
-  HWCDebugHandler::Get()->GetProperty("sdm.fb_size_height", &height);
+  HWCDebugHandler::Get()->GetProperty(FB_WIDTH_PROP, &width);
+  HWCDebugHandler::Get()->GetProperty(FB_HEIGHT_PROP, &height);
   if (width > 0 && height > 0) {
     primary_width = UINT32(width);
     primary_height = UINT32(height);
@@ -102,7 +102,7 @@
 
   use_metadata_refresh_rate_ = true;
   int disable_metadata_dynfps = 0;
-  HWCDebugHandler::Get()->GetProperty("persist.metadata_dynfps.disable", &disable_metadata_dynfps);
+  HWCDebugHandler::Get()->GetProperty(DISABLE_METADATA_DYNAMIC_FPS_PROP, &disable_metadata_dynfps);
   if (disable_metadata_dynfps) {
     use_metadata_refresh_rate_ = false;
   }
@@ -113,7 +113,7 @@
   }
   color_mode_ = new HWCColorMode(display_intf_);
   color_mode_->Init();
-  HWCDebugHandler::Get()->GetProperty("vendor.display.enable_default_color_mode",
+  HWCDebugHandler::Get()->GetProperty(ENABLE_DEFAULT_COLOR_MODE,
                                       &default_mode_status_);
 
   return status;
@@ -362,7 +362,7 @@
 void HWCDisplayPrimary::SetMetaDataRefreshRateFlag(bool enable) {
   int disable_metadata_dynfps = 0;
 
-  HWCDebugHandler::Get()->GetProperty("persist.metadata_dynfps.disable", &disable_metadata_dynfps);
+  HWCDebugHandler::Get()->GetProperty(DISABLE_METADATA_DYNAMIC_FPS_PROP, &disable_metadata_dynfps);
   if (disable_metadata_dynfps) {
     return;
   }
diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp
index ca04d40..eab73d4 100644
--- a/sdm/libs/hwc2/hwc_session.cpp
+++ b/sdm/libs/hwc2/hwc_session.cpp
@@ -161,7 +161,7 @@
 
   StartServices();
 
-  HWCDebugHandler::Get()->GetProperty("sdm.debug.enable_null_display", &null_display_mode_);
+  HWCDebugHandler::Get()->GetProperty(ENABLE_NULL_DISPLAY_PROP, &null_display_mode_);
   DisplayError error = kErrorNone;
 
   HWDisplayInterfaceInfo hw_disp_info = {};
@@ -300,7 +300,7 @@
 
   int value = 0;
   bool disable_skip_validate = false;
-  if (Debug::Get()->GetProperty("sdm.debug.disable_skip_validate", &value) == kErrorNone) {
+  if (Debug::Get()->GetProperty(DISABLE_SKIP_VALIDATE_PROP, &value) == kErrorNone) {
     disable_skip_validate = (value == 1);
   }
   uint32_t count = 1 + (disable_skip_validate ? 0 : 1);
diff --git a/sdm/libs/hwc2/hwc_tonemapper.cpp b/sdm/libs/hwc2/hwc_tonemapper.cpp
index 2ae1afc..22896f9 100644
--- a/sdm/libs/hwc2/hwc_tonemapper.cpp
+++ b/sdm/libs/hwc2/hwc_tonemapper.cpp
@@ -333,7 +333,7 @@
 
 DisplayError HWCToneMapper::AcquireToneMapSession(Layer *layer, uint32_t *session_index,
                                                   PrimariesTransfer blend_cs) {
-  // When the property sdm.disable_hdr_lut_gen is set, the lutEntries and gridEntries in
+  // When the property vendor.display.disable_hdr_lut_gen is set, the lutEntries and gridEntries in
   // the Lut3d will be NULL, clients needs to allocate the memory and set correct 3D Lut
   // for Tonemapping.
   if (!layer->lut_3d.lutEntries || !layer->lut_3d.dim) {
diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp
index 62a6cad..05d5c7b 100644
--- a/sdm/libs/utils/debug.cpp
+++ b/sdm/libs/utils/debug.cpp
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2014 - 2017, The Linux Foundation. All rights reserved.
+* Copyright (c) 2014 - 2018, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -37,14 +37,14 @@
 
 int Debug::GetSimulationFlag() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.composition_simulation", &value);
+  DebugHandler::Get()->GetProperty(COMPOSITION_MASK_PROP, &value);
 
   return value;
 }
 
 bool Debug::GetExternalResolution(char *value) {
   uint32_t retval = 0;
-  DebugHandler::Get()->GetProperty("hw.hdmi.resolution", value);
+  DebugHandler::Get()->GetProperty(HDMI_CONFIG_INDEX_PROP, value);
   if (value[0]) {
     retval = 1;
   }
@@ -56,8 +56,8 @@
   int active_val = IDLE_TIMEOUT_ACTIVE_MS;
   int inactive_val = IDLE_TIMEOUT_INACTIVE_MS;
 
-  DebugHandler::Get()->GetProperty("sdm.idle_time", &active_val);
-  DebugHandler::Get()->GetProperty("sdm.idle_time.inactive", &inactive_val);
+  DebugHandler::Get()->GetProperty(IDLE_TIME_PROP, &active_val);
+  DebugHandler::Get()->GetProperty(IDLE_TIME_INACTIVE_PROP, &inactive_val);
 
   *active_ms = UINT32(active_val);
   *inactive_ms = UINT32(inactive_val);
@@ -65,21 +65,21 @@
 
 int Debug::GetBootAnimLayerCount() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.boot_anim_layer_count", &value);
+  DebugHandler::Get()->GetProperty(BOOT_ANIMATION_LAYER_COUNT_PROP, &value);
 
   return value;
 }
 
 bool Debug::IsRotatorDownScaleDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.rotator_downscale", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_ROTATOR_DOWNSCALE_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsDecimationDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.disable_decimation", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_DECIMATION_PROP, &value);
 
   return (value == 1);
 }
@@ -88,13 +88,13 @@
   int value = -1;
   switch (display_type) {
   case kPrimary:
-    DebugHandler::Get()->GetProperty("sdm.primary.mixer_stages", &value);
+    DebugHandler::Get()->GetProperty(PRIMARY_MIXER_STAGES_PROP, &value);
     break;
   case kHDMI:
-    DebugHandler::Get()->GetProperty("sdm.external.mixer_stages", &value);
+    DebugHandler::Get()->GetProperty(EXTERNAL_MIXER_STAGES_PROP, &value);
     break;
   case kVirtual:
-    DebugHandler::Get()->GetProperty("sdm.virtual.mixer_stages", &value);
+    DebugHandler::Get()->GetProperty(VIRTUAL_MIXER_STAGES_PROP, &value);
     break;
   default:
     break;
@@ -105,35 +105,35 @@
 
 int Debug::GetMaxUpscale() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.max_upscale", &value);
+  DebugHandler::Get()->GetProperty(MAX_UPSCALE_PROP, &value);
 
   return value;
 }
 
 bool Debug::IsVideoModeEnabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.video_mode_panel", &value);
+  DebugHandler::Get()->GetProperty(VIDEO_MODE_PANEL_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsRotatorUbwcDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.rotator_disable_ubwc", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_ROTATOR_UBWC_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsRotatorSplitDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.disable_rotator_split", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_ROTATOR_SPLIT_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsScalarDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.disable_scalar", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_SCALER_PROP, &value);
 
   return (value == 1);
 }
@@ -142,10 +142,10 @@
   int ubwc_disabled = 0;
   int ubwc_framebuffer = 0;
 
-  DebugHandler::Get()->GetProperty("debug.gralloc.gfx_ubwc_disable", &ubwc_disabled);
+  DebugHandler::Get()->GetProperty(DISABLE_UBWC_PROP, &ubwc_disabled);
 
   if (!ubwc_disabled) {
-    DebugHandler::Get()->GetProperty("debug.gralloc.enable_fb_ubwc", &ubwc_framebuffer);
+    DebugHandler::Get()->GetProperty(ENABLE_FB_UBWC_PROP, &ubwc_framebuffer);
   }
 
   return (ubwc_framebuffer == 1);
@@ -153,28 +153,28 @@
 
 bool Debug::IsAVRDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.disable_avr", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_AVR_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsExtAnimDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sys.disable_ext_animation", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_EXTERNAL_ANIMATION_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsPartialSplitDisabled() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.disable_partial_split", &value);
+  DebugHandler::Get()->GetProperty(DISABLE_PARTIAL_SPLIT_PROP, &value);
 
   return (value == 1);
 }
 
 bool Debug::IsSrcSplitPreferred() {
   int value = 0;
-  DebugHandler::Get()->GetProperty("sdm.debug.prefersplit", &value);
+  DebugHandler::Get()->GetProperty(PREFER_SOURCE_SPLIT_PROP, &value);
 
   return (value == 1);
 }
@@ -182,7 +182,7 @@
 DisplayError Debug::GetMixerResolution(uint32_t *width, uint32_t *height) {
   char value[64] = {};
 
-  int error = DebugHandler::Get()->GetProperty("sdm.mixer_resolution", value);
+  int error = DebugHandler::Get()->GetProperty(MIXER_RESOLUTION_PROP, value);
   if (error != 0) {
     return kErrorUndefined;
   }
@@ -198,7 +198,7 @@
 DisplayError Debug::GetReducedConfig(uint32_t *num_vig_pipes, uint32_t *num_dma_pipes) {
   char value[64] = {};
 
-  int error = DebugHandler::Get()->GetProperty("sdm.debug.reduced_config", value);
+  int error = DebugHandler::Get()->GetProperty(SIMULATED_CONFIG_PROP, value);
   if (error != 0) {
     return kErrorUndefined;
   }
@@ -213,7 +213,7 @@
 
 int Debug::GetExtMaxlayers() {
   int max_external_layers = 0;
-  DebugHandler::Get()->GetProperty("sdm.max_external_layers", &max_external_layers);
+  DebugHandler::Get()->GetProperty(MAX_EXTERNAL_LAYERS_PROP, &max_external_layers);
 
   return std::max(max_external_layers, 2);
 }