DSDisplayDevice: add get functions. 67/241767/1
authorSooChan Lim <sc1.lim@samsung.com>
Sun, 9 Aug 2020 04:32:05 +0000 (13:32 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:10:24 +0000 (19:10 +0900)
add getRefreshRate(), getName() functions

Change-Id: I18b3dcba30f15ab0c8babb64e9bd3328151f8ea1

src/DSDisplayDevice/DSDisplayDeviceOutputTDMImpl.cpp
src/DSDisplayDevice/DSDisplayDeviceOutputTDMImpl.h
src/DSDisplayDevice/IDSDisplayDeviceOutput.h

index 4ef1821..514ae74 100644 (file)
@@ -13,6 +13,7 @@ DSDisplayDeviceOutputTDMImpl::DSDisplayDeviceOutputTDMImpl()
          __resolutionHeight(0),
          __physicalMMWidth(0),
          __physicalMMHeight(0),
+         __refreshRate(0),
          __outputMode(nullptr),
          __dpmsMode(IDSDisplayDeviceOutput::DPMS_OFF),
          __displayDeviceHWC(nullptr)
@@ -27,6 +28,7 @@ DSDisplayDeviceOutputTDMImpl::DSDisplayDeviceOutputTDMImpl(tdm_output *toutput)
          __resolutionHeight(0),
          __physicalMMWidth(0),
          __physicalMMHeight(0),
+         __refreshRate(0),
          __outputMode(nullptr),
          __dpmsMode(IDSDisplayDeviceOutput::DPMS_OFF),
          __displayDeviceHWC(nullptr)
@@ -90,6 +92,16 @@ int DSDisplayDeviceOutputTDMImpl::getPhysicalMMHeight()
        return __physicalMMHeight;
 }
 
+int DSDisplayDeviceOutputTDMImpl::getRefreshRate()
+{
+       return __refreshRate;
+}
+
+std::string DSDisplayDeviceOutputTDMImpl::getName()
+{
+       return __name;
+}
+
 bool DSDisplayDeviceOutputTDMImpl::setMode(std::shared_ptr<IDSDisplayDeviceOutputMode> outputMode)
 {
        tdm_error terror;
@@ -103,6 +115,10 @@ bool DSDisplayDeviceOutputTDMImpl::setMode(std::shared_ptr<IDSDisplayDeviceOutpu
        }
 
        __outputMode = outputMode;
+       __resolutionWidth = __outputMode->getHorizontalSize();
+       __resolutionHeight = __outputMode->getVertialSize();
+       __refreshRate = __outputMode->getRefreshRate();
+       __name = __outputMode->getName();
 
        return true;
 }
index 36cebfe..afd5294 100644 (file)
@@ -22,6 +22,8 @@ public:
        int getResolutionHeight() override;
        int getPhysicalMMWidth() override;
        int getPhysicalMMHeight() override;
+       int getRefreshRate() override;
+       std::string getName() override;
 
        std::list<std::shared_ptr<IDSDisplayDeviceOutputMode>> getAvailableModes() override;
        bool                                                   setMode(std::shared_ptr<IDSDisplayDeviceOutputMode> outputMode) override;
@@ -56,6 +58,8 @@ private:
        std::list<std::shared_ptr<IDSDisplayDeviceOutputMode>> __availableModeList;
        unsigned int __resolutionWidth, __resolutionHeight;
        unsigned int __physicalMMWidth, __physicalMMHeight;
+       unsigned int __refreshRate;
+       std::string __name;
        std::shared_ptr<IDSDisplayDeviceOutputMode> __outputMode;
        IDSDisplayDeviceOutput::DPMSMode __dpmsMode;
 
index 766bb9d..495d325 100644 (file)
@@ -58,6 +58,8 @@ public:
        virtual int           getResolutionHeight() = 0;
        virtual int           getPhysicalMMWidth() = 0;
        virtual int           getPhysicalMMHeight() = 0;
+       virtual int           getRefreshRate() = 0;
+       virtual std::string   getName() = 0;
 
        virtual std::list<std::shared_ptr<IDSDisplayDeviceOutputMode>> getAvailableModes() = 0;
        virtual bool                                                   setMode(std::shared_ptr<IDSDisplayDeviceOutputMode> outputMode) = 0;