Loading services/surfaceflinger/DisplayHardware/DisplayMode.h +8 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <android-base/stringprintf.h> #include <android/configuration.h> #include <ui/DisplayId.h> #include <ui/DisplayMode.h> #include <ui/Size.h> #include <utils/Timers.h> Loading Loading @@ -54,6 +55,11 @@ public: return *this; } Builder& setPhysicalDisplayId(PhysicalDisplayId id) { mDisplayMode->mPhysicalDisplayId = id; return *this; } Builder& setWidth(int32_t width) { mDisplayMode->mWidth = width; return *this; Loading Loading @@ -112,6 +118,7 @@ public: DisplayModeId getId() const { return mId; } hal::HWConfigId getHwcId() const { return mHwcId; } PhysicalDisplayId getPhysicalDisplayId() const { return mPhysicalDisplayId; } int32_t getWidth() const { return mWidth; } int32_t getHeight() const { return mHeight; } Loading @@ -136,6 +143,7 @@ private: hal::HWConfigId mHwcId; DisplayModeId mId; PhysicalDisplayId mPhysicalDisplayId; int32_t mWidth = -1; int32_t mHeight = -1; Loading services/surfaceflinger/SurfaceFlinger.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -2531,6 +2531,7 @@ void SurfaceFlinger::loadDisplayModes(PhysicalDisplayId displayId, DisplayModes& for (const auto& hwcMode : hwcModes) { newModes.push_back(DisplayMode::Builder(hwcMode.hwcId) .setId(DisplayModeId{nextModeId++}) .setPhysicalDisplayId(displayId) .setWidth(hwcMode.width) .setHeight(hwcMode.height) .setVsyncPeriod(hwcMode.vsyncPeriod) Loading services/surfaceflinger/tests/unittests/LayerHistoryTest.cpp +16 −14 Original line number Diff line number Diff line Loading @@ -115,17 +115,19 @@ protected: << "Frame rate is " << frameRate; } std::shared_ptr<RefreshRateConfigs> mConfigs = std::make_shared<RefreshRateConfigs>(DisplayModes{DisplayMode::Builder(0) std::shared_ptr<RefreshRateConfigs> mConfigs = std::make_shared< RefreshRateConfigs>(DisplayModes{DisplayMode::Builder(0) .setId(DisplayModeId(0)) .setVsyncPeriod(int32_t( LO_FPS_PERIOD)) .setPhysicalDisplayId( PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(int32_t(LO_FPS_PERIOD)) .setGroup(0) .build(), DisplayMode::Builder(1) .setId(DisplayModeId(1)) .setVsyncPeriod(int32_t( HI_FPS_PERIOD)) .setPhysicalDisplayId( PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(int32_t(HI_FPS_PERIOD)) .setGroup(0) .build()}, DisplayModeId(0)); Loading services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ DisplayModePtr RefreshRateConfigsTest::createDisplayMode(DisplayModeId modeId, i int64_t vsyncPeriod, ui::Size resolution) { return DisplayMode::Builder(hal::HWConfigId(modeId.value())) .setId(modeId) .setPhysicalDisplayId(PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(int32_t(vsyncPeriod)) .setGroup(group) .setHeight(resolution.height) Loading services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ DisplayModePtr RefreshRateStatsTest::createDisplayMode(DisplayModeId modeId, int int64_t vsyncPeriod) { return DisplayMode::Builder(static_cast<hal::HWConfigId>(modeId.value())) .setId(modeId) .setPhysicalDisplayId(PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(static_cast<int32_t>(vsyncPeriod)) .setGroup(group) .build(); Loading Loading
services/surfaceflinger/DisplayHardware/DisplayMode.h +8 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <android-base/stringprintf.h> #include <android/configuration.h> #include <ui/DisplayId.h> #include <ui/DisplayMode.h> #include <ui/Size.h> #include <utils/Timers.h> Loading Loading @@ -54,6 +55,11 @@ public: return *this; } Builder& setPhysicalDisplayId(PhysicalDisplayId id) { mDisplayMode->mPhysicalDisplayId = id; return *this; } Builder& setWidth(int32_t width) { mDisplayMode->mWidth = width; return *this; Loading Loading @@ -112,6 +118,7 @@ public: DisplayModeId getId() const { return mId; } hal::HWConfigId getHwcId() const { return mHwcId; } PhysicalDisplayId getPhysicalDisplayId() const { return mPhysicalDisplayId; } int32_t getWidth() const { return mWidth; } int32_t getHeight() const { return mHeight; } Loading @@ -136,6 +143,7 @@ private: hal::HWConfigId mHwcId; DisplayModeId mId; PhysicalDisplayId mPhysicalDisplayId; int32_t mWidth = -1; int32_t mHeight = -1; Loading
services/surfaceflinger/SurfaceFlinger.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -2531,6 +2531,7 @@ void SurfaceFlinger::loadDisplayModes(PhysicalDisplayId displayId, DisplayModes& for (const auto& hwcMode : hwcModes) { newModes.push_back(DisplayMode::Builder(hwcMode.hwcId) .setId(DisplayModeId{nextModeId++}) .setPhysicalDisplayId(displayId) .setWidth(hwcMode.width) .setHeight(hwcMode.height) .setVsyncPeriod(hwcMode.vsyncPeriod) Loading
services/surfaceflinger/tests/unittests/LayerHistoryTest.cpp +16 −14 Original line number Diff line number Diff line Loading @@ -115,17 +115,19 @@ protected: << "Frame rate is " << frameRate; } std::shared_ptr<RefreshRateConfigs> mConfigs = std::make_shared<RefreshRateConfigs>(DisplayModes{DisplayMode::Builder(0) std::shared_ptr<RefreshRateConfigs> mConfigs = std::make_shared< RefreshRateConfigs>(DisplayModes{DisplayMode::Builder(0) .setId(DisplayModeId(0)) .setVsyncPeriod(int32_t( LO_FPS_PERIOD)) .setPhysicalDisplayId( PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(int32_t(LO_FPS_PERIOD)) .setGroup(0) .build(), DisplayMode::Builder(1) .setId(DisplayModeId(1)) .setVsyncPeriod(int32_t( HI_FPS_PERIOD)) .setPhysicalDisplayId( PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(int32_t(HI_FPS_PERIOD)) .setGroup(0) .build()}, DisplayModeId(0)); Loading
services/surfaceflinger/tests/unittests/RefreshRateConfigsTest.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ DisplayModePtr RefreshRateConfigsTest::createDisplayMode(DisplayModeId modeId, i int64_t vsyncPeriod, ui::Size resolution) { return DisplayMode::Builder(hal::HWConfigId(modeId.value())) .setId(modeId) .setPhysicalDisplayId(PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(int32_t(vsyncPeriod)) .setGroup(group) .setHeight(resolution.height) Loading
services/surfaceflinger/tests/unittests/RefreshRateStatsTest.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,7 @@ DisplayModePtr RefreshRateStatsTest::createDisplayMode(DisplayModeId modeId, int int64_t vsyncPeriod) { return DisplayMode::Builder(static_cast<hal::HWConfigId>(modeId.value())) .setId(modeId) .setPhysicalDisplayId(PhysicalDisplayId::fromPort(0)) .setVsyncPeriod(static_cast<int32_t>(vsyncPeriod)) .setGroup(group) .build(); Loading