diff options
author | Yichi Chen <yichichen@google.com> | 2021-12-28 15:14:40 +0800 |
---|---|---|
committer | Yichi Chen <yichichen@google.com> | 2021-12-28 15:35:01 +0800 |
commit | 4db863d6101f5fb8de3f5126432436d5a76e8f09 (patch) | |
tree | fad68b52331234be66deecdad5bd94ed69f36e3a /hwc3/ComposerClient.cpp | |
parent | 3af059705991d93c558a15910931b763726abcd0 (diff) |
hwc3: set setInheritRt on Composer and ComposerClient
In Composer3, the binder interface was changed from hwbinder to libinder
due to the interface change from HIDL to AIDL. Unlike hwbinder, inherit
real-time priority is not a default behavior in libbinder. The patch
overrides the createBinder() for IComposer and IComposerClient to set
InheritRt properly when their binders are created.
Bug: 211720161
Test: Check the real-time priority on composer service.
Change-Id: Ie2ead837b1157284d7764d83878e895a37d6c330
Diffstat (limited to 'hwc3/ComposerClient.cpp')
-rw-r--r-- | hwc3/ComposerClient.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp index 6433136..60c2a5a 100644 --- a/hwc3/ComposerClient.cpp +++ b/hwc3/ComposerClient.cpp @@ -16,9 +16,11 @@ #define ATRACE_TAG (ATRACE_TAG_GRAPHICS | ATRACE_TAG_HAL) +#include "ComposerClient.h" + #include <android-base/logging.h> +#include <android/binder_ibinder_platform.h> -#include "ComposerClient.h" #include "Util.h" namespace aidl::android::hardware::graphics::composer3::impl { @@ -511,4 +513,10 @@ void ComposerClient::destroyResources() { mResources.reset(); } +::ndk::SpAIBinder ComposerClient::createBinder() { + auto binder = BnComposerClient::createBinder(); + AIBinder_setInheritRt(binder.get(), true); + return binder; +} + } // namespace aidl::android::hardware::graphics::composer3::impl |