Loading services/surfaceflinger/BufferLayer.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -377,7 +377,7 @@ bool BufferLayer::onPostComposition(const DisplayDevice* display, displayId && mFlinger->getHwComposer().isConnected(*displayId)) { displayId && mFlinger->getHwComposer().isConnected(*displayId)) { // The HWC doesn't support present fences, so use the refresh // The HWC doesn't support present fences, so use the refresh // timestamp instead. // timestamp instead. const nsecs_t actualPresentTime = mFlinger->getHwComposer().getRefreshTimestamp(*displayId); const nsecs_t actualPresentTime = display->getRefreshTimestamp(); mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime); mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime); mFlinger->mFrameTracer->traceTimestamp(layerId, getCurrentBufferId(), mCurrentFrameNumber, mFlinger->mFrameTracer->traceTimestamp(layerId, getCurrentBufferId(), mCurrentFrameNumber, actualPresentTime, actualPresentTime, Loading services/surfaceflinger/CompositionEngine/include/compositionengine/DisplaySurface.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #pragma once #include <ui/Size.h> #include <utils/Errors.h> #include <utils/Errors.h> #include <utils/RefBase.h> #include <utils/RefBase.h> #include <utils/StrongPointer.h> #include <utils/StrongPointer.h> Loading Loading @@ -71,7 +72,7 @@ public: virtual void dumpAsString(String8& result) const = 0; virtual void dumpAsString(String8& result) const = 0; virtual void resizeBuffers(const uint32_t w, const uint32_t h) = 0; virtual void resizeBuffers(const ui::Size&) = 0; virtual const sp<Fence>& getClientTargetAcquireFence() const = 0; virtual const sp<Fence>& getClientTargetAcquireFence() const = 0; }; }; Loading services/surfaceflinger/CompositionEngine/include/compositionengine/mock/DisplaySurface.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <compositionengine/DisplaySurface.h> #include <compositionengine/DisplaySurface.h> #include <gmock/gmock.h> #include <gmock/gmock.h> #include <ui/Size.h> #include <utils/String8.h> #include <utils/String8.h> namespace android::compositionengine::mock { namespace android::compositionengine::mock { Loading @@ -32,7 +33,7 @@ public: MOCK_METHOD0(advanceFrame, status_t()); MOCK_METHOD0(advanceFrame, status_t()); MOCK_METHOD0(onFrameCommitted, void()); MOCK_METHOD0(onFrameCommitted, void()); MOCK_CONST_METHOD1(dumpAsString, void(String8& result)); MOCK_CONST_METHOD1(dumpAsString, void(String8& result)); MOCK_METHOD2(resizeBuffers, void(uint32_t, uint32_t)); MOCK_METHOD1(resizeBuffers, void(const ui::Size&)); MOCK_CONST_METHOD0(getClientTargetAcquireFence, const sp<Fence>&()); MOCK_CONST_METHOD0(getClientTargetAcquireFence, const sp<Fence>&()); }; }; Loading services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -96,8 +96,7 @@ const sp<Fence>& RenderSurface::getClientTargetAcquireFence() const { } } void RenderSurface::setDisplaySize(const ui::Size& size) { void RenderSurface::setDisplaySize(const ui::Size& size) { mDisplaySurface->resizeBuffers(static_cast<uint32_t>(size.width), mDisplaySurface->resizeBuffers(size); static_cast<uint32_t>(size.height)); mSize = size; mSize = size; } } Loading services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +3 −4 Original line number Original line Diff line number Diff line Loading @@ -85,16 +85,15 @@ public: MOCK_CONST_METHOD0(updatesDeviceProductInfoOnHotplugReconnect, bool()); MOCK_CONST_METHOD0(updatesDeviceProductInfoOnHotplugReconnect, bool()); MOCK_METHOD2(onVsync, bool(hal::HWDisplayId, int64_t)); MOCK_METHOD2(onVsync, bool(hal::HWDisplayId, int64_t)); MOCK_METHOD2(setVsyncEnabled, void(PhysicalDisplayId, hal::Vsync)); MOCK_METHOD2(setVsyncEnabled, void(PhysicalDisplayId, hal::Vsync)); MOCK_CONST_METHOD1(getRefreshTimestamp, nsecs_t(PhysicalDisplayId)); MOCK_CONST_METHOD1(isConnected, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(isConnected, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(getModes, DisplayModes(PhysicalDisplayId)); MOCK_CONST_METHOD1(getModes, std::vector<HWComposer::HWCDisplayMode>(PhysicalDisplayId)); MOCK_CONST_METHOD1(getActiveMode, DisplayModePtr(PhysicalDisplayId)); MOCK_CONST_METHOD1(getActiveMode, std::optional<hal::HWConfigId>(PhysicalDisplayId)); MOCK_CONST_METHOD1(getColorModes, std::vector<ui::ColorMode>(PhysicalDisplayId)); MOCK_CONST_METHOD1(getColorModes, std::vector<ui::ColorMode>(PhysicalDisplayId)); MOCK_METHOD3(setActiveColorMode, status_t(PhysicalDisplayId, ui::ColorMode, ui::RenderIntent)); MOCK_METHOD3(setActiveColorMode, status_t(PhysicalDisplayId, ui::ColorMode, ui::RenderIntent)); MOCK_CONST_METHOD0(isUsingVrComposer, bool()); MOCK_CONST_METHOD0(isUsingVrComposer, bool()); MOCK_CONST_METHOD1(getDisplayConnectionType, DisplayConnectionType(PhysicalDisplayId)); MOCK_CONST_METHOD1(getDisplayConnectionType, DisplayConnectionType(PhysicalDisplayId)); MOCK_CONST_METHOD1(isVsyncPeriodSwitchSupported, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(isVsyncPeriodSwitchSupported, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(getDisplayVsyncPeriod, nsecs_t(PhysicalDisplayId)); MOCK_CONST_METHOD2(getDisplayVsyncPeriod, status_t(PhysicalDisplayId, nsecs_t*)); MOCK_METHOD4(setActiveModeWithConstraints, MOCK_METHOD4(setActiveModeWithConstraints, status_t(PhysicalDisplayId, hal::HWConfigId, status_t(PhysicalDisplayId, hal::HWConfigId, const hal::VsyncPeriodChangeConstraints&, const hal::VsyncPeriodChangeConstraints&, Loading Loading
services/surfaceflinger/BufferLayer.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -377,7 +377,7 @@ bool BufferLayer::onPostComposition(const DisplayDevice* display, displayId && mFlinger->getHwComposer().isConnected(*displayId)) { displayId && mFlinger->getHwComposer().isConnected(*displayId)) { // The HWC doesn't support present fences, so use the refresh // The HWC doesn't support present fences, so use the refresh // timestamp instead. // timestamp instead. const nsecs_t actualPresentTime = mFlinger->getHwComposer().getRefreshTimestamp(*displayId); const nsecs_t actualPresentTime = display->getRefreshTimestamp(); mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime); mFlinger->mTimeStats->setPresentTime(layerId, mCurrentFrameNumber, actualPresentTime); mFlinger->mFrameTracer->traceTimestamp(layerId, getCurrentBufferId(), mCurrentFrameNumber, mFlinger->mFrameTracer->traceTimestamp(layerId, getCurrentBufferId(), mCurrentFrameNumber, actualPresentTime, actualPresentTime, Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/DisplaySurface.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ #pragma once #pragma once #include <ui/Size.h> #include <utils/Errors.h> #include <utils/Errors.h> #include <utils/RefBase.h> #include <utils/RefBase.h> #include <utils/StrongPointer.h> #include <utils/StrongPointer.h> Loading Loading @@ -71,7 +72,7 @@ public: virtual void dumpAsString(String8& result) const = 0; virtual void dumpAsString(String8& result) const = 0; virtual void resizeBuffers(const uint32_t w, const uint32_t h) = 0; virtual void resizeBuffers(const ui::Size&) = 0; virtual const sp<Fence>& getClientTargetAcquireFence() const = 0; virtual const sp<Fence>& getClientTargetAcquireFence() const = 0; }; }; Loading
services/surfaceflinger/CompositionEngine/include/compositionengine/mock/DisplaySurface.h +2 −1 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <compositionengine/DisplaySurface.h> #include <compositionengine/DisplaySurface.h> #include <gmock/gmock.h> #include <gmock/gmock.h> #include <ui/Size.h> #include <utils/String8.h> #include <utils/String8.h> namespace android::compositionengine::mock { namespace android::compositionengine::mock { Loading @@ -32,7 +33,7 @@ public: MOCK_METHOD0(advanceFrame, status_t()); MOCK_METHOD0(advanceFrame, status_t()); MOCK_METHOD0(onFrameCommitted, void()); MOCK_METHOD0(onFrameCommitted, void()); MOCK_CONST_METHOD1(dumpAsString, void(String8& result)); MOCK_CONST_METHOD1(dumpAsString, void(String8& result)); MOCK_METHOD2(resizeBuffers, void(uint32_t, uint32_t)); MOCK_METHOD1(resizeBuffers, void(const ui::Size&)); MOCK_CONST_METHOD0(getClientTargetAcquireFence, const sp<Fence>&()); MOCK_CONST_METHOD0(getClientTargetAcquireFence, const sp<Fence>&()); }; }; Loading
services/surfaceflinger/CompositionEngine/src/RenderSurface.cpp +1 −2 Original line number Original line Diff line number Diff line Loading @@ -96,8 +96,7 @@ const sp<Fence>& RenderSurface::getClientTargetAcquireFence() const { } } void RenderSurface::setDisplaySize(const ui::Size& size) { void RenderSurface::setDisplaySize(const ui::Size& size) { mDisplaySurface->resizeBuffers(static_cast<uint32_t>(size.width), mDisplaySurface->resizeBuffers(size); static_cast<uint32_t>(size.height)); mSize = size; mSize = size; } } Loading
services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +3 −4 Original line number Original line Diff line number Diff line Loading @@ -85,16 +85,15 @@ public: MOCK_CONST_METHOD0(updatesDeviceProductInfoOnHotplugReconnect, bool()); MOCK_CONST_METHOD0(updatesDeviceProductInfoOnHotplugReconnect, bool()); MOCK_METHOD2(onVsync, bool(hal::HWDisplayId, int64_t)); MOCK_METHOD2(onVsync, bool(hal::HWDisplayId, int64_t)); MOCK_METHOD2(setVsyncEnabled, void(PhysicalDisplayId, hal::Vsync)); MOCK_METHOD2(setVsyncEnabled, void(PhysicalDisplayId, hal::Vsync)); MOCK_CONST_METHOD1(getRefreshTimestamp, nsecs_t(PhysicalDisplayId)); MOCK_CONST_METHOD1(isConnected, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(isConnected, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(getModes, DisplayModes(PhysicalDisplayId)); MOCK_CONST_METHOD1(getModes, std::vector<HWComposer::HWCDisplayMode>(PhysicalDisplayId)); MOCK_CONST_METHOD1(getActiveMode, DisplayModePtr(PhysicalDisplayId)); MOCK_CONST_METHOD1(getActiveMode, std::optional<hal::HWConfigId>(PhysicalDisplayId)); MOCK_CONST_METHOD1(getColorModes, std::vector<ui::ColorMode>(PhysicalDisplayId)); MOCK_CONST_METHOD1(getColorModes, std::vector<ui::ColorMode>(PhysicalDisplayId)); MOCK_METHOD3(setActiveColorMode, status_t(PhysicalDisplayId, ui::ColorMode, ui::RenderIntent)); MOCK_METHOD3(setActiveColorMode, status_t(PhysicalDisplayId, ui::ColorMode, ui::RenderIntent)); MOCK_CONST_METHOD0(isUsingVrComposer, bool()); MOCK_CONST_METHOD0(isUsingVrComposer, bool()); MOCK_CONST_METHOD1(getDisplayConnectionType, DisplayConnectionType(PhysicalDisplayId)); MOCK_CONST_METHOD1(getDisplayConnectionType, DisplayConnectionType(PhysicalDisplayId)); MOCK_CONST_METHOD1(isVsyncPeriodSwitchSupported, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(isVsyncPeriodSwitchSupported, bool(PhysicalDisplayId)); MOCK_CONST_METHOD1(getDisplayVsyncPeriod, nsecs_t(PhysicalDisplayId)); MOCK_CONST_METHOD2(getDisplayVsyncPeriod, status_t(PhysicalDisplayId, nsecs_t*)); MOCK_METHOD4(setActiveModeWithConstraints, MOCK_METHOD4(setActiveModeWithConstraints, status_t(PhysicalDisplayId, hal::HWConfigId, status_t(PhysicalDisplayId, hal::HWConfigId, const hal::VsyncPeriodChangeConstraints&, const hal::VsyncPeriodChangeConstraints&, Loading