libhwc2.1: vrrController: correct the refresh control enabled pattern
The refresh control enabled identifier is terminated by line feed character; during string comparison, the line feed character should be disregarded.
Bug: b/323554353
Test: verify when MRR writes to the refresh control node
Change-Id: Ia0db4d39784455d254d3a51dd9f9681eaa2823cd
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp
index 0aea128..788cd48 100644
--- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp
+++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp
@@ -45,6 +45,7 @@
using android::hardware::graphics::composer::kPanelRefreshCtrlFrameInsertionAutoMode;
using android::hardware::graphics::composer::kPanelRefreshCtrlIdleEnabled;
using android::hardware::graphics::composer::kPanelRefreshCtrlTeTypeChangeable;
+using android::hardware::graphics::composer::kRefreshControlNodeEnabled;
using android::hardware::graphics::composer::kRefreshControlNodeName;
constexpr auto nsecsPerSec = std::chrono::nanoseconds(1s).count();
@@ -174,7 +175,9 @@
} else {
FileNodeWriter fileNodeWriter(displayFileNodePath);
auto content = fileNodeWriter.read(kRefreshControlNodeName);
- if (content.has_value() && (content.value() == "Enabled")) {
+ if (content.has_value() &&
+ !(content.value().compare(0, kRefreshControlNodeEnabled.length(),
+ kRefreshControlNodeEnabled))) {
uint32_t cmd = kPanelRefreshCtrlFrameInsertionAutoMode |
kPanelRefreshCtrlIdleEnabled | kPanelRefreshCtrlTeTypeChangeable;
bool ret = fileNodeWriter.WriteCommandString(kRefreshControlNodeName, cmd);
diff --git a/libhwc2.1/libvrr/interface/Panel_def.h b/libhwc2.1/libvrr/interface/Panel_def.h
index 91f9057..c624bd3 100644
--- a/libhwc2.1/libvrr/interface/Panel_def.h
+++ b/libhwc2.1/libvrr/interface/Panel_def.h
@@ -20,6 +20,7 @@
// Definition of panel refresh control.
const std::string kRefreshControlNodeName = "refresh_ctrl";
+const std::string kRefreshControlNodeEnabled = "Enabled";
static constexpr uint32_t kPanelRefreshCtrlFrameInsertionMaxFrameCount = (1U << 7);
static constexpr uint32_t kPanelRefreshCtrlFrameInsertionFrameCountMask =