Loading graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h +7 −1 Original line number Diff line number Diff line Loading @@ -626,9 +626,15 @@ class CommandReaderBase { } protected: template <typename T> bool beginCommand(T* outCommand, uint16_t* outLength) { return beginCommandBase(reinterpret_cast<IComposerClient::Command*>(outCommand), outLength); } bool isEmpty() const { return (mDataRead >= mDataSize); } bool beginCommand(IComposerClient::Command* outCommand, uint16_t* outLength) { bool beginCommandBase(IComposerClient::Command* outCommand, uint16_t* outLength) { if (mCommandEnd) { LOG_FATAL("endCommand was not called for last command"); } Loading graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h +21 −30 Original line number Diff line number Diff line Loading @@ -146,6 +146,25 @@ class ComposerCommandEngine : protected CommandReaderBase { return std::make_unique<CommandWriterBase>(writerInitialSize); } virtual Error executeValidateDisplayInternal() { std::vector<Layer> changedLayers; std::vector<IComposerClient::Composition> compositionTypes; uint32_t displayRequestMask = 0x0; std::vector<Layer> requestedLayers; std::vector<uint32_t> requestMasks; auto err = mHal->validateDisplay(mCurrentDisplay, &changedLayers, &compositionTypes, &displayRequestMask, &requestedLayers, &requestMasks); mResources->setDisplayMustValidateState(mCurrentDisplay, false); if (err == Error::NONE) { mWriter->setChangedCompositionTypes(changedLayers, compositionTypes); mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks); } else { mWriter->setError(getCommandLoc(), err); } return err; } bool executeSelectDisplay(uint16_t length) { if (length != CommandWriterBase::kSelectDisplayLength) { return false; Loading Loading @@ -255,23 +274,7 @@ class ComposerCommandEngine : protected CommandReaderBase { if (length != CommandWriterBase::kValidateDisplayLength) { return false; } std::vector<Layer> changedLayers; std::vector<IComposerClient::Composition> compositionTypes; uint32_t displayRequestMask = 0x0; std::vector<Layer> requestedLayers; std::vector<uint32_t> requestMasks; auto err = mHal->validateDisplay(mCurrentDisplay, &changedLayers, &compositionTypes, &displayRequestMask, &requestedLayers, &requestMasks); mResources->setDisplayMustValidateState(mCurrentDisplay, false); if (err == Error::NONE) { mWriter->setChangedCompositionTypes(changedLayers, compositionTypes); mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks); } else { mWriter->setError(getCommandLoc(), err); } executeValidateDisplayInternal(); return true; } Loading @@ -297,21 +300,9 @@ class ComposerCommandEngine : protected CommandReaderBase { } // Present has failed. We need to fallback to validate std::vector<Layer> changedLayers; std::vector<IComposerClient::Composition> compositionTypes; uint32_t displayRequestMask = 0x0; std::vector<Layer> requestedLayers; std::vector<uint32_t> requestMasks; auto err = mHal->validateDisplay(mCurrentDisplay, &changedLayers, &compositionTypes, &displayRequestMask, &requestedLayers, &requestMasks); mResources->setDisplayMustValidateState(mCurrentDisplay, false); auto err = executeValidateDisplayInternal(); if (err == Error::NONE) { mWriter->setPresentOrValidateResult(0); mWriter->setChangedCompositionTypes(changedLayers, compositionTypes); mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks); } else { mWriter->setError(getCommandLoc(), err); } return true; Loading graphics/composer/2.4/IComposerClient.hal +22 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.hardware.graphics.composer@2.4; import android.hardware.graphics.common@1.2::PixelFormat; import android.hardware.graphics.common@1.2::Dataspace; import android.hardware.graphics.composer@2.1::IComposerClient.Command; import IComposerCallback; import @2.1::Config; import @2.1::Display; Loading Loading @@ -56,6 +59,20 @@ interface IComposerClient extends @2.3::IComposerClient { AUTO_LOW_LATENCY_MODE = 5, }; enum Command : @2.3::IComposerClient.Command { /** * SET_CLIENT_TARGET_PROPERTY has this pseudo prototype * * This command has the following binary layout in bytes: * * 0 - 3: clientTargetProperty.pixelFormat * 4 - 7: clientTargetProperty.dataspace * * setClientTargetProperty(ClientTargetProperty clientTargetProperty); */ SET_CLIENT_TARGET_PROPERTY = 0x105 << @2.1::IComposerClient.Command:OPCODE_SHIFT, }; /** * Supersedes {@link @2.1::IComposerClient.DisplayType}. */ Loading Loading @@ -99,6 +116,11 @@ interface IComposerClient extends @2.3::IComposerClient { bool seamlessRequired; }; struct ClientTargetProperty { PixelFormat pixelFormat; Dataspace dataspace; }; /** * Provides a IComposerCallback object for the device to call. * Loading graphics/composer/2.4/utils/command-buffer/include/composer-command-buffer/2.4/ComposerCommandBuffer.h +12 −1 Original line number Diff line number Diff line Loading @@ -41,14 +41,25 @@ using android::hardware::graphics::composer::V2_4::IComposerClient; // units of uint32_t's. class CommandWriterBase : public V2_3::CommandWriterBase { public: static constexpr uint16_t kSetClientTargetPropertyLength = 2; CommandWriterBase(uint32_t initialMaxSize) : V2_3::CommandWriterBase(initialMaxSize) {} void setClientTargetProperty( const IComposerClient::ClientTargetProperty& clientTargetProperty) { beginCommand(IComposerClient::Command::SET_CLIENT_TARGET_PROPERTY, kSetClientTargetPropertyLength); writeSigned(static_cast<int32_t>(clientTargetProperty.pixelFormat)); writeSigned(static_cast<int32_t>(clientTargetProperty.dataspace)); endCommand(); } }; // This class helps parse a command queue. Note that all sizes/lengths are in // units of uint32_t's. class CommandReaderBase : public V2_3::CommandReaderBase { public: CommandReaderBase() : V2_3::CommandReaderBase(){}; CommandReaderBase() : V2_3::CommandReaderBase() {} }; } // namespace V2_4 Loading graphics/composer/2.4/utils/hal/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -26,11 +26,11 @@ cc_library_headers { ], header_libs: [ "android.hardware.graphics.composer@2.3-hal", "android.hardware.graphics.composer@2.3-command-buffer", "android.hardware.graphics.composer@2.4-command-buffer", ], export_header_lib_headers: [ "android.hardware.graphics.composer@2.3-hal", "android.hardware.graphics.composer@2.3-command-buffer", "android.hardware.graphics.composer@2.4-command-buffer", ], export_include_dirs: ["include"], } Loading
graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h +7 −1 Original line number Diff line number Diff line Loading @@ -626,9 +626,15 @@ class CommandReaderBase { } protected: template <typename T> bool beginCommand(T* outCommand, uint16_t* outLength) { return beginCommandBase(reinterpret_cast<IComposerClient::Command*>(outCommand), outLength); } bool isEmpty() const { return (mDataRead >= mDataSize); } bool beginCommand(IComposerClient::Command* outCommand, uint16_t* outLength) { bool beginCommandBase(IComposerClient::Command* outCommand, uint16_t* outLength) { if (mCommandEnd) { LOG_FATAL("endCommand was not called for last command"); } Loading
graphics/composer/2.1/utils/hal/include/composer-hal/2.1/ComposerCommandEngine.h +21 −30 Original line number Diff line number Diff line Loading @@ -146,6 +146,25 @@ class ComposerCommandEngine : protected CommandReaderBase { return std::make_unique<CommandWriterBase>(writerInitialSize); } virtual Error executeValidateDisplayInternal() { std::vector<Layer> changedLayers; std::vector<IComposerClient::Composition> compositionTypes; uint32_t displayRequestMask = 0x0; std::vector<Layer> requestedLayers; std::vector<uint32_t> requestMasks; auto err = mHal->validateDisplay(mCurrentDisplay, &changedLayers, &compositionTypes, &displayRequestMask, &requestedLayers, &requestMasks); mResources->setDisplayMustValidateState(mCurrentDisplay, false); if (err == Error::NONE) { mWriter->setChangedCompositionTypes(changedLayers, compositionTypes); mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks); } else { mWriter->setError(getCommandLoc(), err); } return err; } bool executeSelectDisplay(uint16_t length) { if (length != CommandWriterBase::kSelectDisplayLength) { return false; Loading Loading @@ -255,23 +274,7 @@ class ComposerCommandEngine : protected CommandReaderBase { if (length != CommandWriterBase::kValidateDisplayLength) { return false; } std::vector<Layer> changedLayers; std::vector<IComposerClient::Composition> compositionTypes; uint32_t displayRequestMask = 0x0; std::vector<Layer> requestedLayers; std::vector<uint32_t> requestMasks; auto err = mHal->validateDisplay(mCurrentDisplay, &changedLayers, &compositionTypes, &displayRequestMask, &requestedLayers, &requestMasks); mResources->setDisplayMustValidateState(mCurrentDisplay, false); if (err == Error::NONE) { mWriter->setChangedCompositionTypes(changedLayers, compositionTypes); mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks); } else { mWriter->setError(getCommandLoc(), err); } executeValidateDisplayInternal(); return true; } Loading @@ -297,21 +300,9 @@ class ComposerCommandEngine : protected CommandReaderBase { } // Present has failed. We need to fallback to validate std::vector<Layer> changedLayers; std::vector<IComposerClient::Composition> compositionTypes; uint32_t displayRequestMask = 0x0; std::vector<Layer> requestedLayers; std::vector<uint32_t> requestMasks; auto err = mHal->validateDisplay(mCurrentDisplay, &changedLayers, &compositionTypes, &displayRequestMask, &requestedLayers, &requestMasks); mResources->setDisplayMustValidateState(mCurrentDisplay, false); auto err = executeValidateDisplayInternal(); if (err == Error::NONE) { mWriter->setPresentOrValidateResult(0); mWriter->setChangedCompositionTypes(changedLayers, compositionTypes); mWriter->setDisplayRequests(displayRequestMask, requestedLayers, requestMasks); } else { mWriter->setError(getCommandLoc(), err); } return true; Loading
graphics/composer/2.4/IComposerClient.hal +22 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.hardware.graphics.composer@2.4; import android.hardware.graphics.common@1.2::PixelFormat; import android.hardware.graphics.common@1.2::Dataspace; import android.hardware.graphics.composer@2.1::IComposerClient.Command; import IComposerCallback; import @2.1::Config; import @2.1::Display; Loading Loading @@ -56,6 +59,20 @@ interface IComposerClient extends @2.3::IComposerClient { AUTO_LOW_LATENCY_MODE = 5, }; enum Command : @2.3::IComposerClient.Command { /** * SET_CLIENT_TARGET_PROPERTY has this pseudo prototype * * This command has the following binary layout in bytes: * * 0 - 3: clientTargetProperty.pixelFormat * 4 - 7: clientTargetProperty.dataspace * * setClientTargetProperty(ClientTargetProperty clientTargetProperty); */ SET_CLIENT_TARGET_PROPERTY = 0x105 << @2.1::IComposerClient.Command:OPCODE_SHIFT, }; /** * Supersedes {@link @2.1::IComposerClient.DisplayType}. */ Loading Loading @@ -99,6 +116,11 @@ interface IComposerClient extends @2.3::IComposerClient { bool seamlessRequired; }; struct ClientTargetProperty { PixelFormat pixelFormat; Dataspace dataspace; }; /** * Provides a IComposerCallback object for the device to call. * Loading
graphics/composer/2.4/utils/command-buffer/include/composer-command-buffer/2.4/ComposerCommandBuffer.h +12 −1 Original line number Diff line number Diff line Loading @@ -41,14 +41,25 @@ using android::hardware::graphics::composer::V2_4::IComposerClient; // units of uint32_t's. class CommandWriterBase : public V2_3::CommandWriterBase { public: static constexpr uint16_t kSetClientTargetPropertyLength = 2; CommandWriterBase(uint32_t initialMaxSize) : V2_3::CommandWriterBase(initialMaxSize) {} void setClientTargetProperty( const IComposerClient::ClientTargetProperty& clientTargetProperty) { beginCommand(IComposerClient::Command::SET_CLIENT_TARGET_PROPERTY, kSetClientTargetPropertyLength); writeSigned(static_cast<int32_t>(clientTargetProperty.pixelFormat)); writeSigned(static_cast<int32_t>(clientTargetProperty.dataspace)); endCommand(); } }; // This class helps parse a command queue. Note that all sizes/lengths are in // units of uint32_t's. class CommandReaderBase : public V2_3::CommandReaderBase { public: CommandReaderBase() : V2_3::CommandReaderBase(){}; CommandReaderBase() : V2_3::CommandReaderBase() {} }; } // namespace V2_4 Loading
graphics/composer/2.4/utils/hal/Android.bp +2 −2 Original line number Diff line number Diff line Loading @@ -26,11 +26,11 @@ cc_library_headers { ], header_libs: [ "android.hardware.graphics.composer@2.3-hal", "android.hardware.graphics.composer@2.3-command-buffer", "android.hardware.graphics.composer@2.4-command-buffer", ], export_header_lib_headers: [ "android.hardware.graphics.composer@2.3-hal", "android.hardware.graphics.composer@2.3-command-buffer", "android.hardware.graphics.composer@2.4-command-buffer", ], export_include_dirs: ["include"], }