Merge "dal: reduce severity of logs"
diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp
index 6224edf..5a83591 100755
--- a/composer/hwc_display.cpp
+++ b/composer/hwc_display.cpp
@@ -55,6 +55,12 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/* Changes from Qualcomm Innovation Center are provided under the following license:
+ *
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ */
+
#include <cutils/properties.h>
#include <errno.h>
#include <math.h>
@@ -1434,7 +1440,7 @@
const native_handle_t *handle = static_cast<native_handle_t *>(output_buffer_info_.private_data);
HWC2::Error err = SetReadbackBuffer(handle, nullptr, cwb_config, kCWBClientFrameDump);
if (err != HWC2::Error::None) {
- munmap(output_buffer_base_, output_buffer_info_.alloc_buffer_info.size);
+ munmap(buffer, output_buffer_info_.alloc_buffer_info.size);
buffer_allocator_->FreeBuffer(&output_buffer_info_);
output_buffer_info_ = {};
dump_frame_count_ = 0;
diff --git a/composer/hwc_session.cpp b/composer/hwc_session.cpp
index 0edb1d6..a12e47e 100644
--- a/composer/hwc_session.cpp
+++ b/composer/hwc_session.cpp
@@ -4254,19 +4254,20 @@
int HWCSession::WaitForCommitDoneAsync(hwc2_display_t display, int client_id) {
std::chrono::milliseconds span(2000);
- if (commit_done_future_.valid()) {
- std::future_status status = commit_done_future_.wait_for(std::chrono::milliseconds(0));
+ if (commit_done_future_[display].valid()) {
+ std::future_status status = commit_done_future_[display].wait_for(std::chrono::milliseconds(0));
if (status != std::future_status::ready) {
// Previous task is stuck. Bail out early.
return -ETIMEDOUT;
}
}
- commit_done_future_ = std::async([](HWCSession* session, hwc2_display_t display, int client_id) {
+ commit_done_future_[display] = std::async([](HWCSession* session, hwc2_display_t display,
+ int client_id) {
return session->WaitForCommitDone(display, client_id);
}, this, display, client_id);
- auto ret = (commit_done_future_.wait_for(span) == std::future_status::timeout) ?
- -EINVAL : commit_done_future_.get();
+ auto ret = (commit_done_future_[display].wait_for(span) == std::future_status::timeout) ?
+ -EINVAL : commit_done_future_[display].get();
return ret;
}
@@ -4493,7 +4494,10 @@
DLOGI("Waiting for device unassign");
int ret = WaitForCommitDoneAsync(target_display, kClientTrustedUI);
if (ret != 0) {
- DLOGE("Device unassign failed with error %d", ret);
+ if (ret != -ETIMEDOUT) {
+ DLOGE("Device unassign failed with error %d", ret);
+ }
+ TUITransitionUnPrepare(disp_id);
return -EINVAL;
}
}
diff --git a/composer/hwc_session.h b/composer/hwc_session.h
index 658ef21..bf38734 100644
--- a/composer/hwc_session.h
+++ b/composer/hwc_session.h
@@ -728,7 +728,7 @@
Locker primary_display_lock_;
std::map <hwc2_display_t, sdm::DisplayType> map_active_displays_;
vector<HWDisplayInfo> virtual_display_list_ = {};
- std::future<int> commit_done_future_;
+ std::map <hwc2_display_t, std::future<int>> commit_done_future_;
};
} // namespace sdm
diff --git a/composer/hwc_session_services.cpp b/composer/hwc_session_services.cpp
index 9ce8cd9..5bb804c 100644
--- a/composer/hwc_session_services.cpp
+++ b/composer/hwc_session_services.cpp
@@ -63,6 +63,12 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/* Changes from Qualcomm Innovation Center are provided under the following license:
+ *
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ */
+
#include <core/buffer_allocator.h>
#include <utils/debug.h>
#include <utils/constants.h>
@@ -1123,7 +1129,7 @@
{
SCOPE_LOCK(hwc_session_->locker_[disp_type]);
if (!hwc_session_->hwc_display_[dpy_index]) {
- DLOGE("Display is not created yet with display index = %d and display id = %d!",
+ DLOGW("Display is not created yet with display index = %d and display id = %d!",
dpy_index, disp_id);
return -1;
}
diff --git a/sdm/include/private/feature_license_intf.h b/sdm/include/private/feature_license_intf.h
new file mode 100644
index 0000000..ce93ace
--- /dev/null
+++ b/sdm/include/private/feature_license_intf.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
+ */
+
+#ifndef __FEATURE_LICENSE_INTF_H__
+#define __FEATURE_LICENSE_INTF_H__
+
+#include <private/generic_intf.h>
+#include <private/generic_payload.h>
+
+namespace sdm {
+
+enum FeatureLicenseId {
+ kDemura,
+ kAntiAging,
+ kFeatureLicenseIdMax = 255,
+};
+
+// Feature license intf params as enum
+enum FeatureLicenseParams {
+ kFeatureLicenseParamMax = 255,
+};
+
+// Feature license intf ops as enum
+enum FeatureLicenseOps {
+ kValidatePermission,
+ kFeatureLicenseOpsMax = 255,
+};
+
+struct FeatureValidatePermissionInput {
+ FeatureLicenseId id;
+};
+
+struct DemuraValidatePermissionInput : public FeatureValidatePermissionInput {
+ uint64_t panel_id;
+};
+
+struct AntiAgingValidatePermissionInput : public FeatureValidatePermissionInput {
+};
+
+using FeatureLicenseIntf = GenericIntf<FeatureLicenseParams, FeatureLicenseOps, GenericPayload>;
+
+class FeatureLicenseFactoryIntf {
+ public:
+ virtual ~FeatureLicenseFactoryIntf() {}
+ virtual std::shared_ptr<FeatureLicenseIntf> CreateFeatureLicenseIntf() = 0;
+};
+
+extern "C" FeatureLicenseFactoryIntf *GetFeatureLicenseFactoryIntf();
+
+} // namespace sdm
+
+#endif // __FEATURE_LICENSE_INTF_H__
diff --git a/sdm/include/private/resource_interface.h b/sdm/include/private/resource_interface.h
index 630b140..043f811 100644
--- a/sdm/include/private/resource_interface.h
+++ b/sdm/include/private/resource_interface.h
@@ -25,7 +25,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
@@ -142,6 +142,7 @@
virtual std::string Dump() = 0;
virtual uint32_t GetMixerCount() = 0;
virtual void HandleTUITransition(Handle display_ctx, bool tui_active) = 0;
+ virtual DisplayError SetBlendSpace(Handle display_ctx, const PrimariesTransfer &blend_space) = 0;
};
} // namespace sdm
diff --git a/sdm/libs/core/comp_manager.cpp b/sdm/libs/core/comp_manager.cpp
index be7639c..77ca913 100755
--- a/sdm/libs/core/comp_manager.cpp
+++ b/sdm/libs/core/comp_manager.cpp
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
@@ -761,6 +761,8 @@
display_comp_ctx->strategy->SetBlendSpace(blend_space);
+ resource_intf_->SetBlendSpace(display_comp_ctx->display_resource_ctx, blend_space);
+
return kErrorNone;
}
diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp
index edcc64a..fcacad6 100644
--- a/sdm/libs/core/display_base.cpp
+++ b/sdm/libs/core/display_base.cpp
@@ -25,7 +25,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
@@ -418,6 +418,19 @@
}
}
+ GetFeatureLicenseFactory get_feature_license_factory_ptr = nullptr;
+ if (!feature_impl_lib.Sym(GET_FEATURE_LICENSE_FACTORY,
+ reinterpret_cast<void **>(&get_feature_license_factory_ptr))) {
+ DLOGW("Unable to load symbols, error = %s", feature_impl_lib.Error());
+ return kErrorUndefined;
+ }
+
+ feature_license_factory_ = get_feature_license_factory_ptr();
+ if (!feature_license_factory_) {
+ DLOGE("Failed to create FeatureLicenseFactory");
+ return kErrorResources;
+ }
+
DLOGI("Setup pf factory and prop intf for Panel Features");
return kErrorNone;
}
diff --git a/sdm/libs/core/display_base.h b/sdm/libs/core/display_base.h
index 85acf94..2ba9c94 100644
--- a/sdm/libs/core/display_base.h
+++ b/sdm/libs/core/display_base.h
@@ -27,7 +27,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
@@ -41,6 +41,7 @@
#include <private/panel_feature_property_intf.h>
#include <private/panel_feature_factory_intf.h>
#include <private/demuratn_core_uvm_fact_intf.h>
+#include <private/feature_license_intf.h>
#include <private/noise_plugin_intf.h>
#include <private/noise_plugin_dbg.h>
#include <private/hw_interface.h>
@@ -59,6 +60,7 @@
#define GET_PANEL_FEATURE_FACTORY "GetPanelFeatureFactoryIntf"
#define GET_DEMURATN_FACTORY "GetDemuraTnCoreUvmFactoryIntf"
+#define GET_FEATURE_LICENSE_FACTORY "GetFeatureLicenseFactoryIntf"
namespace sdm {
@@ -70,6 +72,7 @@
typedef PanelFeatureFactoryIntf* (*GetPanelFeatureFactory)();
typedef DemuraTnCoreUvmFactoryIntf* (*GetDemuraTnFactory)();
+typedef FeatureLicenseFactoryIntf* (*GetFeatureLicenseFactory)();
class DisplayBase : public DisplayInterface, public CompManagerEventHandler {
public:
@@ -415,6 +418,7 @@
PanelFeatureFactoryIntf *pf_factory_ = nullptr;
PanelFeaturePropertyIntf *prop_intf_ = nullptr;
DemuraTnCoreUvmFactoryIntf *demuratn_factory_ = nullptr;
+ FeatureLicenseFactoryIntf *feature_license_factory_ = nullptr;
bool first_cycle_ = true;
bool registered_hw_events_ = false;
bool unified_draw_supported_ = true; // By default supported, unless disabled by property.
diff --git a/sdm/libs/core/display_builtin.cpp b/sdm/libs/core/display_builtin.cpp
index da704f5..5f5cf38 100644
--- a/sdm/libs/core/display_builtin.cpp
+++ b/sdm/libs/core/display_builtin.cpp
@@ -25,7 +25,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
@@ -169,21 +169,7 @@
return error;
}
- DisplayError tmp = kErrorNone;
- if ((tmp = SetupDemura()) != kErrorNone) {
- // Non-fatal but not expected, log error
- DLOGE("Demura failed to initialize on display %d-%d, Error = %d", display_id_,
- display_type_, tmp);
- comp_manager_->FreeDemuraFetchResources(display_id_);
- comp_manager_->SetDemuraStatusForDisplay(display_id_, false);
- if (demura_) {
- SetDemuraIntfStatus(false);
- }
- } else if (demuratn_factory_) {
- if ((tmp = SetupDemuraTn()) != kErrorNone) {
- DLOGW("Failed to setup DemuraTn, Error = %d", tmp);
- }
- }
+ SetupDemuraT0AndTn();
} else {
DLOGW("Skipping Panel Feature Setups!");
}
@@ -509,128 +495,96 @@
}
DisplayError DisplayBuiltIn::SetupDemura() {
- if (!comp_manager_->GetDemuraStatus()) {
- comp_manager_->FreeDemuraFetchResources(display_id_);
- comp_manager_->SetDemuraStatusForDisplay(display_id_, false);
- return kErrorNone;
+ DemuraInputConfig input_cfg;
+ input_cfg.secure_session = false; // TODO(user): Integrate with secure solution
+ std::string brightness_base;
+ hw_intf_->GetPanelBrightnessBasePath(&brightness_base);
+ input_cfg.brightness_path = brightness_base+"brightness";
+
+ FetchResourceList frl;
+ comp_manager_->GetDemuraFetchResources(display_comp_ctx_, &frl);
+ for (auto &fr : frl) {
+ int i = std::get<1>(fr); // fetch resource index
+ input_cfg.resources.set(i);
}
- int value = 0;
- uint64_t panel_id = 0;
- int panel_id_w = 0;
- if (IsPrimaryDisplay()) {
- Debug::Get()->GetProperty(DEMURA_PRIMARY_PANEL_OVERRIDE_LOW, &panel_id_w);
- panel_id = static_cast<uint32_t>(panel_id_w);
- Debug::Get()->GetProperty(DEMURA_PRIMARY_PANEL_OVERRIDE_HIGH, &panel_id_w);
- panel_id |= ((static_cast<uint64_t>(panel_id_w)) << 32);
- DLOGI("panel overide total value %lx\n", panel_id);
- Debug::Get()->GetProperty(DISABLE_DEMURA_PRIMARY, &value);
- } else {
- Debug::Get()->GetProperty(DEMURA_SECONDARY_PANEL_OVERRIDE_LOW, &panel_id_w);
- panel_id = static_cast<uint32_t>(panel_id_w);
- Debug::Get()->GetProperty(DEMURA_SECONDARY_PANEL_OVERRIDE_HIGH, &panel_id_w);
- panel_id |= ((static_cast<uint64_t>(panel_id_w)) << 32);
- DLOGI("panel overide total value %lx\n", panel_id);
- Debug::Get()->GetProperty(DISABLE_DEMURA_SECONDARY, &value);
- }
-
- if (value > 0) {
- comp_manager_->FreeDemuraFetchResources(display_id_);
- comp_manager_->SetDemuraStatusForDisplay(display_id_, false);
- return kErrorNone;
- } else if (value == 0) {
- DemuraInputConfig input_cfg;
- input_cfg.secure_session = false; // TODO(user): Integrate with secure solution
- std::string brightness_base;
- hw_intf_->GetPanelBrightnessBasePath(&brightness_base);
- input_cfg.brightness_path = brightness_base+"brightness";
-
- FetchResourceList frl;
- comp_manager_->GetDemuraFetchResources(display_comp_ctx_, &frl);
- for (auto &fr : frl) {
- int i = std::get<1>(fr); // fetch resource index
- input_cfg.resources.set(i);
- }
-
#ifdef TRUSTED_VM
- int ret = 0;
- GenericPayload out;
- IPCImportBufOutParams *buf_out_params = nullptr;
- if ((ret = out.CreatePayload<IPCImportBufOutParams>(buf_out_params))) {
- DLOGE("Failed to create output payload error = %d", ret);
- return kErrorUndefined;
- }
+ int ret = 0;
+ GenericPayload out;
+ IPCImportBufOutParams *buf_out_params = nullptr;
+ if ((ret = out.CreatePayload<IPCImportBufOutParams>(buf_out_params))) {
+ DLOGE("Failed to create output payload error = %d", ret);
+ return kErrorUndefined;
+ }
- GenericPayload in;
- IPCImportBufInParams *buf_in_params = nullptr;
- if ((ret = in.CreatePayload<IPCImportBufInParams>(buf_in_params))) {
- DLOGE("Failed to create input payload error = %d", ret);
- return kErrorUndefined;
- }
- buf_in_params->req_buf_type = kIpcBufferTypeDemuraHFC;
+ GenericPayload in;
+ IPCImportBufInParams *buf_in_params = nullptr;
+ if ((ret = in.CreatePayload<IPCImportBufInParams>(buf_in_params))) {
+ DLOGE("Failed to create input payload error = %d", ret);
+ return kErrorUndefined;
+ }
+ buf_in_params->req_buf_type = kIpcBufferTypeDemuraHFC;
- if ((ret = ipc_intf_->ProcessOps(kIpcOpsImportBuffers, in, &out))) {
- DLOGE("Failed to kIpcOpsImportBuffers payload error = %d", ret);
- return kErrorUndefined;
- }
- DLOGI("DemuraHFC buffer fd %d size %d", buf_out_params->buffers[0].fd,
- buf_out_params->buffers[0].size);
+ if ((ret = ipc_intf_->ProcessOps(kIpcOpsImportBuffers, in, &out))) {
+ DLOGE("Failed to kIpcOpsImportBuffers payload error = %d", ret);
+ return kErrorUndefined;
+ }
+ DLOGI("DemuraHFC buffer fd %d size %d", buf_out_params->buffers[0].fd,
+ buf_out_params->buffers[0].size);
- if (buf_out_params->buffers[0].fd < 0) {
- DLOGE("HFC buffer import error fd :%d ", buf_out_params->buffers[0].fd);
- return kErrorUndefined;
- }
+ if (buf_out_params->buffers[0].fd < 0) {
+ DLOGE("HFC buffer import error fd :%d ", buf_out_params->buffers[0].fd);
+ return kErrorUndefined;
+ }
- input_cfg.secure_hfc_fd = buf_out_params->buffers[0].fd;
- input_cfg.secure_hfc_size = buf_out_params->buffers[0].size;
- input_cfg.panel_id = buf_out_params->buffers[0].panel_id;
- input_cfg.secure_session = true;
- hfc_buffer_fd_ = buf_out_params->buffers[0].fd;
- hfc_buffer_size_ = buf_out_params->buffers[0].size;
+ input_cfg.secure_hfc_fd = buf_out_params->buffers[0].fd;
+ input_cfg.secure_hfc_size = buf_out_params->buffers[0].size;
+ input_cfg.panel_id = buf_out_params->buffers[0].panel_id;
+ input_cfg.secure_session = true;
+ hfc_buffer_fd_ = buf_out_params->buffers[0].fd;
+ hfc_buffer_size_ = buf_out_params->buffers[0].size;
#endif
- DLOGI("panel id %lx\n", input_cfg.panel_id);
- input_cfg.panel_id = panel_id;
- std::unique_ptr<DemuraIntf> demura =
- pf_factory_->CreateDemuraIntf(input_cfg, prop_intf_, buffer_allocator_, spr_);
- if (!demura) {
- DLOGE("Unable to create Demura on Display %d-%d", display_id_, display_type_);
- return kErrorMemory;
- }
+ input_cfg.panel_id = panel_id_;
+ DLOGI("panel id %lx\n", input_cfg.panel_id);
+ std::unique_ptr<DemuraIntf> demura =
+ pf_factory_->CreateDemuraIntf(input_cfg, prop_intf_, buffer_allocator_, spr_);
+ if (!demura) {
+ DLOGE("Unable to create Demura on Display %d-%d", display_id_, display_type_);
+ return kErrorMemory;
+ }
- demura_ = std::move(demura);
- if (demura_->Init() != 0) {
- DLOGE("Unable to initialize Demura on Display %d-%d", display_id_, display_type_);
- return kErrorUndefined;
- }
+ demura_ = std::move(demura);
+ if (demura_->Init() != 0) {
+ DLOGE("Unable to initialize Demura on Display %d-%d", display_id_, display_type_);
+ return kErrorUndefined;
+ }
- if (SetupDemuraLayer() != kErrorNone) {
- DLOGE("Unable to setup Demura layer on Display %d-%d", display_id_, display_type_);
- return kErrorUndefined;
- }
+ if (SetupDemuraLayer() != kErrorNone) {
+ DLOGE("Unable to setup Demura layer on Display %d-%d", display_id_, display_type_);
+ return kErrorUndefined;
+ }
- if (SetDemuraIntfStatus(true)) {
- return kErrorUndefined;
- }
+ if (SetDemuraIntfStatus(true)) {
+ return kErrorUndefined;
+ }
- comp_manager_->SetDemuraStatusForDisplay(display_id_, true);
- demura_intended_ = true;
- DLOGI("Enabled Demura Core!");
+ comp_manager_->SetDemuraStatusForDisplay(display_id_, true);
+ demura_intended_ = true;
+ DLOGI("Enabled Demura Core!");
#ifndef TRUSTED_VM
- GenericPayload pl;
- uint64_t *panel_id_ptr = nullptr;
- int rc = 0;
- if ((rc = pl.CreatePayload<uint64_t>(panel_id_ptr))) {
- DLOGE("Failed to create payload for Paneld, error = %d", rc);
- }
- demura_->GetParameter(kDemuraFeatureParamPanelId, &pl);
- vm_cb_intf_ = new DisplayIPCVmCallbackImpl(buffer_allocator_, ipc_intf_,
- *panel_id_ptr, hfc_buffer_width_, hfc_buffer_height_);
- vm_cb_intf_->Init();
-#endif
- return kErrorNone;
+ GenericPayload pl;
+ uint64_t *panel_id_ptr = nullptr;
+ int rc = 0;
+ if ((rc = pl.CreatePayload<uint64_t>(panel_id_ptr))) {
+ DLOGE("Failed to create payload for Paneld, error = %d", rc);
}
- return kErrorUndefined;
+ demura_->GetParameter(kDemuraFeatureParamPanelId, &pl);
+ vm_cb_intf_ = new DisplayIPCVmCallbackImpl(buffer_allocator_, ipc_intf_,
+ *panel_id_ptr, hfc_buffer_width_, hfc_buffer_height_);
+ vm_cb_intf_->Init();
+#endif
+ return kErrorNone;
}
DisplayError DisplayBuiltIn::SetupDemuraLayer() {
@@ -730,6 +684,139 @@
}
}
+DisplayError DisplayBuiltIn::SetupDemuraT0AndTn() {
+ DisplayError error = kErrorNone;
+ int ret = 0, value = 0, panel_id_w = 0;
+ uint64_t panel_id = 0;
+ bool demura_allowed = false, demuratn_allowed = false;
+
+ if (!comp_manager_->GetDemuraStatus()) {
+ comp_manager_->FreeDemuraFetchResources(display_id_);
+ comp_manager_->SetDemuraStatusForDisplay(display_id_, false);
+ return kErrorNone;
+ }
+
+ if (IsPrimaryDisplay()) {
+ Debug::Get()->GetProperty(DEMURA_PRIMARY_PANEL_OVERRIDE_LOW, &panel_id_w);
+ panel_id = static_cast<uint32_t>(panel_id_w);
+ Debug::Get()->GetProperty(DEMURA_PRIMARY_PANEL_OVERRIDE_HIGH, &panel_id_w);
+ panel_id |= ((static_cast<uint64_t>(panel_id_w)) << 32);
+ Debug::Get()->GetProperty(DISABLE_DEMURA_PRIMARY, &value);
+ DLOGI("panel overide total value %lx\n", panel_id);
+ } else {
+ Debug::Get()->GetProperty(DEMURA_SECONDARY_PANEL_OVERRIDE_LOW, &panel_id_w);
+ panel_id = static_cast<uint32_t>(panel_id_w);
+ Debug::Get()->GetProperty(DEMURA_SECONDARY_PANEL_OVERRIDE_HIGH, &panel_id_w);
+ panel_id |= ((static_cast<uint64_t>(panel_id_w)) << 32);
+ Debug::Get()->GetProperty(DISABLE_DEMURA_SECONDARY, &value);
+ DLOGI("panel overide total value %lx\n", panel_id);
+ }
+
+ if (value > 0) {
+ comp_manager_->FreeDemuraFetchResources(display_id_);
+ comp_manager_->SetDemuraStatusForDisplay(display_id_, false);
+ return kErrorNone;
+ } else if (value < 0) {
+ return kErrorUndefined;
+ }
+
+ PanelFeaturePropertyInfo info;
+ if (!panel_id) {
+ info.prop_ptr = reinterpret_cast<uint64_t>(&panel_id);
+ info.prop_id = kPanelFeatureDemuraPanelId;
+ ret = prop_intf_->GetPanelFeature(&info);
+ if (ret) {
+ DLOGE("Failed to get panel id, error = %d", ret);
+ return kErrorUndefined;
+ }
+ }
+ panel_id_ = panel_id;
+ DLOGI("panel_id 0x%lx", panel_id_);
+
+#ifndef SDM_UNIT_TESTING
+ if (!feature_license_factory_) {
+ DLOGI("Feature license factory is not available");
+ return kErrorNone;
+ }
+
+ std::shared_ptr<FeatureLicenseIntf> feat_license_intf =
+ feature_license_factory_->CreateFeatureLicenseIntf();
+ if (!feat_license_intf) {
+ feature_license_factory_ = nullptr;
+ DLOGE("Failed to create FeatureLicenseIntf");
+ return kErrorUndefined;
+ }
+ ret = feat_license_intf->Init();
+ if (ret) {
+ DLOGE("Failed to init FeatureLicenseIntf");
+ return kErrorUndefined;
+ }
+
+ GenericPayload demura_pl, aa_pl, out_pl;
+ DemuraValidatePermissionInput *demura_input = nullptr;
+ ret = demura_pl.CreatePayload<DemuraValidatePermissionInput>(demura_input);
+ if (ret) {
+ DLOGE("Failed to create the payload. Error:%d", ret);
+ return kErrorUndefined;
+ }
+
+ bool *allowed = nullptr;
+ ret = out_pl.CreatePayload<bool>(allowed);
+ if (ret) {
+ DLOGE("Failed to create the payload. Error:%d", ret);
+ return kErrorUndefined;
+ }
+
+ demura_input->id = kDemura;
+ demura_input->panel_id = panel_id_;
+ ret = feat_license_intf->ProcessOps(kValidatePermission, demura_pl, &out_pl);
+ if (ret) {
+ DLOGE("Failed to get the license permission for Demura. Error:%d", ret);
+ return kErrorUndefined;
+ }
+ demura_allowed = *allowed;
+
+ AntiAgingValidatePermissionInput *aa_input = nullptr;
+ ret = aa_pl.CreatePayload<AntiAgingValidatePermissionInput>(aa_input);
+ if (ret) {
+ DLOGE("Failed to create the payload. Error:%d", ret);
+ return kErrorUndefined;
+ }
+
+ aa_input->id = kAntiAging;
+ ret = feat_license_intf->ProcessOps(kValidatePermission, aa_pl, &out_pl);
+ if (ret) {
+ DLOGE("Failed to get the license permission for Anti-aging. Error:%d", ret);
+ return kErrorUndefined;
+ }
+ demuratn_allowed = *allowed;
+#else
+ demura_allowed = true;
+ demuratn_allowed = true;
+#endif
+
+ DLOGI("Demura enable allowed %d, Anti-aging enable allowed %d", demura_allowed, demuratn_allowed);
+ if (demura_allowed) {
+ error = SetupDemura();
+ if (error != kErrorNone) {
+ // Non-fatal but not expected, log error
+ DLOGE("Demura failed to initialize on display %d-%d, Error = %d", display_id_, display_type_,
+ error);
+ comp_manager_->FreeDemuraFetchResources(display_id_);
+ comp_manager_->SetDemuraStatusForDisplay(display_id_, false);
+ if (demura_) {
+ SetDemuraIntfStatus(false);
+ }
+ } else if (demuratn_allowed && demuratn_factory_) {
+ error = SetupDemuraTn();
+ if (error != kErrorNone) {
+ DLOGW("Failed to setup DemuraTn, Error = %d", error);
+ }
+ }
+ }
+ return kErrorNone;
+}
+
DisplayError DisplayBuiltIn::SetupDemuraTn() {
int ret = 0;
diff --git a/sdm/libs/core/display_builtin.h b/sdm/libs/core/display_builtin.h
index 9ca3395..758e8db 100644
--- a/sdm/libs/core/display_builtin.h
+++ b/sdm/libs/core/display_builtin.h
@@ -25,7 +25,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
@@ -40,6 +40,7 @@
#include <private/extension_interface.h>
#include <private/spr_intf.h>
#include <private/demuratn_core_uvm_fact_intf.h>
+#include <private/feature_license_intf.h>
#include <private/panel_feature_property_intf.h>
#include <private/panel_feature_factory_intf.h>
#include <private/hw_events_interface.h>
@@ -235,6 +236,7 @@
DisplayError SetupDemuraLayer();
DisplayError SetupDemuraTn();
DisplayError EnableDemuraTn(bool enable);
+ DisplayError SetupDemuraT0AndTn();
DisplayError BuildLayerStackStats(LayerStack *layer_stack) override;
void UpdateDisplayModeParams();
void HandleQsyncPostCommit();
@@ -295,6 +297,7 @@
std::shared_ptr<DemuraIntf> demura_ = nullptr;
bool demuratn_enabled_ = false;
std::shared_ptr<DemuraTnCoreUvmIntf> demuratn_ = nullptr;
+ uint64_t panel_id_;
Layer demura_layer_ = {};
bool demura_intended_ = false;
bool demura_dynamic_enabled_ = true;
diff --git a/sdm/libs/core/resource_default.cpp b/sdm/libs/core/resource_default.cpp
index 5aaed31..3a6a4ce 100644
--- a/sdm/libs/core/resource_default.cpp
+++ b/sdm/libs/core/resource_default.cpp
@@ -25,7 +25,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
@@ -395,6 +395,11 @@
void ResourceDefault::HandleTUITransition(Handle display_ctx, bool tui_active) {
}
+DisplayError ResourceDefault::SetBlendSpace(Handle display_ctx,
+ const PrimariesTransfer &blend_space) {
+ return kErrorNone;
+}
+
DisplayError ResourceDefault::PostCommit(Handle display_ctx, DispLayerStack *disp_layer_stack) {
DisplayResourceContext *display_resource_ctx =
reinterpret_cast<DisplayResourceContext *>(display_ctx);
diff --git a/sdm/libs/core/resource_default.h b/sdm/libs/core/resource_default.h
index b246ecc..89f6a9b 100644
--- a/sdm/libs/core/resource_default.h
+++ b/sdm/libs/core/resource_default.h
@@ -27,7 +27,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
-* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
@@ -142,6 +142,7 @@
virtual std::string Dump();
virtual uint32_t GetMixerCount();
virtual void HandleTUITransition(Handle display_ctx, bool tui_active);
+ virtual DisplayError SetBlendSpace(Handle display_ctx, const PrimariesTransfer &blend_space);
private:
enum PipeOwner {