Loading services/surfaceflinger/DisplayHardware/ComposerHal.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,10 @@ void Composer::resetCommands() { mWriter.reset(); } Error Composer::executeCommands() { return execute(); } uint32_t Composer::getMaxVirtualDisplayCount() { auto ret = mClient->getMaxVirtualDisplayCount(); Loading Loading @@ -750,6 +754,11 @@ Error Composer::execute() } } if (commandLength == 0) { mWriter.reset(); return Error::NONE; } Error error = kDefaultError; auto ret = mClient->executeCommands(commandLength, commandHandles, [&](const auto& tmpError, const auto& tmpOutChanged, Loading services/surfaceflinger/DisplayHardware/ComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,9 @@ public: // skip a frame but have already queued some commands. void resetCommands(); // Explicitly flush all pending commands in the command buffer. Error executeCommands(); uint32_t getMaxVirtualDisplayCount(); bool isUsingVrComposer() const { return mIsUsingVrComposer; } Error createVirtualDisplay(uint32_t width, uint32_t height, Loading services/surfaceflinger/DisplayHardware/HWC2.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -221,6 +221,11 @@ void Device::loadCapabilities() } } Error Device::flushCommands() { return static_cast<Error>(mComposer->executeCommands()); } // Display methods Display::Display(android::Hwc2::Composer& composer, Loading Loading @@ -632,11 +637,6 @@ Error Display::presentOrValidate(uint32_t* outNumTypes, uint32_t* outNumRequests return error; } void Display::discardCommands() { mComposer.resetCommands(); } // For use by Device void Display::setConnected(bool connected) { Loading services/surfaceflinger/DisplayHardware/HWC2.h +5 −6 Original line number Diff line number Diff line Loading @@ -106,6 +106,11 @@ public: android::Hwc2::Composer* getComposer() { return mComposer.get(); } // We buffer most state changes and flush them implicitly with // Display::validate, Display::present, and Display::presentOrValidate. // This method provides an explicit way to flush state changes to HWC. Error flushCommands(); private: // Initialization methods Loading Loading @@ -244,12 +249,6 @@ public: uint32_t* outNumRequests, android::sp<android::Fence>* outPresentFence, uint32_t* state); // Most methods in this class write a command to a command buffer. The // command buffer is implicitly submitted in validate, present, and // presentOrValidate. This method provides a way to discard the commands, // which can be used to discard stale commands. void discardCommands(); // Other Display methods hwc2_display_t getId() const { return mId; } Loading services/surfaceflinger/DisplayHardware/HWComposer.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -605,8 +605,11 @@ status_t HWComposer::presentAndGetReleaseFences(int32_t displayId) { auto& hwcDisplay = displayData.hwcDisplay; if (displayData.validateWasSkipped) { hwcDisplay->discardCommands(); auto error = displayData.presentError; // explicitly flush all pending commands auto error = mHwcDevice->flushCommands(); if (displayData.presentError != HWC2::Error::None) { error = displayData.presentError; } if (error != HWC2::Error::None) { ALOGE("skipValidate: failed for display %d: %s (%d)", displayId, to_string(error).c_str(), static_cast<int32_t>(error)); Loading Loading
services/surfaceflinger/DisplayHardware/ComposerHal.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,10 @@ void Composer::resetCommands() { mWriter.reset(); } Error Composer::executeCommands() { return execute(); } uint32_t Composer::getMaxVirtualDisplayCount() { auto ret = mClient->getMaxVirtualDisplayCount(); Loading Loading @@ -750,6 +754,11 @@ Error Composer::execute() } } if (commandLength == 0) { mWriter.reset(); return Error::NONE; } Error error = kDefaultError; auto ret = mClient->executeCommands(commandLength, commandHandles, [&](const auto& tmpError, const auto& tmpOutChanged, Loading
services/surfaceflinger/DisplayHardware/ComposerHal.h +3 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,9 @@ public: // skip a frame but have already queued some commands. void resetCommands(); // Explicitly flush all pending commands in the command buffer. Error executeCommands(); uint32_t getMaxVirtualDisplayCount(); bool isUsingVrComposer() const { return mIsUsingVrComposer; } Error createVirtualDisplay(uint32_t width, uint32_t height, Loading
services/surfaceflinger/DisplayHardware/HWC2.cpp +5 −5 Original line number Diff line number Diff line Loading @@ -221,6 +221,11 @@ void Device::loadCapabilities() } } Error Device::flushCommands() { return static_cast<Error>(mComposer->executeCommands()); } // Display methods Display::Display(android::Hwc2::Composer& composer, Loading Loading @@ -632,11 +637,6 @@ Error Display::presentOrValidate(uint32_t* outNumTypes, uint32_t* outNumRequests return error; } void Display::discardCommands() { mComposer.resetCommands(); } // For use by Device void Display::setConnected(bool connected) { Loading
services/surfaceflinger/DisplayHardware/HWC2.h +5 −6 Original line number Diff line number Diff line Loading @@ -106,6 +106,11 @@ public: android::Hwc2::Composer* getComposer() { return mComposer.get(); } // We buffer most state changes and flush them implicitly with // Display::validate, Display::present, and Display::presentOrValidate. // This method provides an explicit way to flush state changes to HWC. Error flushCommands(); private: // Initialization methods Loading Loading @@ -244,12 +249,6 @@ public: uint32_t* outNumRequests, android::sp<android::Fence>* outPresentFence, uint32_t* state); // Most methods in this class write a command to a command buffer. The // command buffer is implicitly submitted in validate, present, and // presentOrValidate. This method provides a way to discard the commands, // which can be used to discard stale commands. void discardCommands(); // Other Display methods hwc2_display_t getId() const { return mId; } Loading
services/surfaceflinger/DisplayHardware/HWComposer.cpp +5 −2 Original line number Diff line number Diff line Loading @@ -605,8 +605,11 @@ status_t HWComposer::presentAndGetReleaseFences(int32_t displayId) { auto& hwcDisplay = displayData.hwcDisplay; if (displayData.validateWasSkipped) { hwcDisplay->discardCommands(); auto error = displayData.presentError; // explicitly flush all pending commands auto error = mHwcDevice->flushCommands(); if (displayData.presentError != HWC2::Error::None) { error = displayData.presentError; } if (error != HWC2::Error::None) { ALOGE("skipValidate: failed for display %d: %s (%d)", displayId, to_string(error).c_str(), static_cast<int32_t>(error)); Loading