diff options
Diffstat (limited to 'hwc3/ComposerCommandEngine.cpp')
-rw-r--r-- | hwc3/ComposerCommandEngine.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/hwc3/ComposerCommandEngine.cpp b/hwc3/ComposerCommandEngine.cpp index eac4df2..32ad027 100644 --- a/hwc3/ComposerCommandEngine.cpp +++ b/hwc3/ComposerCommandEngine.cpp @@ -51,11 +51,11 @@ namespace aidl::android::hardware::graphics::composer3::impl { } \ } while (0) -#define DISPATCH_DISPLAY_BOOL_COMMAND_AND_DATA(displayCmd, field, data, funcName) \ - do { \ - if (displayCmd.field) { \ - execute##funcName(displayCmd.display, displayCmd.data); \ - } \ +#define DISPATCH_DISPLAY_COMMAND_AND_TWO_DATA(displayCmd, field, data_1, data_2, funcName) \ + do { \ + if (displayCmd.field) { \ + execute##funcName(displayCmd.display, displayCmd.data_1, displayCmd.data_2); \ + } \ } while (0) int32_t ComposerCommandEngine::init() { @@ -104,12 +104,12 @@ void ComposerCommandEngine::dispatchDisplayCommand(const DisplayCommand& command DISPATCH_DISPLAY_COMMAND(command, colorTransformMatrix, SetColorTransform); DISPATCH_DISPLAY_COMMAND(command, clientTarget, SetClientTarget); DISPATCH_DISPLAY_COMMAND(command, virtualDisplayOutputBuffer, SetOutputBuffer); - DISPATCH_DISPLAY_BOOL_COMMAND_AND_DATA(command, validateDisplay, expectedPresentTime, - ValidateDisplay); + DISPATCH_DISPLAY_COMMAND_AND_TWO_DATA(command, validateDisplay, expectedPresentTime, + frameIntervalNs, ValidateDisplay); DISPATCH_DISPLAY_BOOL_COMMAND(command, acceptDisplayChanges, AcceptDisplayChanges); DISPATCH_DISPLAY_BOOL_COMMAND(command, presentDisplay, PresentDisplay); - DISPATCH_DISPLAY_BOOL_COMMAND_AND_DATA(command, presentOrValidateDisplay, expectedPresentTime, - PresentOrValidateDisplay); + DISPATCH_DISPLAY_COMMAND_AND_TWO_DATA(command, presentOrValidateDisplay, expectedPresentTime, + frameIntervalNs, PresentOrValidateDisplay); } void ComposerCommandEngine::dispatchLayerCommand(int64_t display, const LayerCommand& command) { @@ -213,13 +213,15 @@ void ComposerCommandEngine::executeSetOutputBuffer(uint64_t display, const Buffe } void ComposerCommandEngine::executeSetExpectedPresentTimeInternal( - int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime) { - mHal->setExpectedPresentTime(display, expectedPresentTime); + int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime, + int frameIntervalNs) { + mHal->setExpectedPresentTime(display, expectedPresentTime, frameIntervalNs); } void ComposerCommandEngine::executeValidateDisplay( - int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime) { - executeSetExpectedPresentTimeInternal(display, expectedPresentTime); + int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime, + int frameIntervalNs) { + executeSetExpectedPresentTimeInternal(display, expectedPresentTime, frameIntervalNs); executeValidateDisplayInternal(display); } @@ -233,8 +235,9 @@ void ComposerCommandEngine::executeSetDisplayBrightness(uint64_t display, } void ComposerCommandEngine::executePresentOrValidateDisplay( - int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime) { - executeSetExpectedPresentTimeInternal(display, expectedPresentTime); + int64_t display, const std::optional<ClockMonotonicTimestamp> expectedPresentTime, + int frameIntervalNs) { + executeSetExpectedPresentTimeInternal(display, expectedPresentTime, frameIntervalNs); // First try to Present as is. auto presentErr = mResources->mustValidateDisplay(display) ? IComposerClient::EX_NOT_VALIDATED : executePresentDisplay(display); |