From fe534dde9775cb95b9540448aee41d4b2c37700b Mon Sep 17 00:00:00 2001 From: Sandeep Maddipatla Date: Fri, 6 Jan 2023 10:16:57 +0000 Subject: [PATCH 1/2] aic-emu: Fix display_control_t profile dump Related Jira: VSMGWL-51998 - There is a bug in the dump for this structure, where it is dumped at one level higher than it should be, causing the parser to break for cases with this structure - Applicable to use-cases with client-driven resolution change --- source/hwc_vhal_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/hwc_vhal_impl.h b/source/hwc_vhal_impl.h index 5462584..b99517f 100644 --- a/source/hwc_vhal_impl.h +++ b/source/hwc_vhal_impl.h @@ -504,7 +504,7 @@ class VirtualHwcReceiver::Impl AIC_LOG(mDebug, "Failed to read display control info: %s\n", strerror(errno)); return -1; } - m_pLog->AddDisplayControlStruct(&ctrl, 2); + m_pLog->AddDisplayControlStruct(&ctrl, 1); } cros_gralloc_handle_t handle = get_handle(ev.info.remote_handle); From 2db425da774b10cffc7edd63865b281e9e9704d1 Mon Sep 17 00:00:00 2001 From: Sandeep Maddipatla Date: Fri, 6 Jan 2023 10:18:45 +0000 Subject: [PATCH 2/2] aic-emu: Add logging control for Yml parser - Add support to disable logs from parser if they are not required --- aic-emu/YmlParser.cc | 16 +++++++++++++++- aic-emu/YmlParser.h | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/aic-emu/YmlParser.cc b/aic-emu/YmlParser.cc index 0a583bb..ddca3d1 100644 --- a/aic-emu/YmlParser.cc +++ b/aic-emu/YmlParser.cc @@ -19,9 +19,13 @@ #include "CmdHandler.h" +static bool g_logEnable = true; + int GetEventCode(std::string str) { - std::cout << str << "@@@@@@@@@" << std::endl; + if (g_logEnable) + std::cout << str << "@@@@@@@@@" << std::endl; + int event = 0; if (str == "VHAL_DD_EVENT_DISPINFO_REQ") @@ -52,6 +56,16 @@ int GetEventCode(std::string str) return event; } +void YAML::SetParserLogFlag(bool value) +{ + g_logEnable = value; +} + +bool YAML::GetParserLogFlag() +{ + return g_logEnable; +} + bool YAML::convert::decode(const YAML::Node& node, AicEventMetadataPtr &mptr) { if (mptr == nullptr || !node.IsMap()) diff --git a/aic-emu/YmlParser.h b/aic-emu/YmlParser.h index b5c8655..8be02ea 100644 --- a/aic-emu/YmlParser.h +++ b/aic-emu/YmlParser.h @@ -91,5 +91,9 @@ namespace YAML template <> struct convert { static bool decode(const Node& node, DisplayCtrlPtr &mptr); }; + + bool GetParserLogFlag(); + + void SetParserLogFlag(bool value); } #endif