drm_hwcomposer: Drop content type for hwc3
Support for content type is not supported in HwcDisplay, so don't call
the existing HWC2 hooks and simply return an empty vector.
Whenever support for content type is added, an appropriate interface
should be added to HwcDisplay rather than using the HWC2 hooks anyways.
Change-Id: If520a8144fcb3e3ca122144aa9a1440acc906edf
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp
index 2efce8f..950e269 100644
--- a/hwc3/ComposerClient.cpp
+++ b/hwc3/ComposerClient.cpp
@@ -744,24 +744,8 @@
return ToBinderStatus(hwc3::Error::kBadDisplay);
}
- uint32_t out_num_supported_types = 0;
- auto error = Hwc2toHwc3Error(
- display->GetSupportedContentTypes(&out_num_supported_types, nullptr));
- if (error != hwc3::Error::kNone) {
- return ToBinderStatus(error);
- }
-
- std::vector<uint32_t> out_supported_types(out_num_supported_types);
- error = Hwc2toHwc3Error(
- display->GetSupportedContentTypes(&out_num_supported_types,
- out_supported_types.data()));
- if (error != hwc3::Error::kNone) {
- return ToBinderStatus(error);
- }
-
- for (const auto type : out_supported_types) {
- types->push_back(Hwc2ContentTypeToHwc3(type));
- }
+ // Support for ContentType is not implemented.
+ types->clear();
return ndk::ScopedAStatus::ok();
}
@@ -885,8 +869,10 @@
return ToBinderStatus(hwc3::Error::kBadDisplay);
}
- auto error = display->SetContentType(Hwc3ContentTypeToHwc2(type));
- return ToBinderStatus(Hwc2toHwc3Error(error));
+ if (type == ContentType::NONE) {
+ return ndk::ScopedAStatus::ok();
+ }
+ return ToBinderStatus(hwc3::Error::kUnsupported);
}
ndk::ScopedAStatus ComposerClient::setDisplayedContentSamplingEnabled(
diff --git a/hwc3/Utils.h b/hwc3/Utils.h
index 2e21b97..0be4368 100644
--- a/hwc3/Utils.h
+++ b/hwc3/Utils.h
@@ -153,20 +153,6 @@
return static_cast<int32_t>(render_intent);
}
-// Content type matches, so static_cast is safe.
-// https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/main/graphics/composer/aidl/android/hardware/graphics/composer3/ContentType.aidl
-// https://cs.android.com/android/platform/superproject/main/+/main:hardware/libhardware/include_all/hardware/hwcomposer2.h;l=350;drc=1a0e4a1698c7b080d6763cef9e16592bce75967e
-inline ContentType Hwc2ContentTypeToHwc3(uint32_t content_type) {
- if (content_type > HWC2_CONTENT_TYPE_GAME) {
- ALOGE("Unknown HWC2 content type. Could not translate: %d", content_type);
- return ContentType::NONE;
- }
- return static_cast<ContentType>(content_type);
-}
-inline int32_t Hwc3ContentTypeToHwc2(ContentType content_type) {
- return static_cast<int32_t>(content_type);
-}
-
// Values match, so it's safe to do static_cast.
// https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/main/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayAttribute.aidl
// https://cs.android.com/android/platform/superproject/main/+/main:hardware/libhardware/include_all/hardware/hwcomposer2.h;l=58;drc=d783cabd4d9bddb4b83f2dd38300b7598bb58b24