From 5e9fb26857b4e7887cdf751b29406878674d6837 Mon Sep 17 00:00:00 2001 From: Ramkumar Radhakrishnan Date: Mon, 10 Jun 2019 11:28:03 -0700 Subject: [PATCH] sdm: Remove all unused properties and binder commands Change-Id: I4bc7b77b2f276d6779b7cdcce4de227f30e760f8 --- config/display-product.mk | 8 --- config/kona.mk | 10 +--- include/display_properties.h | 35 +++++------- libqdutils/display_config.cpp | 78 +++------------------------ libqservice/IQService.h | 12 +---- libqservice/QServiceUtils.h | 9 ---- sdm/include/utils/debug.h | 1 - sdm/libs/core/display_base.cpp | 1 - sdm/libs/core/display_base.h | 1 - sdm/libs/hwc2/hwc_display_builtin.cpp | 2 - sdm/libs/hwc2/hwc_display_builtin.h | 1 - sdm/libs/hwc2/hwc_session.cpp | 28 ---------- sdm/libs/utils/debug.cpp | 14 +---- 13 files changed, 25 insertions(+), 175 deletions(-) diff --git a/config/display-product.mk b/config/display-product.mk index 0cd0c66cbf..a69c8cce0b 100644 --- a/config/display-product.mk +++ b/config/display-product.mk @@ -50,7 +50,6 @@ PRODUCT_PROPERTY_OVERRIDES += \ vendor.display.disable_offline_rotator=1 \ vendor.display.disable_excl_rect=0 \ vendor.display.comp_mask=0 \ - vendor.display.enable_default_color_mode=1 \ vendor.display.enable_posted_start_dyn=1 \ vendor.display.use_smooth_motion=1 @@ -83,10 +82,3 @@ endif # Properties using default value: # vendor.display.disable_hw_recovery=0 - -# This matrix should be in column major order, per SurfaceFlinger requirement -# 1.0 0.0 0.0 -# 0.0 1.0 0.0 -# 0.0 0.0 1.0 -PRODUCT_PROPERTY_OVERRIDES += \ - vendor.display.dataspace_saturation_matrix=1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0 diff --git a/config/kona.mk b/config/kona.mk index 69430ccdcb..5d83c3fe45 100644 --- a/config/kona.mk +++ b/config/kona.mk @@ -56,8 +56,7 @@ PRODUCT_PROPERTY_OVERRIDES += \ vendor.display.disable_scaler=0 \ vendor.display.disable_offline_rotator=1 \ vendor.display.disable_excl_rect=0 \ - vendor.display.comp_mask=0 \ - vendor.display.enable_default_color_mode=1 + vendor.display.comp_mask=0 ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) # Recovery is enabled, logging is enabled @@ -82,10 +81,3 @@ PRODUCT_PROPERTY_OVERRIDES += \ vendor.display.enable_null_display=1 endif endif - -# This matrix should be in column major order, per SurfaceFlinger requirement -# 1.0 0.0 0.0 -# 0.0 1.0 0.0 -# 0.0 0.0 1.0 -PRODUCT_PROPERTY_OVERRIDES += \ - vendor.display.dataspace_saturation_matrix=1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0 diff --git a/include/display_properties.h b/include/display_properties.h index d27c6fc3fc..4f20713dd1 100644 --- a/include/display_properties.h +++ b/include/display_properties.h @@ -32,19 +32,17 @@ #define DISP_PROP_PREFIX "vendor.display." #define GRALLOC_PROP_PREFIX "vendor.gralloc." -#define RO_DISP_PROP_PREFIX "ro.vendor.display." #define PERSIST_DISP_PROP_PREFIX "persist.vendor.display." #define DISPLAY_PROP(prop_name) DISP_PROP_PREFIX prop_name #define GRALLOC_PROP(prop_name) GRALLOC_PROP_PREFIX prop_name -#define RO_DISPLAY_PROP(prop_name) RO_DISP_PROP_PREFIX prop_name #define PERSIST_DISPLAY_PROP(prop_name) PERSIST_DISP_PROP_PREFIX prop_name +// Start of property #define COMPOSITION_MASK_PROP DISPLAY_PROP("comp_mask") #define HDMI_CONFIG_INDEX_PROP DISPLAY_PROP("hdmi_cfg_idx") #define IDLE_TIME_PROP DISPLAY_PROP("idle_time") #define IDLE_TIME_INACTIVE_PROP DISPLAY_PROP("idle_time_inactive") -#define BOOT_ANIMATION_LAYER_COUNT_PROP DISPLAY_PROP("boot_anim_layer_count") #define DISABLE_ROTATOR_DOWNSCALE_PROP DISPLAY_PROP("disable_rotator_downscale") // Enables rotator for UI #define ENABLE_ROTATOR_UI_PROP DISPLAY_PROP("enable_rotator_ui") @@ -73,12 +71,6 @@ #define DISABLE_METADATA_DYNAMIC_FPS_PROP DISPLAY_PROP("disable_metadata_dynamic_fps") #define DISABLE_SKIP_VALIDATE_PROP DISPLAY_PROP("disable_skip_validate") #define DISABLE_DESTINATION_SCALER_PROP DISPLAY_PROP("disable_dest_scaler") -#define ENABLE_PARTIAL_UPDATE_PROP DISPLAY_PROP("enable_partial_update") -#define DISABLE_UBWC_PROP GRALLOC_PROP("disable_ubwc") -#define ENABLE_FB_UBWC_PROP GRALLOC_PROP("enable_fb_ubwc") -#define MAP_FB_MEMORY_PROP GRALLOC_PROP("map_fb_memory") - -#define MAX_BLIT_FACTOR_PROP DISPLAY_PROP("max_blit_factor") #define DISABLE_SECURE_INLINE_ROTATOR_PROP DISPLAY_PROP("disable_secure_inline_rotator") #define DISABLE_MULTIRECT_PROP DISPLAY_PROP("disable_multirect") #define DISABLE_UBWC_FF_VOTING_PROP DISPLAY_PROP("disable_ubwc_ff_voting") @@ -96,21 +88,10 @@ #define DISABLE_FBID_CACHE DISPLAY_PROP("disable_fbid_cache") #define DISABLE_HOTPLUG_BWCHECK DISPLAY_PROP("disable_hotplug_bwcheck") #define DISABLE_MASK_LAYER_HINT DISPLAY_PROP("disable_mask_layer_hint") - #define DISABLE_HDR_LUT_GEN DISPLAY_PROP("disable_hdr_lut_gen") -#define ENABLE_DEFAULT_COLOR_MODE DISPLAY_PROP("enable_default_color_mode") #define DISABLE_HDR DISPLAY_PROP("hwc_disable_hdr") -#define DATASPACE_SATURATION_MATRIX_PROP DISPLAY_PROP("dataspace_saturation_matrix") -#define DISABLE_QTI_BSP DISPLAY_PROP("disable_qti_bsp") -#define UPDATE_VSYNC_ON_DOZE DISPLAY_PROP("update_vsync_on_doze") -#define PANEL_MOUNTFLIP DISPLAY_PROP("panel_mountflip") -#define VDS_ALLOW_HWC DISPLAY_PROP("vds_allow_hwc") -#define QDFRAMEWORK_LOGS DISPLAY_PROP("qdframework_logs") - -#define HDR_CONFIG_PROP RO_DISPLAY_PROP("hdr.config") #define QDCM_PCC_TRANS_PROP DISPLAY_PROP("qdcm.pcc_for_trans") #define QDCM_DIAGONAL_MATRIXMODE_PROP DISPLAY_PROP("qdcm.diagonal_matrix_mode") -#define QDCM_DISABLE_TIMEOUT_PROP PERSIST_DISPLAY_PROP("qdcm.disable_timeout") #define QDCM_MODE_COMBINE_PROP DISPLAY_PROP("qdcm.mode_combine") #define PREFER_MULTIRECT_PROP DISPLAY_PROP("prefer_multirect") #define DROP_SKEWED_VSYNC DISPLAY_PROP("drop_skewed_vsync") @@ -121,8 +102,20 @@ #define ENABLE_POSTED_START_DYN_PROP DISPLAY_PROP("enable_posted_start_dyn") // Disable deferring power state request to first draw cycle #define DISABLE_DEFER_POWER_STATE DISPLAY_PROP("disable_defer_power_state") +#define ENABLE_DROP_REFRESH DISPLAY_PROP("enable_drop_refresh") + +// Add all vendor.display properties above + +#define DISABLE_UBWC_PROP GRALLOC_PROP("disable_ubwc") + +// Add all vendor.gralloc.properties above + +#define QDCM_DISABLE_TIMEOUT_PROP PERSIST_DISPLAY_PROP("qdcm.disable_timeout") + +// Add all persist.vendor.display.properties above #define ZERO_SWAP_INTERVAL "vendor.debug.egl.swapinterval" -#define ENABLE_DROP_REFRESH DISPLAY_PROP("enable_drop_refresh") +// Add all other.properties above +// End of property #endif // __DISPLAY_PROPERTIES_H__ diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp index fc2e3dcf03..1965b6801d 100644 --- a/libqdutils/display_config.cpp +++ b/libqdutils/display_config.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013-2014, 2016, 2018, The Linux Foundation. All rights reserved. +* Copyright (c) 2013-2014, 2016, 2018-2019, 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 @@ -46,60 +46,15 @@ namespace qdutils { // do a binder call to HWC to get/set data. int isExternalConnected(void) { - int ret; - status_t err = (status_t) FAILED_TRANSACTION; - sp binder = getBinder(); - Parcel inParcel, outParcel; - if(binder != NULL) { - err = binder->dispatch(IQService::CHECK_EXTERNAL_STATUS, - &inParcel , &outParcel); - } - if(err) { - ALOGE("%s: Failed to get external status err=%d", __FUNCTION__, err); - ret = err; - } else { - ret = outParcel.readInt32(); - } - return ret; + return FAILED_TRANSACTION; } -int getDisplayAttributes(int dpy, DisplayAttributes_t& dpyattr) { - status_t err = (status_t) FAILED_TRANSACTION; - sp binder = getBinder(); - Parcel inParcel, outParcel; - inParcel.writeInt32(dpy); - if(binder != NULL) { - err = binder->dispatch(IQService::GET_DISPLAY_ATTRIBUTES, - &inParcel, &outParcel); - } - if(!err) { - dpyattr.vsync_period = outParcel.readInt32(); - dpyattr.xres = outParcel.readInt32(); - dpyattr.yres = outParcel.readInt32(); - dpyattr.xdpi = outParcel.readFloat(); - dpyattr.ydpi = outParcel.readFloat(); - dpyattr.panel_type = outParcel.readInt32(); - } else { - ALOGE("%s() failed with err %d", __FUNCTION__, err); - } - return err; +int getDisplayAttributes(int /* dpy */, DisplayAttributes_t& /* dpyattr */) { + return FAILED_TRANSACTION; } -int setHSIC(int dpy, const HSICData_t& hsic_data) { - status_t err = (status_t) FAILED_TRANSACTION; - sp binder = getBinder(); - Parcel inParcel, outParcel; - inParcel.writeInt32(dpy); - inParcel.writeInt32(hsic_data.hue); - inParcel.writeFloat(hsic_data.saturation); - inParcel.writeInt32(hsic_data.intensity); - inParcel.writeFloat(hsic_data.contrast); - if(binder != NULL) { - err = binder->dispatch(IQService::SET_HSIC_DATA, &inParcel, &outParcel); - } - if(err) - ALOGE("%s: Failed to get external status err=%d", __FUNCTION__, err); - return err; +int setHSIC(int /* dpy */, const HSICData_t& /* hsic_data */) { + return FAILED_TRANSACTION; } int getDisplayVisibleRegion(int dpy, hwc_rect_t &rect) { @@ -123,25 +78,8 @@ int getDisplayVisibleRegion(int dpy, hwc_rect_t &rect) { return err; } -int setViewFrame(int dpy, int l, int t, int r, int b) { - status_t err = (status_t) FAILED_TRANSACTION; - sp binder = getBinder(); - Parcel inParcel, outParcel; - inParcel.writeInt32(dpy); - inParcel.writeInt32(l); - inParcel.writeInt32(t); - inParcel.writeInt32(r); - inParcel.writeInt32(b); - - if(binder != NULL) { - err = binder->dispatch(IQService::SET_VIEW_FRAME, - &inParcel, &outParcel); - } - if(err) - ALOGE("%s: Failed to set view frame for dpy %d err=%d", - __FUNCTION__, dpy, err); - - return err; +int setViewFrame(int /* dpy */, int /* l */, int /* t */, int /* r */, int /* b */) { + return FAILED_TRANSACTION; } int setSecondaryDisplayStatus(int dpy, uint32_t status) { diff --git a/libqservice/IQService.h b/libqservice/IQService.h index b8fb2e1df5..bf86de2e70 100644 --- a/libqservice/IQService.h +++ b/libqservice/IQService.h @@ -44,24 +44,15 @@ class IQService : public android::IInterface SET_PANEL_BRIGHTNESS = 3, // Provides ability to get the panel brightness CONNECT_HWC_CLIENT = 4, // Connect to qservice SCREEN_REFRESH = 5, // Refresh screen through SF invalidate - EXTERNAL_ORIENTATION = 6,// Set external orientation - BUFFER_MIRRORMODE = 7, // Buffer mirrormode - CHECK_EXTERNAL_STATUS = 8,// Check status of external display - GET_DISPLAY_ATTRIBUTES = 9,// Get display attributes - SET_HSIC_DATA = 10, // Set HSIC on dspp GET_DISPLAY_VISIBLE_REGION = 11,// Get the visibleRegion for dpy SET_SECONDARY_DISPLAY_STATUS = 12,// Sets secondary display status SET_MAX_PIPES_PER_MIXER = 13,// Set max pipes per mixer for MDPComp - SET_VIEW_FRAME = 14, // Set view frame of display DYNAMIC_DEBUG = 15, // Enable more logging on the fly SET_IDLE_TIMEOUT = 16, // Set idle timeout for GPU fallback - TOGGLE_BWC = 17, // Toggle BWC On/Off on targets that support - /* Enable/Disable/Set refresh rate dynamically */ - CONFIGURE_DYN_REFRESH_RATE = 18, + CONFIGURE_DYN_REFRESH_RATE = 18, // Enable/Disable/Set refresh rate dynamically CONTROL_PARTIAL_UPDATE = 19, // Provides ability to enable/disable partial update TOGGLE_SCREEN_UPDATES = 20, // Provides ability to set the panel brightness SET_FRAME_DUMP_CONFIG = 21, // Provides ability to set the frame dump config - DISP_PARAM_TYPE_NOTUSED_5 = 22, // Not used CONNECT_HDMI_CLIENT = 23, // Connect HDMI CEC HAL Client QDCM_SVC_CMDS = 24, // request QDCM services. SET_ACTIVE_CONFIG = 25, //Set a specified display config @@ -74,7 +65,6 @@ class IQService : public android::IInterface GET_BW_TRANSACTION_STATUS = 32, //Client can query BW transaction status. SET_LAYER_MIXER_RESOLUTION = 33, // Enables client to set layer mixer resolution. SET_COLOR_MODE = 34, // Overrides the QDCM mode on the display - GET_HDR_CAPABILITIES = 35, // Get HDR capabilities for legacy HWC interface SET_COLOR_MODE_BY_ID = 36, // Overrides the QDCM mode using the given mode ID GET_COMPOSER_STATUS = 37, // Get composer init status-true if primary display init is done SET_QSYNC_MODE = 38, // Set qsync mode. 0 - (none)disable qsync, 1 - continuous mode. diff --git a/libqservice/QServiceUtils.h b/libqservice/QServiceUtils.h index 61ff037aa7..4cb04cc598 100644 --- a/libqservice/QServiceUtils.h +++ b/libqservice/QServiceUtils.h @@ -70,15 +70,6 @@ inline android::status_t toggleScreenUpdate(uint32_t on) { return sendSingleParam(qService::IQService::TOGGLE_SCREEN_UPDATES, on); } -inline android::status_t setExtOrientation(uint32_t orientation) { - return sendSingleParam(qService::IQService::EXTERNAL_ORIENTATION, - orientation); -} - -inline android::status_t setBufferMirrorMode(uint32_t enable) { - return sendSingleParam(qService::IQService::BUFFER_MIRRORMODE, enable); -} - inline android::status_t setCameraLaunchStatus(uint32_t on) { return sendSingleParam(qService::IQService::SET_CAMERA_STATUS, on); } diff --git a/sdm/include/utils/debug.h b/sdm/include/utils/debug.h index b4334b7c19..cfa9d18461 100644 --- a/sdm/include/utils/debug.h +++ b/sdm/include/utils/debug.h @@ -46,7 +46,6 @@ class Debug { static int GetSimulationFlag(); static bool GetExternalResolution(char *val); static void GetIdleTimeoutMs(uint32_t *active_ms, uint32_t *inactive_ms); - static int GetBootAnimLayerCount(); static bool IsRotatorDownScaleDisabled(); static bool IsDecimationDisabled(); static int GetMaxPipesPerMixer(DisplayType display_type); diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp index f91fd7dbb8..7ac59745c2 100644 --- a/sdm/libs/core/display_base.cpp +++ b/sdm/libs/core/display_base.cpp @@ -164,7 +164,6 @@ DisplayError DisplayBase::Init() { } DisplayBase::SetMaxMixerStages(max_mixer_stages); - 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_base.h b/sdm/libs/core/display_base.h index 92695f1f0d..afe9718c40 100644 --- a/sdm/libs/core/display_base.h +++ b/sdm/libs/core/display_base.h @@ -224,7 +224,6 @@ class DisplayBase : public DisplayInterface { uint32_t req_mixer_width_ = 0; uint32_t req_mixer_height_ = 0; std::string current_color_mode_ = "hal_native"; - int disable_hdr_lut_gen_ = 0; bool hw_recovery_logs_captured_ = false; int disable_hw_recovery_dump_ = 0; HWQosData default_qos_data_; diff --git a/sdm/libs/hwc2/hwc_display_builtin.cpp b/sdm/libs/hwc2/hwc_display_builtin.cpp index cd4dbe9dc7..bb1414ed5c 100644 --- a/sdm/libs/hwc2/hwc_display_builtin.cpp +++ b/sdm/libs/hwc2/hwc_display_builtin.cpp @@ -119,8 +119,6 @@ int HWCDisplayBuiltIn::Init() { } color_mode_ = new HWCColorMode(display_intf_); color_mode_->Init(); - HWCDebugHandler::Get()->GetProperty(ENABLE_DEFAULT_COLOR_MODE, - &default_mode_status_); int drop_refresh = 0; HWCDebugHandler::Get()->GetProperty(ENABLE_DROP_REFRESH, &drop_refresh); diff --git a/sdm/libs/hwc2/hwc_display_builtin.h b/sdm/libs/hwc2/hwc_display_builtin.h index 646c5c1597..71ca32da7b 100644 --- a/sdm/libs/hwc2/hwc_display_builtin.h +++ b/sdm/libs/hwc2/hwc_display_builtin.h @@ -130,7 +130,6 @@ class HWCDisplayBuiltIn : public HWCDisplay { bool dump_output_to_file_ = false; BufferInfo output_buffer_info_ = {}; void *output_buffer_base_ = nullptr; - int default_mode_status_ = 0; bool pending_refresh_ = true; bool enable_drop_refresh_ = false; diff --git a/sdm/libs/hwc2/hwc_session.cpp b/sdm/libs/hwc2/hwc_session.cpp index 9f1158d501..610660748c 100644 --- a/sdm/libs/hwc2/hwc_session.cpp +++ b/sdm/libs/hwc2/hwc_session.cpp @@ -585,30 +585,6 @@ static int32_t GetDataspaceSaturationMatrix(hwc2_device_t *device, 0.0, 0.0, 1.0, 0.0, \ 0.0, 0.0, 0.0, 1.0 }; - // TODO(user): This value should ideally be retrieved from a QDCM configuration file - char value[kPropertyMax] = {}; - if (Debug::Get()->GetProperty(DATASPACE_SATURATION_MATRIX_PROP, value) != kErrorNone) { - DLOGW("Undefined saturation matrix"); - return HWC2_ERROR_BAD_CONFIG; - } - std::string value_string(value); - std::size_t start = 0, end = 0; - int index = 0; - while ((end = value_string.find(",", start)) != std::string::npos) { - saturation_matrix[index] = std::stof(value_string.substr(start, end - start)); - start = end + 1; - index++; - // We expect a 3x3, SF needs 4x4, keep the last row/column identity - if ((index + 1) % 4 == 0) { - index++; - } - } - saturation_matrix[index] = std::stof(value_string.substr(start, end - start)); - if (index < kDataspaceSaturationPropertyElements - 1) { - // The property must have kDataspaceSaturationPropertyElements delimited by commas - DLOGW("Invalid saturation matrix defined"); - return HWC2_ERROR_BAD_CONFIG; - } for (int32_t i = 0; i < kDataspaceSaturationMatrixCount; i += 4) { DLOGD("%f %f %f %f", saturation_matrix[i], saturation_matrix[i + 1], saturation_matrix[i + 2], saturation_matrix[i + 3]); @@ -1372,10 +1348,6 @@ android::status_t HWCSession::notifyCallback(uint32_t command, const android::Pa status = ConfigureRefreshRate(input_parcel); break; - case qService::IQService::SET_VIEW_FRAME: - status = 0; - break; - case qService::IQService::TOGGLE_SCREEN_UPDATES: { if (!input_parcel || !output_parcel) { DLOGE("QService command = %d: input_parcel and output_parcel needed.", command); diff --git a/sdm/libs/utils/debug.cpp b/sdm/libs/utils/debug.cpp index 17e02e8f57..036abe538c 100644 --- a/sdm/libs/utils/debug.cpp +++ b/sdm/libs/utils/debug.cpp @@ -63,13 +63,6 @@ void Debug::GetIdleTimeoutMs(uint32_t *active_ms, uint32_t *inactive_ms) { *inactive_ms = UINT32(inactive_val); } -int Debug::GetBootAnimLayerCount() { - int value = 0; - DebugHandler::Get()->GetProperty(BOOT_ANIMATION_LAYER_COUNT_PROP, &value); - - return value; -} - bool Debug::IsRotatorDownScaleDisabled() { int value = 0; DebugHandler::Get()->GetProperty(DISABLE_ROTATOR_DOWNSCALE_PROP, &value); @@ -140,15 +133,10 @@ bool Debug::IsScalarDisabled() { bool Debug::IsUbwcTiledFrameBuffer() { int ubwc_disabled = 0; - int ubwc_framebuffer = 0; DebugHandler::Get()->GetProperty(DISABLE_UBWC_PROP, &ubwc_disabled); - if (!ubwc_disabled) { - DebugHandler::Get()->GetProperty(ENABLE_FB_UBWC_PROP, &ubwc_framebuffer); - } - - return (ubwc_framebuffer == 1); + return (ubwc_disabled == 0); } bool Debug::IsAVRDisabled() {