diff options
author | Leon Scroggins <scroggo@google.com> | 2022-02-10 11:56:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-02-10 11:56:31 +0000 |
commit | 2e38a44a77e2cf645b7605e5514f8fdae62b137c (patch) | |
tree | 8587985176f93817704428bffe14f602733fdb0b | |
parent | 0b21789279bc1d261e12523d42f0d59f6d3754b1 (diff) | |
parent | 51f511d13360453d08489b812e9b46cecafe4151 (diff) |
Merge "hwc: Implement getDisplayDecorationSupport"
-rw-r--r-- | hwc3/ComposerClient.cpp | 28 | ||||
-rw-r--r-- | hwc3/ComposerClient.h | 6 |
2 files changed, 24 insertions, 10 deletions
diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp index 96d5f58..848d1f7 100644 --- a/hwc3/ComposerClient.cpp +++ b/hwc3/ComposerClient.cpp @@ -162,15 +162,6 @@ ndk::ScopedAStatus ComposerClient::getDisplayCapabilities(int64_t display, return TO_BINDER_STATUS(err); } - bool support = false; - err = mHal->getRCDLayerSupport(display, support); - if (err != ::android::OK) { - LOG(ERROR) << "failed to getRCDLayerSupport: " << err; - } - if (support) { - caps->push_back(DisplayCapability::DISPLAY_DECORATION); - } - return TO_BINDER_STATUS(err); } @@ -276,6 +267,25 @@ ndk::ScopedAStatus ComposerClient::getSupportedContentTypes(int64_t display, return TO_BINDER_STATUS(err); } +ndk::ScopedAStatus ComposerClient::getDisplayDecorationSupport( + int64_t display, std::optional<common::DisplayDecorationSupport>* supportStruct) { + DEBUG_FUNC(); + bool support = false; + auto err = mHal->getRCDLayerSupport(display, support); + if (err != ::android::OK) { + LOG(ERROR) << "failed to getRCDLayerSupport: " << err; + } + if (support) { + // TODO (b/218499393): determine from mHal instead of hard coding. + auto& s = supportStruct->emplace(); + s.format = common::PixelFormat::R_8; + s.alphaInterpretation = common::AlphaInterpretation::COVERAGE; + } else { + supportStruct->reset(); + } + return TO_BINDER_STATUS(err); +} + ndk::ScopedAStatus ComposerClient::registerCallback( const std::shared_ptr<IComposerCallback>& callback) { DEBUG_FUNC(); diff --git a/hwc3/ComposerClient.h b/hwc3/ComposerClient.h index e8ec8e1..855fb8b 100644 --- a/hwc3/ComposerClient.h +++ b/hwc3/ComposerClient.h @@ -16,10 +16,12 @@ #pragma once +#include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> #include <aidl/android/hardware/graphics/composer3/BnComposerClient.h> -#include <memory> #include <utils/Mutex.h> +#include <memory> + #include "ComposerCommandEngine.h" #include "include/IComposerHal.h" #include "include/IResourceManager.h" @@ -101,6 +103,8 @@ public: std::vector<RenderIntent>* intents) override; ndk::ScopedAStatus getSupportedContentTypes(int64_t display, std::vector<ContentType>* types) override; + ndk::ScopedAStatus getDisplayDecorationSupport( + int64_t display, std::optional<common::DisplayDecorationSupport>* support) override; ndk::ScopedAStatus registerCallback( const std::shared_ptr<IComposerCallback>& callback) override; ndk::ScopedAStatus setActiveConfig(int64_t display, int32_t config) override; |