libhwc2.1: Get rid of getPanelFileNodePath

We already have a getPanelSysfsPath method and getPanelFileNodePath
was a thin wrapper over that. Having two methods do essentially the
same thing is confusing, so let's remove the getPanelFileNodePath
and instead introduce an overload of getPanelSysfsPath without
the type parameter.

Bug: 288608645
Test: presubmit
Change-Id: I2a157c669c4ad8950c80f697a74202f42179eb51
diff --git a/libhwc2.1/libdevice/ExynosDisplay.h b/libhwc2.1/libdevice/ExynosDisplay.h
index 22503c5..8bdaad5 100644
--- a/libhwc2.1/libdevice/ExynosDisplay.h
+++ b/libhwc2.1/libdevice/ExynosDisplay.h
@@ -1316,7 +1316,7 @@
         /* set brightness by dbv value */
         virtual int32_t setBrightnessDbv(const uint32_t dbv);
 
-        virtual std::string getPanelFileNodePath() const { return std::string(); }
+        virtual std::string getPanelSysfsPath() const { return std::string(); }
 
         virtual void onVsync(int64_t __unused timestamp) { return; };
 
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp
index f2aadf9..ba2cb5c 100644
--- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp
+++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.cpp
@@ -699,10 +699,6 @@
     return res;
 }
 
-std::string ExynosPrimaryDisplay::getPanelFileNodePath() const {
-    return getPanelSysfsPath(getDisplayTypeFromIndex(mIndex));
-}
-
 void ExynosPrimaryDisplay::onVsync(int64_t timestamp) {
     const auto vsyncListener = getVsyncListener();
     if (vsyncListener) {
@@ -1013,7 +1009,7 @@
         return HWC2_ERROR_UNSUPPORTED;
     }
 
-    const std::string path = getPanelSysfsPath(getDisplayTypeFromIndex(mIndex)) + "panel_idle";
+    const std::string path = getPanelSysfsPath() + "panel_idle";
     std::ifstream ifs(path);
     if (!ifs.is_open()) {
         ALOGW("%s() unable to open node '%s', error = %s", __func__, path.c_str(), strerror(errno));
@@ -1029,7 +1025,7 @@
 }
 
 int32_t ExynosPrimaryDisplay::setDisplayIdleTimerEnabled(const bool enabled) {
-    const std::string path = getPanelSysfsPath(getDisplayTypeFromIndex(mIndex)) + "panel_idle";
+    const std::string path = getPanelSysfsPath() + "panel_idle";
     std::ofstream ofs(path);
     if (!ofs.is_open()) {
         ALOGW("%s() unable to open node '%s', error = %s", __func__, path.c_str(), strerror(errno));
@@ -1063,7 +1059,7 @@
     const int32_t displayIdleDelayMs = std::chrono::duration_cast<std::chrono::milliseconds>(
                                                std::chrono::nanoseconds(mDisplayIdleDelayNanos))
                                                .count();
-    const std::string path = getPanelSysfsPath(getDisplayTypeFromIndex(mIndex)) + "idle_delay_ms";
+    const std::string path = getPanelSysfsPath() + "idle_delay_ms";
     std::ofstream ofs(path);
     if (!ofs.is_open()) {
         ALOGW("%s() unable to open node '%s', error = %s", __func__, path.c_str(), strerror(errno));
@@ -1082,8 +1078,7 @@
         return;
     }
 
-    const std::string path =
-            getPanelSysfsPath(getDisplayTypeFromIndex(mIndex)) + "panel_need_handle_idle_exit";
+    const std::string path = getPanelSysfsPath() + "panel_need_handle_idle_exit";
     mDisplayNeedHandleIdleExitOfs.open(path, std::ofstream::out);
     if (!mDisplayNeedHandleIdleExitOfs.is_open()) {
         ALOGI("%s() '%s' doesn't exist(%s)", __func__, path.c_str(), strerror(errno));
@@ -1165,7 +1160,7 @@
     }
     if (maxMinIdleFps == mMinIdleRefreshRate) return NO_ERROR;
 
-    const std::string path = getPanelSysfsPath(getDisplayTypeFromIndex(mIndex)) + "min_vrefresh";
+    const std::string path = getPanelSysfsPath() + "min_vrefresh";
     std::ofstream ofs(path);
     if (!ofs.is_open()) {
         ALOGW("%s Unable to open node '%s', error = %s", __func__, path.c_str(), strerror(errno));
diff --git a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.h b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.h
index 79eea4d..0be4c60 100644
--- a/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.h
+++ b/libhwc2.1/libmaindisplay/ExynosPrimaryDisplay.h
@@ -78,8 +78,6 @@
                                           hwc2_config_t* outConfigs) override;
         virtual int32_t presentDisplay(int32_t* outRetireFence) override;
 
-        virtual std::string getPanelFileNodePath() const override;
-
         virtual void onVsync(int64_t timestamp) override;
 
     protected:
@@ -103,6 +101,9 @@
     public:
         // Prepare multi resolution
         ResolutionInfo mResolutionInfo;
+        std::string getPanelSysfsPath() const override {
+            return getPanelSysfsPath(getDisplayTypeFromIndex(mIndex));
+        }
         std::string getPanelSysfsPath(const displaycolor::DisplayType& type) const;
 
         uint32_t mRcdId = -1;
diff --git a/libhwc2.1/libvrr/VariableRefreshRateController.cpp b/libhwc2.1/libvrr/VariableRefreshRateController.cpp
index f886ec3..a008ef2 100644
--- a/libhwc2.1/libvrr/VariableRefreshRateController.cpp
+++ b/libhwc2.1/libvrr/VariableRefreshRateController.cpp
@@ -64,7 +64,7 @@
 VariableRefreshRateController::VariableRefreshRateController(ExynosDisplay* display)
       : mDisplay(display) {
     mState = VrrControllerState::kDisable;
-    std::string displayFileNodePath = mDisplay->getPanelFileNodePath();
+    std::string displayFileNodePath = mDisplay->getPanelSysfsPath();
     if (displayFileNodePath.empty()) {
         LOG(WARNING) << "VrrController: Cannot find file node of display: "
                      << mDisplay->mDisplayName;