Skip to content

Commit

Permalink
Merge "hwc2: Add support for IDisplayConfig version 1.9" into display…
Browse files Browse the repository at this point in the history
….lnx.3.3
  • Loading branch information
Linux Build Service Account authored and Gerrit - the friendly Code Review server committed Nov 28, 2019
2 parents dfe9b46 + f0aa5b5 commit 50f4514
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
16 changes: 16 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ display_config_version := $(shell \
display_config_version := $(shell \
if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.7" ];\
then echo DISPLAY_CONFIG_1_7; fi)
display_config_version := $(shell \
if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.8" ];\
then echo DISPLAY_CONFIG_1_8; fi)
display_config_version := $(shell \
if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.9" ];\
then echo DISPLAY_CONFIG_1_9; fi)

#Common C flags
common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers
Expand All @@ -25,6 +31,16 @@ ifeq ($(display_config_version), DISPLAY_CONFIG_1_7)
-DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4 \
-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 ($(TARGET_USES_COLOR_METADATA), true)
common_flags += -DUSE_COLOR_METADATA
Expand Down
13 changes: 13 additions & 0 deletions sdm/libs/hwc2/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ LOCAL_SHARED_LIBRARIES += [email protected] \
[email protected] [email protected] \
[email protected] [email protected]
endif
ifeq ($(display_config_version), DISPLAY_CONFIG_1_8)
LOCAL_SHARED_LIBRARIES += [email protected] [email protected] \
[email protected] [email protected] \
[email protected] [email protected] \
[email protected] [email protected]
endif
ifeq ($(display_config_version), DISPLAY_CONFIG_1_9)
LOCAL_SHARED_LIBRARIES += [email protected] [email protected] \
[email protected] [email protected] \
[email protected] [email protected] \
[email protected] [email protected] \
[email protected]
endif

LOCAL_SRC_FILES := hwc_session.cpp \
hwc_session_services.cpp \
Expand Down
21 changes: 19 additions & 2 deletions sdm/libs/hwc2/hwc_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
#ifndef __HWC_SESSION_H__
#define __HWC_SESSION_H__

#ifdef DISPLAY_CONFIG_1_7
#ifdef 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_1
#include <vendor/display/config/1.1/IDisplayConfig.h>
Expand All @@ -43,7 +47,11 @@

namespace sdm {

#ifdef DISPLAY_CONFIG_1_7
#ifdef 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_1
using vendor::display::config::V1_1::IDisplayConfig;
Expand Down Expand Up @@ -253,6 +261,15 @@ class HWCSession : hwc2_device_t, HWCUEventListener, IDisplayConfig, public qCli
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

// QClient methods
virtual android::status_t notifyCallback(uint32_t command, const android::Parcel *input_parcel,
Expand Down
27 changes: 27 additions & 0 deletions sdm/libs/hwc2/hwc_session_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,4 +606,31 @@ Return<void> HWCSession::getDebugProperty(const hidl_string &prop_name,
}
#endif


#ifdef DISPLAY_CONFIG_1_8
Return<void> HWCSession::getActiveBuiltinDisplayAttributes(
getDisplayAttributes_cb _hidl_cb) {
DLOGE("Not supported at present");
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) {
DLOGE("Not supported at present");
return -1;
}

Return<bool> HWCSession::isBuiltInDisplay(uint32_t disp_id) {
if ((HWC_DISPLAY_PRIMARY == disp_id) || (HWC_DISPLAY_BUILTIN_2 == disp_id) ||
(HWC_DISPLAY_BUILTIN_3 == disp_id) || (HWC_DISPLAY_BUILTIN_4 == disp_id)) {
return true;
}
else {
return false;
}
}
#endif // DISPLAY_CONFIG_1_9

} // namespace sdm

0 comments on commit 50f4514

Please sign in to comment.