Loading graphics/composer/2.3/IComposerClient.hal +49 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,42 @@ import @2.1::Error; interface IComposerClient extends @2.2::IComposerClient { // TODO: Move this enum to LLNDK after we decide where to put graphic types. /** * Required capabilities which are supported by the display. The * particular set of supported capabilities for a given display may be * retrieved using getDisplayCapabilities. */ enum DisplayCapability : uint32_t { INVALID = 0, /** * Specifies that the display must a color transform even when * either the client or the device has chosen that all layers should * be composed by the client. This prevents the client from applying * the color transform during its composition step. * If getDisplayCapabilities is supported, the global capability * SKIP_CLIENT_COLOR_TRANSFORM is ignored. * If getDisplayCapabilities is not supported, and the global capability * SKIP_CLIENT_COLOR_TRANSFORM is returned by getCapabilities, * then all displays must be treated as having * SKIP_CLIENT_COLOR_TRANSFORM. */ SKIP_CLIENT_COLOR_TRANSFORM = 1, /** * Specifies that the display supports PowerMode::DOZE and * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit * over DOZE (see the definition of PowerMode for more information), * but if both DOZE and DOZE_SUSPEND are no different from * PowerMode::ON, the device must not claim support. * Must be returned by getDisplayCapabilities when getDozeSupport * indicates the display supports PowerMode::DOZE and * PowerMode::DOZE_SUSPEND. */ DOZE = 2, }; enum Command : @2.2::IComposerClient.Command { /** * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype Loading Loading @@ -350,4 +386,17 @@ interface IComposerClient extends @2.2::IComposerClient { */ setColorMode_2_3(Display display, ColorMode mode, RenderIntent intent) generates (Error error); /** * Provides a list of supported capabilities (as described in the * definition of DisplayCapability above). This list must not change after * initialization. * * @return error is NONE upon success. Otherwise, * BAD_DISPLAY when an invalid display handle was passed in. * @return capabilities is a list of supported capabilities. */ getDisplayCapabilities(Display display) generates (Error error, vec<DisplayCapability> capabilities); }; graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerClient.h +8 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,14 @@ class ComposerClientImpl : public V2_2::hal::detail::ComposerClientImpl<Interfac return err; } Return<void> getDisplayCapabilities( Display display, IComposerClient::getDisplayCapabilities_cb hidl_cb) override { hidl_vec<IComposerClient::DisplayCapability> capabilities; Error error = mHal->getDisplayCapabilities(display, &capabilities); hidl_cb(error, capabilities); return Void(); } static std::unique_ptr<ComposerClientImpl> create(Hal* hal) { auto client = std::make_unique<ComposerClientImpl>(hal); return client->init() ? std::move(client) : nullptr; Loading graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerHal.h +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ class ComposerHal : public V2_2::hal::ComposerHal { hidl_vec<uint64_t>& sampleComponent1, hidl_vec<uint64_t>& sampleComponent2, hidl_vec<uint64_t>& sampleComponent3) = 0; virtual Error getDisplayCapabilities( Display display, hidl_vec<IComposerClient::DisplayCapability>* outCapabilities) = 0; }; } // namespace hal Loading graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h +26 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,29 @@ class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> { return static_cast<Error>(errorRaw); } Error getDisplayCapabilities( Display display, hidl_vec<IComposerClient::DisplayCapability>* outCapabilities) override { if (!mDispatch.getDisplayCapabilities) { return Error::UNSUPPORTED; } uint32_t count = 0; int32_t error = mDispatch.getDisplayCapabilities(mDevice, display, &count, nullptr); if (error != HWC2_ERROR_NONE) { return static_cast<Error>(error); } outCapabilities->resize(count); error = mDispatch.getDisplayCapabilities( mDevice, display, &count, reinterpret_cast<std::underlying_type<IComposerClient::DisplayCapability>::type*>( outCapabilities->data())); if (error != HWC2_ERROR_NONE) { *outCapabilities = hidl_vec<IComposerClient::DisplayCapability>(); return static_cast<Error>(error); } return Error::NONE; } protected: bool initDispatch() override { if (!BaseType2_2::initDispatch()) { Loading @@ -179,6 +202,8 @@ class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> { &mDispatch.setDisplayedContentSamplingEnabled); this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLE, &mDispatch.getDisplayedContentSample); this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_CAPABILITIES, &mDispatch.getDisplayCapabilities); return true; } Loading @@ -189,6 +214,7 @@ class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> { HWC2_PFN_GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES getDisplayedContentSamplingAttributes; HWC2_PFN_SET_DISPLAYED_CONTENT_SAMPLING_ENABLED setDisplayedContentSamplingEnabled; HWC2_PFN_GET_DISPLAYED_CONTENT_SAMPLE getDisplayedContentSample; HWC2_PFN_GET_DISPLAY_CAPABILITIES getDisplayCapabilities; } mDispatch = {}; using BaseType2_2 = V2_2::passthrough::detail::HwcHalImpl<Hal>; Loading graphics/composer/2.3/utils/vts/ComposerVts.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,15 @@ Error ComposerClient::getDisplayedContentSample(uint64_t display, uint64_t maxFr return error; } std::vector<IComposerClient::DisplayCapability> ComposerClient::getDisplayCapabilities( Display display) { std::vector<IComposerClient::DisplayCapability> capabilities; mClient->getDisplayCapabilities( display, [&](const auto&, const auto& tmpCapabilities) { capabilities = tmpCapabilities; }); return capabilities; } } // namespace vts } // namespace V2_3 } // namespace composer Loading Loading
graphics/composer/2.3/IComposerClient.hal +49 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,42 @@ import @2.1::Error; interface IComposerClient extends @2.2::IComposerClient { // TODO: Move this enum to LLNDK after we decide where to put graphic types. /** * Required capabilities which are supported by the display. The * particular set of supported capabilities for a given display may be * retrieved using getDisplayCapabilities. */ enum DisplayCapability : uint32_t { INVALID = 0, /** * Specifies that the display must a color transform even when * either the client or the device has chosen that all layers should * be composed by the client. This prevents the client from applying * the color transform during its composition step. * If getDisplayCapabilities is supported, the global capability * SKIP_CLIENT_COLOR_TRANSFORM is ignored. * If getDisplayCapabilities is not supported, and the global capability * SKIP_CLIENT_COLOR_TRANSFORM is returned by getCapabilities, * then all displays must be treated as having * SKIP_CLIENT_COLOR_TRANSFORM. */ SKIP_CLIENT_COLOR_TRANSFORM = 1, /** * Specifies that the display supports PowerMode::DOZE and * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit * over DOZE (see the definition of PowerMode for more information), * but if both DOZE and DOZE_SUSPEND are no different from * PowerMode::ON, the device must not claim support. * Must be returned by getDisplayCapabilities when getDozeSupport * indicates the display supports PowerMode::DOZE and * PowerMode::DOZE_SUSPEND. */ DOZE = 2, }; enum Command : @2.2::IComposerClient.Command { /** * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype Loading Loading @@ -350,4 +386,17 @@ interface IComposerClient extends @2.2::IComposerClient { */ setColorMode_2_3(Display display, ColorMode mode, RenderIntent intent) generates (Error error); /** * Provides a list of supported capabilities (as described in the * definition of DisplayCapability above). This list must not change after * initialization. * * @return error is NONE upon success. Otherwise, * BAD_DISPLAY when an invalid display handle was passed in. * @return capabilities is a list of supported capabilities. */ getDisplayCapabilities(Display display) generates (Error error, vec<DisplayCapability> capabilities); };
graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerClient.h +8 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,14 @@ class ComposerClientImpl : public V2_2::hal::detail::ComposerClientImpl<Interfac return err; } Return<void> getDisplayCapabilities( Display display, IComposerClient::getDisplayCapabilities_cb hidl_cb) override { hidl_vec<IComposerClient::DisplayCapability> capabilities; Error error = mHal->getDisplayCapabilities(display, &capabilities); hidl_cb(error, capabilities); return Void(); } static std::unique_ptr<ComposerClientImpl> create(Hal* hal) { auto client = std::make_unique<ComposerClientImpl>(hal); return client->init() ? std::move(client) : nullptr; Loading
graphics/composer/2.3/utils/hal/include/composer-hal/2.3/ComposerHal.h +2 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ class ComposerHal : public V2_2::hal::ComposerHal { hidl_vec<uint64_t>& sampleComponent1, hidl_vec<uint64_t>& sampleComponent2, hidl_vec<uint64_t>& sampleComponent3) = 0; virtual Error getDisplayCapabilities( Display display, hidl_vec<IComposerClient::DisplayCapability>* outCapabilities) = 0; }; } // namespace hal Loading
graphics/composer/2.3/utils/passthrough/include/composer-passthrough/2.3/HwcHal.h +26 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,29 @@ class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> { return static_cast<Error>(errorRaw); } Error getDisplayCapabilities( Display display, hidl_vec<IComposerClient::DisplayCapability>* outCapabilities) override { if (!mDispatch.getDisplayCapabilities) { return Error::UNSUPPORTED; } uint32_t count = 0; int32_t error = mDispatch.getDisplayCapabilities(mDevice, display, &count, nullptr); if (error != HWC2_ERROR_NONE) { return static_cast<Error>(error); } outCapabilities->resize(count); error = mDispatch.getDisplayCapabilities( mDevice, display, &count, reinterpret_cast<std::underlying_type<IComposerClient::DisplayCapability>::type*>( outCapabilities->data())); if (error != HWC2_ERROR_NONE) { *outCapabilities = hidl_vec<IComposerClient::DisplayCapability>(); return static_cast<Error>(error); } return Error::NONE; } protected: bool initDispatch() override { if (!BaseType2_2::initDispatch()) { Loading @@ -179,6 +202,8 @@ class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> { &mDispatch.setDisplayedContentSamplingEnabled); this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAYED_CONTENT_SAMPLE, &mDispatch.getDisplayedContentSample); this->initOptionalDispatch(HWC2_FUNCTION_GET_DISPLAY_CAPABILITIES, &mDispatch.getDisplayCapabilities); return true; } Loading @@ -189,6 +214,7 @@ class HwcHalImpl : public V2_2::passthrough::detail::HwcHalImpl<Hal> { HWC2_PFN_GET_DISPLAYED_CONTENT_SAMPLING_ATTRIBUTES getDisplayedContentSamplingAttributes; HWC2_PFN_SET_DISPLAYED_CONTENT_SAMPLING_ENABLED setDisplayedContentSamplingEnabled; HWC2_PFN_GET_DISPLAYED_CONTENT_SAMPLE getDisplayedContentSample; HWC2_PFN_GET_DISPLAY_CAPABILITIES getDisplayCapabilities; } mDispatch = {}; using BaseType2_2 = V2_2::passthrough::detail::HwcHalImpl<Hal>; Loading
graphics/composer/2.3/utils/vts/ComposerVts.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,15 @@ Error ComposerClient::getDisplayedContentSample(uint64_t display, uint64_t maxFr return error; } std::vector<IComposerClient::DisplayCapability> ComposerClient::getDisplayCapabilities( Display display) { std::vector<IComposerClient::DisplayCapability> capabilities; mClient->getDisplayCapabilities( display, [&](const auto&, const auto& tmpCapabilities) { capabilities = tmpCapabilities; }); return capabilities; } } // namespace vts } // namespace V2_3 } // namespace composer Loading