Add getDisplayDecorationSupport() to HWC3
... to match interface added in ag/16769557.
Bug: b/193240715
Test: build and boot Cuttlefish
Change-Id: I91105fc3345dbd75aeb0b102f3f0138fa33120c0
(cherry picked from commit 463e4bf3e134bec96575a2c0866faa9b77cae33e)
diff --git a/system/hwc3/ComposerClient.cpp b/system/hwc3/ComposerClient.cpp
index bacc3ec..e69a865 100644
--- a/system/hwc3/ComposerClient.cpp
+++ b/system/hwc3/ComposerClient.cpp
@@ -486,6 +486,18 @@
return ToBinderStatus(display->getSupportedContentTypes(outTypes));
}
+ndk::ScopedAStatus ComposerClient::getDisplayDecorationSupport(
+ int64_t displayId,
+ std::optional<common::DisplayDecorationSupport>* outSupport) {
+ DEBUG_LOG("%s", __FUNCTION__);
+
+ std::unique_lock<std::mutex> lock(mStateMutex);
+
+ GET_DISPLAY_OR_RETURN_ERROR();
+
+ return ToBinderStatus(display->getDecorationSupport(outSupport));
+}
+
ndk::ScopedAStatus ComposerClient::registerCallback(
const std::shared_ptr<IComposerCallback>& callback) {
DEBUG_LOG("%s", __FUNCTION__);
diff --git a/system/hwc3/ComposerClient.h b/system/hwc3/ComposerClient.h
index 4c213fb..5248dde 100644
--- a/system/hwc3/ComposerClient.h
+++ b/system/hwc3/ComposerClient.h
@@ -93,6 +93,9 @@
std::vector<RenderIntent>* intents) override;
ndk::ScopedAStatus getSupportedContentTypes(
int64_t displayId, std::vector<ContentType>* types) override;
+ ndk::ScopedAStatus getDisplayDecorationSupport(
+ int64_t displayId,
+ std::optional<common::DisplayDecorationSupport>* support) override;
ndk::ScopedAStatus registerCallback(
const std::shared_ptr<IComposerCallback>& callback) override;
ndk::ScopedAStatus setActiveConfig(int64_t displayId,
diff --git a/system/hwc3/Display.cpp b/system/hwc3/Display.cpp
index 84e6269..47c87a6 100644
--- a/system/hwc3/Display.cpp
+++ b/system/hwc3/Display.cpp
@@ -415,6 +415,15 @@
return HWC3::Error::None;
}
+HWC3::Error Display::getDecorationSupport(
+ std::optional<common::DisplayDecorationSupport>* outSupport) {
+ DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
+
+ outSupport->reset();
+
+ return HWC3::Error::Unsupported;
+}
+
HWC3::Error Display::registerCallback(
const std::shared_ptr<IComposerCallback>& callback) {
DEBUG_LOG("%s: display:%" PRId64, __FUNCTION__, mId);
diff --git a/system/hwc3/Display.h b/system/hwc3/Display.h
index aa6d1d1..707bc19 100644
--- a/system/hwc3/Display.h
+++ b/system/hwc3/Display.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_HWC_DISPLAY_H
#define ANDROID_HWC_DISPLAY_H
+#include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h>
#include <aidl/android/hardware/graphics/composer3/ColorMode.h>
#include <aidl/android/hardware/graphics/composer3/ContentType.h>
#include <aidl/android/hardware/graphics/composer3/DisplayAttribute.h>
@@ -102,6 +103,8 @@
HWC3::Error getRenderIntents(ColorMode mode,
std::vector<RenderIntent>* intents);
HWC3::Error getSupportedContentTypes(std::vector<ContentType>* types);
+ HWC3::Error getDecorationSupport(
+ std::optional<common::DisplayDecorationSupport>* support);
HWC3::Error registerCallback(
const std::shared_ptr<IComposerCallback>& callback);
HWC3::Error setActiveConfig(int32_t configId);