diff options
author | joenchen <joenchen@google.com> | 2022-11-29 15:58:44 +0000 |
---|---|---|
committer | joenchen <joenchen@google.com> | 2022-12-01 16:37:43 +0000 |
commit | acf0fe4dd6c5ea3e633b0e354d3c128c47baa04a (patch) | |
tree | 7db8267ed0e3ea71c74737d443e7ab770edf9ffc /hwc3 | |
parent | 4e4fb83bf22fdce683d0ba9044aaf18826f76be0 (diff) |
hwc3: Primary displays supports MULTI_THREADED_PRESENT
After primary displays supports this capability, SurfaceFlinger can run
executeCommands(presentDisplay) for this display concurrently with other
displays with the same capability.
Bug: 247074458
Test: switch applications
Change-Id: I55c4fe2d38f412f0e98b46502a99c90943cefbcc
Diffstat (limited to 'hwc3')
-rw-r--r-- | hwc3/ComposerClient.cpp | 10 | ||||
-rw-r--r-- | hwc3/impl/HalImpl.cpp | 7 | ||||
-rw-r--r-- | hwc3/impl/HalImpl.h | 2 | ||||
-rw-r--r-- | hwc3/include/IComposerHal.h | 3 |
4 files changed, 21 insertions, 1 deletions
diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp index 7a3c72a..bb73686 100644 --- a/hwc3/ComposerClient.cpp +++ b/hwc3/ComposerClient.cpp @@ -170,6 +170,16 @@ ndk::ScopedAStatus ComposerClient::getDisplayCapabilities(int64_t display, caps->push_back(DisplayCapability::DISPLAY_IDLE_TIMER); } + err = mHal->getDisplayMultiThreadedPresentSupport(display, support); + if (err != ::android::OK) { + LOG(ERROR) << "failed to getDisplayMultiThreadedPresentSupport: " << err; + return TO_BINDER_STATUS(err); + } + + if (support) { + caps->push_back(DisplayCapability::MULTI_THREADED_PRESENT); + } + return TO_BINDER_STATUS(err); } diff --git a/hwc3/impl/HalImpl.cpp b/hwc3/impl/HalImpl.cpp index a5d229d..3a277af 100644 --- a/hwc3/impl/HalImpl.cpp +++ b/hwc3/impl/HalImpl.cpp @@ -1050,4 +1050,11 @@ int32_t HalImpl::getDisplayIdleTimerSupport(int64_t display, bool& outSupport) { return halDisplay->getDisplayIdleTimerSupport(outSupport); } +int32_t HalImpl::getDisplayMultiThreadedPresentSupport(const int64_t& display, bool& outSupport) { + ExynosDisplay* halDisplay; + RET_IF_ERR(getHalDisplay(display, halDisplay)); + + return halDisplay->getDisplayMultiThreadedPresentSupport(outSupport); +} + } // namespace aidl::android::hardware::graphics::composer3::impl diff --git a/hwc3/impl/HalImpl.h b/hwc3/impl/HalImpl.h index 21af64e..0f4b182 100644 --- a/hwc3/impl/HalImpl.h +++ b/hwc3/impl/HalImpl.h @@ -137,6 +137,8 @@ class HalImpl : public IComposerHal { const ndk::ScopedFileDescriptor& releaseFence) override; int32_t setVsyncEnabled(int64_t display, bool enabled) override; int32_t getDisplayIdleTimerSupport(int64_t display, bool& outSupport) override; + int32_t getDisplayMultiThreadedPresentSupport(const int64_t& display, + bool& outSupport) override; int32_t setIdleTimerEnabled(int64_t display, int32_t timeout) override; int32_t getRCDLayerSupport(int64_t display, bool& outSupport) override; int32_t setLayerBlockingRegion( diff --git a/hwc3/include/IComposerHal.h b/hwc3/include/IComposerHal.h index 7183dec..8e336dd 100644 --- a/hwc3/include/IComposerHal.h +++ b/hwc3/include/IComposerHal.h @@ -122,7 +122,8 @@ class IComposerHal { DisplayAttribute attribute, int32_t* outValue) = 0; virtual int32_t getDisplayBrightnessSupport(int64_t display, bool& outSupport) = 0; virtual int32_t getDisplayIdleTimerSupport(int64_t display, bool& outSupport) = 0; - + virtual int32_t getDisplayMultiThreadedPresentSupport(const int64_t& display, + bool& outSupport) = 0; virtual int32_t getDisplayCapabilities(int64_t display, std::vector<DisplayCapability>* caps) = 0; virtual int32_t getDisplayConfigs(int64_t display, std::vector<int32_t>* configs) = 0; |