hwc2: Implement display config 1.6 and 1.7 interfaces.
Change-Id: I5d68407ed388e62d7900944c90d407549535c0da
CRs-Fixed: 2362214
diff --git a/common.mk b/common.mk
index bb6494a..0d81828 100644
--- a/common.mk
+++ b/common.mk
@@ -3,8 +3,18 @@
#Get the highest display config version available
display_config_version := $(shell \
+ if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.7" ];\
+ then echo DISPLAY_CONFIG_1_7; fi)
+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" ];\
@@ -52,6 +62,15 @@
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 ($(TARGET_USES_COLOR_METADATA), true)
common_flags += -DUSE_COLOR_METADATA
diff --git a/include/display_properties.h b/include/display_properties.h
index ceb7456..3fd4599 100644
--- a/include/display_properties.h
+++ b/include/display_properties.h
@@ -100,6 +100,11 @@
#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")
diff --git a/sdm/libs/hwc2/Android.mk b/sdm/libs/hwc2/Android.mk
index 314504c..411d2f0 100644
--- a/sdm/libs/hwc2/Android.mk
+++ b/sdm/libs/hwc2/Android.mk
@@ -52,6 +52,24 @@
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
+
LOCAL_SRC_FILES := hwc_session.cpp \
hwc_session_services.cpp \
diff --git a/sdm/libs/hwc2/hwc_session.h b/sdm/libs/hwc2/hwc_session.h
index ffec649..2c71515 100644
--- a/sdm/libs/hwc2/hwc_session.h
+++ b/sdm/libs/hwc2/hwc_session.h
@@ -20,7 +20,11 @@
#ifndef __HWC_SESSION_H__
#define __HWC_SESSION_H__
-#ifdef DISPLAY_CONFIG_1_5
+#ifdef 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>
@@ -53,20 +57,25 @@
namespace sdm {
-#ifdef DISPLAY_CONFIG_1_5
+#ifdef 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
+#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;
+using vendor::display::config::V1_0::IDisplayConfig;
#endif
using ::android::hardware::Return;
+using ::android::hardware::hidl_string;
// Create a singleton uevent listener thread valid for life of hardware composer process.
// This thread blocks on uevents poll inside uevent library implementation. This poll exits
@@ -311,6 +320,19 @@
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;
+ Return<bool> isWCGSupported(uint32_t disp_id) override;
+ 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
// 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 6fb1ec2..0469e62 100644
--- a/sdm/libs/hwc2/hwc_session_services.cpp
+++ b/sdm/libs/hwc2/hwc_session_services.cpp
@@ -31,9 +31,11 @@
#include <utils/debug.h>
#include <sync/sync.h>
#include <vector>
+#include <string>
#include "hwc_buffer_sync_handler.h"
#include "hwc_session.h"
+#include "hwc_debugger.h"
#define __CLASS__ "HWCSession"
@@ -671,4 +673,69 @@
}
#endif // DISPLAY_CONFIG_1_5
+#ifdef DISPLAY_CONFIG_1_6
+Return<int32_t> HWCSession::updateVSyncSourceOnPowerModeOff() {
+ return 0;
+}
+
+Return<int32_t> HWCSession::updateVSyncSourceOnPowerModeDoze() {
+ return 0;
+}
+#endif
+
+#ifdef DISPLAY_CONFIG_1_7
+Return<int32_t> HWCSession::setPowerMode(uint32_t disp_id, PowerMode power_mode) {
+ return 0;
+}
+
+Return<bool> HWCSession::isPowerModeOverrideSupported(uint32_t disp_id) {
+ return false;
+}
+
+Return<bool> HWCSession::isHDRSupported(uint32_t disp_id) {
+ SEQUENCE_WAIT_SCOPE_LOCK(locker_[disp_id]);
+ HWCDisplay *hwc_display = hwc_display_[disp_id];
+ if (!hwc_display) {
+ DLOGW("Display = %d is not connected.", disp_id);
+ return false;
+ }
+
+ // query number of hdr types
+ uint32_t out_num_types = 0;
+ if (hwc_display->GetHdrCapabilities(&out_num_types, nullptr, nullptr, nullptr, nullptr)
+ != HWC2::Error::None) {
+ return false;
+ }
+
+ return (out_num_types > 0);
+}
+
+Return<bool> HWCSession::isWCGSupported(uint32_t disp_id) {
+ // todo(user): Query wcg from sdm. For now assume them same.
+ return isHDRSupported(disp_id);
+}
+
+Return<int32_t> HWCSession::setLayerAsMask(uint32_t disp_id, uint64_t layer_id) {
+ return 0;
+}
+
+Return<void> HWCSession::getDebugProperty(const hidl_string &prop_name,
+ getDebugProperty_cb _hidl_cb) {
+ std::string vendor_prop_name = DISP_PROP_PREFIX;
+ char value[64] = {};
+ hidl_string result = "";
+ int32_t error = -EINVAL;
+
+ vendor_prop_name += prop_name.c_str();
+ if (HWCDebugHandler::Get()->GetProperty(vendor_prop_name.c_str(), value) != kErrorNone) {
+ result = value;
+ error = 0;
+ }
+
+ _hidl_cb(result, error);
+
+ return Void();
+}
+#endif
+
} // namespace sdm