drm_hwcomposer: Fix VTS failures
Couple of extra adjustments to pass VTS tests:
Ensure the ComposerClient is a singleton
Return unsupported for PowerMode::ON_SUSPEND
Check that brightness is a valid non-negative float number
Change-Id: Ib4704580f41ebbbc39487612efc2b27c0681b356
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc3/Composer.cpp b/hwc3/Composer.cpp
index 2494488..4977a14 100644
--- a/hwc3/Composer.cpp
+++ b/hwc3/Composer.cpp
@@ -32,6 +32,10 @@
std::shared_ptr<IComposerClient>* out_client) {
DEBUG_FUNC();
+ if (!client_.expired()) {
+ return ToBinderStatus(hwc3::Error::kNoResources);
+ }
+
auto client = ndk::SharedRefBase::make<ComposerClient>();
if (!client || !client->Init()) {
*out_client = nullptr;