drm_hwcomposer: hwc3: Fix build with Android-13
Account for differences in the Composer3 API between v1 and v2. Change-Id: Ia8cbef19b5554467af15932afd842601d9d7f7a8 Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
This commit is contained in:
parent
16933c3dcf
commit
445ef202e5
3 changed files with 18 additions and 0 deletions
|
|
@ -154,7 +154,9 @@ bool IsSupportedCompositionType(
|
|||
// DisplayCommand and return.
|
||||
case Composition::DISPLAY_DECORATION:
|
||||
case Composition::SIDEBAND:
|
||||
#if __ANDROID_API__ >= 34
|
||||
case Composition::REFRESH_RATE_INDICATOR:
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -188,7 +190,9 @@ std::optional<HWC2::Composition> AidlToCompositionType(
|
|||
// Unsupported composition types.
|
||||
case Composition::DISPLAY_DECORATION:
|
||||
case Composition::SIDEBAND:
|
||||
#if __ANDROID_API__ >= 34
|
||||
case Composition::REFRESH_RATE_INDICATOR:
|
||||
#endif
|
||||
ALOGE("Unsupported composition type: %s",
|
||||
toString(composition->composition).c_str());
|
||||
return std::nullopt;
|
||||
|
|
@ -1242,6 +1246,8 @@ ndk::ScopedAStatus ComposerClient::setIdleTimerEnabled(int64_t /*display_id*/,
|
|||
return ToBinderStatus(hwc3::Error::kUnsupported);
|
||||
}
|
||||
|
||||
#if __ANDROID_API__ >= 34
|
||||
|
||||
ndk::ScopedAStatus ComposerClient::getOverlaySupport(
|
||||
OverlayProperties* /*out_overlay_properties*/) {
|
||||
return ToBinderStatus(hwc3::Error::kUnsupported);
|
||||
|
|
@ -1263,6 +1269,8 @@ ndk::ScopedAStatus ComposerClient::setRefreshRateChangedCallbackDebugEnabled(
|
|||
return ToBinderStatus(hwc3::Error::kUnsupported);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if __ANDROID_API__ >= 35
|
||||
|
||||
ndk::ScopedAStatus ComposerClient::getDisplayConfigurations(
|
||||
|
|
|
|||
|
|
@ -131,6 +131,9 @@ class ComposerClient : public BnComposerClient {
|
|||
ndk::ScopedAStatus setVsyncEnabled(int64_t display, bool enabled) override;
|
||||
ndk::ScopedAStatus setIdleTimerEnabled(int64_t display,
|
||||
int32_t timeout) override;
|
||||
|
||||
#if __ANDROID_API__ >= 34
|
||||
|
||||
ndk::ScopedAStatus getOverlaySupport(
|
||||
OverlayProperties* out_overlay_properties) override;
|
||||
ndk::ScopedAStatus getHdrConversionCapabilities(
|
||||
|
|
@ -141,6 +144,8 @@ class ComposerClient : public BnComposerClient {
|
|||
ndk::ScopedAStatus setRefreshRateChangedCallbackDebugEnabled(
|
||||
int64_t display, bool enabled) override;
|
||||
|
||||
#endif
|
||||
|
||||
#if __ANDROID_API__ >= 35
|
||||
|
||||
ndk::ScopedAStatus getDisplayConfigurations(
|
||||
|
|
|
|||
|
|
@ -46,9 +46,14 @@ int main(int /*argc*/, char* argv[]) {
|
|||
const std::string instance = std::string() + Composer::descriptor +
|
||||
"/default";
|
||||
ALOGI("HWC3 service name %s", instance.c_str());
|
||||
#if __ANDROID_API__ >= 34
|
||||
auto status = AServiceManager_addServiceWithFlags(
|
||||
composer->asBinder().get(), instance.c_str(),
|
||||
AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED);
|
||||
#else
|
||||
auto status = AServiceManager_addService(composer->asBinder().get(),
|
||||
instance.c_str());
|
||||
#endif
|
||||
if (status != STATUS_OK) {
|
||||
ALOGE("Failed to register service. Error %d", (int)status);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue