summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2021-08-23 10:45:18 -0700
committerLinux Build Service Account <lnxbuild@localhost>2021-08-23 10:45:18 -0700
commit5b8c0838a1301bf35e1b2174d6a20f6bffc7b6e0 (patch)
tree9576c0c1103b5e2c9434a19ec306ee1708594e27
parent2e5ed8af271d71fe7ebb439a347572497bbd3560 (diff)
parent9cc7717c320771b5997d17c04817568a4b100807 (diff)
Merge 9cc7717c320771b5997d17c04817568a4b100807 on remote branch
Change-Id: Ibebe4df1f14cdff589a78dc5c9ce558385fed68c
-rw-r--r--Android.mk1
-rw-r--r--composer/hwc_display.h1
-rw-r--r--composer/hwc_display_builtin.cpp1
-rw-r--r--composer/hwc_display_virtual_gpu.h4
-rw-r--r--composer/hwc_session.cpp60
-rw-r--r--composer/hwc_session.h3
-rw-r--r--config/display-product.mk8
-rw-r--r--gralloc/Android.mk6
-rw-r--r--gralloc/gr_camera_info.cpp5
-rw-r--r--gralloc/gr_utils.cpp21
-rw-r--r--include/display_properties.h1
-rw-r--r--init/Android.mk9
-rw-r--r--init/init.qti.display_boot.rc38
-rw-r--r--init/init.qti.display_boot.sh52
-rw-r--r--libqdutils/display_config.cpp19
-rw-r--r--libqdutils/display_config.h3
-rw-r--r--libqservice/IQService.h1
17 files changed, 219 insertions, 14 deletions
diff --git a/Android.mk b/Android.mk
index c3358036..0a53f2aa 100644
--- a/Android.mk
+++ b/Android.mk
@@ -9,6 +9,7 @@ endif
display-hals += gralloc
display-hals += sde-drm
display-hals += composer
+display-hals += init
ifeq ($(call is-vendor-board-platform,QCOM),true)
include $(call all-named-subdir-makefiles,$(display-hals))
diff --git a/composer/hwc_display.h b/composer/hwc_display.h
index 9f969ecf..c76bcdc0 100644
--- a/composer/hwc_display.h
+++ b/composer/hwc_display.h
@@ -237,6 +237,7 @@ class HWCDisplay : public DisplayEventHandler {
return false;
}
+ virtual void SetCpuPerfHintLargeCompCycle() {};
// Display Configurations
static uint32_t GetThrottlingRefreshRate() { return HWCDisplay::throttling_refresh_rate_; }
static void SetThrottlingRefreshRate(uint32_t newRefreshRate)
diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp
index 2674c64e..486534a7 100644
--- a/composer/hwc_display_builtin.cpp
+++ b/composer/hwc_display_builtin.cpp
@@ -302,7 +302,6 @@ HWC2::Error HWCDisplayBuiltIn::Validate(uint32_t *out_num_types, uint32_t *out_n
}
status = PrepareLayerStack(out_num_types, out_num_requests);
- SetCpuPerfHintLargeCompCycle();
pending_commit_ = true;
return status;
}
diff --git a/composer/hwc_display_virtual_gpu.h b/composer/hwc_display_virtual_gpu.h
index b3ff0b8b..b106e4d5 100644
--- a/composer/hwc_display_virtual_gpu.h
+++ b/composer/hwc_display_virtual_gpu.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, 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
@@ -76,7 +76,7 @@ class HWCDisplayVirtualGPU : public HWCDisplayVirtual,
SyncTask<ColorConvertTaskCode>::TaskContext *task_context);
SyncTask<ColorConvertTaskCode> color_convert_task_;
- GLColorConvert *gl_color_convert_;
+ GLColorConvert *gl_color_convert_ = nullptr;
bool disable_animation_ = false;
bool animation_in_progress_ = false;
diff --git a/composer/hwc_session.cpp b/composer/hwc_session.cpp
index 4b56fa73..51d25f28 100644
--- a/composer/hwc_session.cpp
+++ b/composer/hwc_session.cpp
@@ -1120,8 +1120,14 @@ int32_t HWCSession::SetPowerMode(hwc2_display_t display, int32_t int_mode) {
return HWC2_ERROR_NONE;
}
+ // 1. For power transition cases other than Off->On or On->Off, async power mode
+ // will not be used. Hence, set override_mode to false for them.
+ // 2. When SF requests Doze mode transition on panels where Doze mode is not supported
+ // (like video mode), HWComposer.cpp will override the request to "On". Handle such cases
+ // in main thread path.
if (!((last_power_mode == HWC2::PowerMode::Off && mode == HWC2::PowerMode::On) ||
- (last_power_mode == HWC2::PowerMode::On && mode == HWC2::PowerMode::Off))) {
+ (last_power_mode == HWC2::PowerMode::On && mode == HWC2::PowerMode::Off)) ||
+ (last_power_mode == HWC2::PowerMode::Off && mode == HWC2::PowerMode::On)) {
override_mode = false;
}
@@ -1713,6 +1719,14 @@ android::status_t HWCSession::notifyCallback(uint32_t command, const android::Pa
status = SetStandByMode(input_parcel);
break;
+ case qService::IQService::GET_PANEL_RESOLUTION:
+ if (!input_parcel || !output_parcel) {
+ DLOGE("QService command = %d: input_parcel and output_parcel needed.", command);
+ break;
+ }
+ status = GetPanelResolution(input_parcel, output_parcel);
+ break;
+
default:
DLOGW("QService command = %d is not supported.", command);
break;
@@ -2490,6 +2504,24 @@ void HWCSession::Refresh(hwc2_display_t display) {
callbacks_.Refresh(display);
}
+android::status_t HWCSession::GetPanelResolution(const android::Parcel *input_parcel,
+ android::Parcel *output_parcel) {
+ SCOPE_LOCK(locker_[HWC_DISPLAY_PRIMARY]);
+
+ if (!hwc_display_[HWC_DISPLAY_PRIMARY]) {
+ DLOGI("Primary display is not initialized");
+ return -EINVAL;
+ }
+ auto panel_width = 0u;
+ auto panel_height = 0u;
+
+ hwc_display_[HWC_DISPLAY_PRIMARY]->GetPanelResolution(&panel_width, &panel_height);
+ output_parcel->writeInt32(INT32(panel_width));
+ output_parcel->writeInt32(INT32(panel_height));
+
+ return android::NO_ERROR;
+}
+
android::status_t HWCSession::GetVisibleDisplayRect(const android::Parcel *input_parcel,
android::Parcel *output_parcel) {
int disp_idx = GetDisplayIndex(input_parcel->readInt32());
@@ -3010,7 +3042,10 @@ HWC2::Error HWCSession::ValidateDisplayInternal(hwc2_display_t display, uint32_t
}
}
- return hwc_display->Validate(out_num_types, out_num_requests);
+ auto status = HWC2::Error::None;
+ status = hwc_display->Validate(out_num_types, out_num_requests);
+ SetCpuPerfHintLargeCompCycle();
+ return status;
}
HWC2::Error HWCSession::PresentDisplayInternal(hwc2_display_t display) {
@@ -3624,4 +3659,25 @@ int32_t HWCSession::SetActiveConfigWithConstraints(
vsync_period_change_constraints, out_timeline);
}
+void HWCSession::SetCpuPerfHintLargeCompCycle() {
+ bool found_non_primary_active_display = false;
+
+ // Check any non-primary display is active
+ for (hwc2_display_t display = HWC_DISPLAY_PRIMARY + 1;
+ display < HWCCallbacks::kNumDisplays; display++) {
+ if (hwc_display_[display] == NULL) {
+ continue;
+ }
+ if (hwc_display_[display]->GetCurrentPowerMode() != HWC2::PowerMode::Off) {
+ found_non_primary_active_display = true;
+ break;
+ }
+ }
+
+ // send cpu hint for primary display
+ if (!found_non_primary_active_display) {
+ hwc_display_[HWC_DISPLAY_PRIMARY]->SetCpuPerfHintLargeCompCycle();
+ }
+}
+
} // namespace sdm
diff --git a/composer/hwc_session.h b/composer/hwc_session.h
index acd8844d..4af4bd7f 100644
--- a/composer/hwc_session.h
+++ b/composer/hwc_session.h
@@ -492,6 +492,8 @@ class HWCSession : hwc2_device_t, HWCUEventListener, public qClient::BnQClient,
android::status_t SetColorModeFromClient(const android::Parcel *input_parcel);
android::status_t getComposerStatus();
android::status_t SetStandByMode(const android::Parcel *input_parcel);
+ android::status_t GetPanelResolution(const android::Parcel *input_parcel,
+ android::Parcel *output_parcel);
android::status_t SetQSyncMode(const android::Parcel *input_parcel);
android::status_t SetIdlePC(const android::Parcel *input_parcel);
android::status_t RefreshScreen(const android::Parcel *input_parcel);
@@ -509,6 +511,7 @@ class HWCSession : hwc2_device_t, HWCUEventListener, public qClient::BnQClient,
uint32_t *out_num_requests);
HWC2::Error PresentDisplayInternal(hwc2_display_t display);
void HandleSecureSession();
+ void SetCpuPerfHintLargeCompCycle();
void HandlePendingPowerMode(hwc2_display_t display, const shared_ptr<Fence> &retire_fence);
void HandlePendingHotplug(hwc2_display_t disp_id, const shared_ptr<Fence> &retire_fence);
bool IsPluggableDisplayConnected();
diff --git a/config/display-product.mk b/config/display-product.mk
index 4f32ba1c..4c96a6b6 100644
--- a/config/display-product.mk
+++ b/config/display-product.mk
@@ -17,6 +17,8 @@ PRODUCT_PACKAGES += \
vendor.qti.hardware.display.mapper@2.0.vendor \
vendor.qti.hardware.display.mapper@3.0.vendor \
vendor.qti.hardware.display.mapper@4.0.vendor \
+ init.qti.display_boot.sh \
+ init.qti.display_boot.rc \
modetest
ifneq ($(TARGET_HAS_LOW_RAM),true)
@@ -53,7 +55,7 @@ PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_default.xml:$
#QDCM calibration xml file for nt36525 truly panel
PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_bengal_default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_nt36525_video_mode_dsi_truly_panel.xml
#QDCM calibration xml file for nt36672e LCD video mode single dsi with DSC panel.
-PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_nt36672e_lcd_video_mode_dsi_novatek_fhd_plus_144Hz_with_DSC.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_nt36672e_90Hz_fhd_plus_video_mode_panel_with_DSC.xml
+PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_bengal_default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_nt36672e_90Hz_fhd_plus_video_mode_panel_with_DSC.xml
endif
#QDCM calibration xml file for td4330 panel
PRODUCT_COPY_FILES += hardware/qcom/display/config/qdcm_calib_data_bengal_default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/qdcm_calib_data_td4330_v2_cmd_mode_dsi_truly_panel.xml
@@ -77,7 +79,9 @@ PRODUCT_PROPERTY_OVERRIDES += \
vendor.display.enable_optimize_refresh=1 \
vendor.display.use_smooth_motion=1 \
vendor.display.enable_camera_smooth=1 \
- vendor.display.enable_allow_idle_fallback=1
+ vendor.display.enable_allow_idle_fallback=1 \
+ vendor.display.disable_idle_time_video=1 \
+ vendor.display.disable_idle_time_hdr=1
# Enable offline rotator for Bengal, Monaco, Khaje.
ifneq ($(filter bengal monaco khaje, $(TARGET_BOARD_PLATFORM)),$(TARGET_BOARD_PLATFORM))
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index fd26c185..8b9fb3e9 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -118,7 +118,6 @@ LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes)
LOCAL_HEADER_LIBRARIES := display_headers
LOCAL_SHARED_LIBRARIES := $(common_libs) \
libhidlbase \
- libhidltransport \
libqdMetaData \
libgrallocutils \
libgralloccore \
@@ -131,6 +130,11 @@ LOCAL_SHARED_LIBRARIES := $(common_libs) \
vendor.qti.hardware.display.mapperextensions@1.1 \
android.hardware.graphics.mapper@3.0 \
android.hardware.graphics.mapper@4.0
+
+ifeq ($(shell expr $(PLATFORM_SDK_VERSION) \<= 28), 1)
+LOCAL_SHARED_LIBRARIES += libhidltransport
+endif
+
LOCAL_CFLAGS := $(common_flags) $(qmaa_flags) -DLOG_TAG=\"qdgralloc\" -Wno-sign-conversion \
-D__QTI_DISPLAY_GRALLOC__
LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
diff --git a/gralloc/gr_camera_info.cpp b/gralloc/gr_camera_info.cpp
index 12ec3dbb..a57e05b1 100644
--- a/gralloc/gr_camera_info.cpp
+++ b/gralloc/gr_camera_info.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2021, 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
@@ -103,9 +103,6 @@ CamxPixelFormat CameraInfo::GetCameraPixelFormat(int hal_format) {
case HAL_PIXEL_FORMAT_NV21_ZSL:
format = CAMERA_PIXEL_FORMAT_NV21_ZSL;
break;
- case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
- format = CAMERA_PIXEL_FORMAT_YUV_FLEX;
- break;
case HAL_PIXEL_FORMAT_NV12_UBWC_FLEX:
format = CAMERA_PIXEL_FORMAT_UBWC_FLEX;
break;
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 3a21d7f8..d9559122 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2021, 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
@@ -156,7 +156,6 @@ bool IsCompressedRGBFormat(int format) {
bool IsCameraCustomFormat(int format) {
switch (format) {
case HAL_PIXEL_FORMAT_NV21_ZSL:
- case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
case HAL_PIXEL_FORMAT_NV12_UBWC_FLEX:
case HAL_PIXEL_FORMAT_NV12_UBWC_FLEX_2_BATCH:
case HAL_PIXEL_FORMAT_NV12_UBWC_FLEX_4_BATCH:
@@ -374,6 +373,9 @@ unsigned int GetSize(const BufferInfo &info, unsigned int alignedw, unsigned int
}
size = ALIGN(alignedw * alignedh * 2, SIZE_4K);
break;
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
+ size = VENUS_BUFFER_SIZE(COLOR_FMT_NV12_128, width, height);
+ break;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
size = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height);
@@ -532,6 +534,10 @@ void GetYuvSPPlaneInfo(const BufferInfo &info, int format, uint32_t width, uint3
c_height = height;
break;
#ifndef QMAA
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
+ c_height = VENUS_UV_SCANLINES(COLOR_FMT_NV12_128, height);
+ c_size = c_stride * c_height;
+ break;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
c_height = VENUS_UV_SCANLINES(COLOR_FMT_NV12, height);
@@ -1129,6 +1135,10 @@ void GetAlignedWidthAndHeight(const BufferInfo &info, unsigned int *alignedw,
aligned_w = INT(VENUS_Y_STRIDE(COLOR_FMT_P010, width) / 2);
aligned_h = INT(VENUS_Y_SCANLINES(COLOR_FMT_P010, height));
break;
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
+ aligned_w = INT(VENUS_Y_STRIDE(COLOR_FMT_NV12_128, width));
+ aligned_h = INT(VENUS_Y_SCANLINES(COLOR_FMT_NV12_128, height));
+ break;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
aligned_w = INT(VENUS_Y_STRIDE(COLOR_FMT_NV12, width));
@@ -1184,6 +1194,7 @@ int GetBufferLayout(private_handle_t *hnd, uint32_t stride[4], uint32_t offset[4
switch (hnd->format) {
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC:
@@ -1443,6 +1454,7 @@ int GetYUVPlaneInfo(const BufferInfo &info, int32_t format, int32_t width, int32
// Semiplanar
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE: // Same as YCbCr_420_SP_VENUS
case HAL_PIXEL_FORMAT_NV21_ENCODEABLE:
@@ -1675,6 +1687,7 @@ void GetYuvSubSamplingFactor(int32_t format, int *h_subsampling, int *v_subsampl
case HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC:
case HAL_PIXEL_FORMAT_YCbCr_420_P010_UBWC:
case HAL_PIXEL_FORMAT_YCbCr_420_P010_VENUS:
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC:
case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO:
@@ -1844,6 +1857,7 @@ void GetDRMFormat(uint32_t format, uint32_t flags, uint32_t *drm_format,
case HAL_PIXEL_FORMAT_XBGR_2101010:
*drm_format = DRM_FORMAT_RGBX1010102;
break;
+ case HAL_PIXEL_FORMAT_NV12_LINEAR_FLEX:
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
*drm_format = DRM_FORMAT_NV12;
break;
@@ -1895,6 +1909,9 @@ void GetDRMFormat(uint32_t format, uint32_t flags, uint32_t *drm_format,
case HAL_PIXEL_FORMAT_YV12:
*drm_format = DRM_FORMAT_YVU420;
break;
+ case HAL_PIXEL_FORMAT_RGBA_FP16:
+ ALOGW("HAL_PIXEL_FORMAT_RGBA_FP16 currently not supported");
+ break;
default:
ALOGE("Unsupported format %d", format);
}
diff --git a/include/display_properties.h b/include/display_properties.h
index 1adba755..874521fe 100644
--- a/include/display_properties.h
+++ b/include/display_properties.h
@@ -97,6 +97,7 @@
#define DROP_SKEWED_VSYNC DISPLAY_PROP("drop_skewed_vsync")
#define DISABLE_FAST_PATH DISPLAY_PROP("disable_fast_path")
#define DISABLE_SYSTEM_LOAD_CHECK DISPLAY_PROP("disable_system_load_check")
+#define DISABLE_IDLE_SCALING_LAYERS DISPLAY_PROP("disable_idle_scaling_layers")
// Disable microidle condition
#define DISABLE_SINGLE_LM_SPLIT_PROP DISPLAY_PROP("disable_single_lm_split")
// Enable posted start dynamic
diff --git a/init/Android.mk b/init/Android.mk
new file mode 100644
index 00000000..ccca9ff7
--- /dev/null
+++ b/init/Android.mk
@@ -0,0 +1,9 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qti.display_boot.sh
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := init.qti.display_boot.sh
+LOCAL_INIT_RC := init.qti.display_boot.rc
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
diff --git a/init/init.qti.display_boot.rc b/init/init.qti.display_boot.rc
new file mode 100644
index 00000000..0b4fd6d7
--- /dev/null
+++ b/init/init.qti.display_boot.rc
@@ -0,0 +1,38 @@
+# Copyright (c) 2021, 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
+# met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of The Linux Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+service qti_display_boot /vendor/bin/init.qti.display_boot.sh
+ class main
+ user system
+ group system
+ disabled
+ oneshot
+
+on post-fs-data
+ start qti_display_boot
+
diff --git a/init/init.qti.display_boot.sh b/init/init.qti.display_boot.sh
new file mode 100644
index 00000000..8e57c068
--- /dev/null
+++ b/init/init.qti.display_boot.sh
@@ -0,0 +1,52 @@
+#!/vendor/bin/sh
+# Copyright (c) 2021, 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
+# met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+# * Neither the name of The Linux Foundation nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+
+target=`getprop ro.board.platform`
+if [ -f /sys/devices/soc0/soc_id ]; then
+ soc_hwid=`cat /sys/devices/soc0/soc_id`
+else
+ soc_hwid=`cat /sys/devices/system/soc/soc0/id`
+fi
+
+case "$target" in
+ "bengal")
+ # Set property to differentiate bengal and khaje
+ # Soc Id for khaje is 518
+ case "$soc_hwid" in
+ 518)
+ # Set property for khaje
+ setprop vendor.display.disable_layer_stitch 1
+ setprop vendor.display.enable_rounded_corner 1
+ setprop vendor.display.disable_rounded_corner_thread 0
+ setprop vendor.display.enable_rc_support 1
+ setprop vendor.display.enable_perf_hint_large_comp_cycle 1
+ ;;
+ esac
+esac
diff --git a/libqdutils/display_config.cpp b/libqdutils/display_config.cpp
index 0157a536..dc590e95 100644
--- a/libqdutils/display_config.cpp
+++ b/libqdutils/display_config.cpp
@@ -409,3 +409,22 @@ extern "C" int setStandByMode(int mode) {
}
return err;
}
+
+extern "C" int getPanelResolution(int *width, int *height) {
+ status_t err = (status_t) FAILED_TRANSACTION;
+ sp<IQService> binder = getBinder();
+ Parcel inParcel, outParcel;
+
+ if(binder != NULL) {
+ err = binder->dispatch(IQService::GET_PANEL_RESOLUTION,
+ &inParcel, &outParcel);
+ if(err != 0) {
+ ALOGE_IF(getBinder(), "%s() failed with err %d", __FUNCTION__, err);
+ } else {
+ *width = outParcel.readInt32();
+ *height = outParcel.readInt32();
+ }
+ }
+
+ return err;
+}
diff --git a/libqdutils/display_config.h b/libqdutils/display_config.h
index 81f22d75..d3f75d56 100644
--- a/libqdutils/display_config.h
+++ b/libqdutils/display_config.h
@@ -173,6 +173,9 @@ int setPanelLuminanceAttributes(int dpy, float min_lum, float max_lum);
// Sets display standy mode
extern "C" int setStandByMode(int mode);
+// Get Panel Resolution
+extern "C" int getPanelResolution(int *width, int *height);
+
}; //namespace
diff --git a/libqservice/IQService.h b/libqservice/IQService.h
index 473de12b..c7283ac3 100644
--- a/libqservice/IQService.h
+++ b/libqservice/IQService.h
@@ -80,6 +80,7 @@ public:
SET_BRIGHTNESS_SCALE = 48, // Set brightness scale ratio
SET_COLOR_SAMPLING_ENABLED = 49, // Toggle the collection of display color stats
SET_STAND_BY_MODE = 50, // Set stand by mode for MDP hardware
+ GET_PANEL_RESOLUTION = 51, // Get Panel Resolution
COMMAND_LIST_END = 400,
};