commonsys-intf: display: Add support to query display wb capabilities

Change-Id: I2370df1cf4db99f353e047d2db50a5d416d7650b
This commit is contained in:
Ramakant Singh
2018-08-31 17:38:43 +05:30
parent 5d8144382d
commit d58ec8fb63
3 changed files with 47 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
LOCAL_PATH := $(call my-dir)
display_config_version := $(shell \
if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\
then echo DISPLAY_CONFIG_1_4; fi)
include $(CLEAR_VARS)
LOCAL_MODULE := libdisplayconfig
LOCAL_MODULE_TAGS := optional
@@ -7,6 +11,12 @@ LOCAL_HEADER_LIBRARIES := display_headers
LOCAL_SRC_FILES := DisplayConfig.cpp
LOCAL_SHARED_LIBRARIES := libhidlbase libhidltransport libutils \
vendor.display.config@1.0
ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
LOCAL_SHARED_LIBRARIES += vendor.display.config@1.4
LOCAL_CFLAGS += -DDISPLAY_CONFIG_1_4
endif
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
ifeq ($(LLVM_SA), true)

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@@ -27,13 +27,21 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef DISPLAY_CONFIG_1_4
#include <vendor/display/config/1.4/IDisplayConfig.h>
#else
#include <vendor/display/config/1.0/IDisplayConfig.h>
#endif
#include "DisplayConfig.h"
namespace display {
#ifdef DISPLAY_CONFIG_1_4
using vendor::display::config::V1_4::IDisplayConfig;
#else
using vendor::display::config::V1_0::IDisplayConfig;
#endif
//=============================================================================
// The functions below run in the client process and wherever necessary
@@ -332,6 +340,27 @@ int getHDRCapabilities(int dpy, DisplayHDRCapabilities *caps) {
return error;
}
#ifdef DISPLAY_CONFIG_1_4
int32_t getWriteBackCapabilities( WriteBackCapabilities *caps) {
android::sp<IDisplayConfig> intf = IDisplayConfig::getService();
if (intf == NULL || caps == NULL) {
return -1;
}
int error = -1;
intf->getWriteBackCapabilities(
[&](const auto &tmpError, const auto &tmpCaps) {
error = tmpError;
if (error) {
return;
}
caps->isWbUbwcSupported = tmpCaps.isWbUbwcSupported;
});
return error;
}
#endif
int setCameraLaunchStatus(uint32_t on) {
android::sp<IDisplayConfig> intf = IDisplayConfig::getService();
if (intf == NULL) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-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
@@ -83,6 +83,10 @@ struct DisplayHDRCapabilities {
float min_luminance = 0.0f;
};
struct WriteBackCapabilities {
bool isWbUbwcSupported;
};
//=============================================================================
// The functions below run in the client pocess and wherever necessary
// do a binder call to HWC to get/set data.
@@ -104,6 +108,7 @@ int setIdleTimeout(uint32_t value);
int getHDRCapabilities(int dpy, DisplayHDRCapabilities *caps);
int setCameraLaunchStatus(uint32_t on);
bool displayBWTransactionPending();
int32_t getWriteBackCapabilities(WriteBackCapabilities *caps);
} // namespace display