From 38d7119acf5edfce2b0ee546c7d5ed52d7f805e9 Mon Sep 17 00:00:00 2001 From: Vinoth Jayaram Date: Thu, 12 May 2022 12:23:57 +0530 Subject: [PATCH 1/3] Avoid Readback buffer support if window_rect feature used When window rect feature is used, Display width, height returned to the client are different than actual panel width, height. This results in drmModeAtomicCommit failures due to WBC and primary panel width, height mismatch. Change-Id: Ibaca5e3ffc9c0093214eb0cab5c89d4fa0bd0d7e --- composer/hwc_display_builtin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp index d0ec4ca9b..0f1eaf71e 100644 --- a/composer/hwc_display_builtin.cpp +++ b/composer/hwc_display_builtin.cpp @@ -1824,6 +1824,13 @@ bool HWCDisplayBuiltIn::HasReadBackBufferSupport() { DisplayConfigFixedInfo fixed_info = {}; display_intf_->GetConfig(&fixed_info); + uint32_t width = UINT32(window_rect_.right + window_rect_.left); + uint32_t height = UINT32(window_rect_.bottom + window_rect_.top); + if (width > 0 || height > 0) { + DLOGE("No ReadBackBuffersupport on window_rect width = %u - height = %u",width,height); + return false; + } + return fixed_info.readback_supported; } From 506b89d92ba914e956da9bf23ec78dc24da00e68 Mon Sep 17 00:00:00 2001 From: Arian Date: Fri, 4 Mar 2022 00:31:00 +0100 Subject: [PATCH 2/3] hwc_display: Support dolby vision Change-Id: Ia73b7674d396de434272aeedf28245e417a1e5bb --- composer/hwc_display.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp index 2f13c501c..63c147dfc 100644 --- a/composer/hwc_display.cpp +++ b/composer/hwc_display.cpp @@ -1600,22 +1600,18 @@ HWC2::Error HWCDisplay::GetHdrCapabilities(uint32_t *out_num_types, int32_t *out uint32_t num_types = 0; if (fixed_info.hdr_plus_supported) { - num_types = UINT32(Hdr::HDR10_PLUS) - 1; + num_types = UINT32(Hdr::HDR10_PLUS); } else { - num_types = UINT32(Hdr::HLG) - 1; + num_types = UINT32(Hdr::HLG); } - // We support HDR10, HLG and HDR10_PLUS. + // We support DOLBY_VISION, HDR10, HLG and HDR10_PLUS. if (out_types == nullptr) { *out_num_types = num_types; } else { uint32_t max_out_types = std::min(*out_num_types, num_types); int32_t type = static_cast(Hdr::DOLBY_VISION); for (int32_t i = 0; i < max_out_types; i++) { - while (type == static_cast(Hdr::DOLBY_VISION) /* Skip list */) { - // Skip the type - type++; - } if (type > (num_types + 1)) { break; } From 001dbb92855dca3afaf8927e1edbc776e61b9159 Mon Sep 17 00:00:00 2001 From: Chenyang Zhong Date: Wed, 4 May 2022 08:39:57 -0400 Subject: [PATCH 3/3] hwc_display: guard Dolby Vision support To enable Dolby Vision support in hwc, add the following to your BoardConfig.mk or BoardConfigCommon.mk SOONG_CONFIG_NAMESPACES += dolby_vision SOONG_CONFIG_dolby_vision += enabled SOONG_CONFIG_dolby_vision_enabled := true Signed-off-by: Chenyang Zhong Change-Id: Ic512456847d84a1f5af64ed9fb8c38d7de4e8970 --- composer/Android.bp | 21 ++++++++++++++++++++- composer/hwc_display.cpp | 15 +++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/composer/Android.bp b/composer/Android.bp index a6f556f8c..997200cf6 100644 --- a/composer/Android.bp +++ b/composer/Android.bp @@ -1,9 +1,28 @@ composer_srcs = ["*.cpp"] +soong_config_module_type { + name: "dolby_vision_cc_defaults", + module_type: "cc_defaults", + config_namespace: "dolby_vision", + bool_variables: ["enabled"], + properties: ["cflags"], +} + +dolby_vision_cc_defaults { + name: "dolby_vision_defaults", + soong_config_variables: { + enabled: { + cflags: [ + "-DTARGET_SUPPORTS_DOLBY_VISION", + ], + }, + }, +} + cc_binary { name: "vendor.qti.hardware.display.composer-service", - defaults: ["qtidisplay_defaults"], + defaults: ["qtidisplay_defaults", "dolby_vision_defaults"], sanitize: { integer_overflow: true, }, diff --git a/composer/hwc_display.cpp b/composer/hwc_display.cpp index 63c147dfc..272397ec5 100644 --- a/composer/hwc_display.cpp +++ b/composer/hwc_display.cpp @@ -1600,18 +1600,33 @@ HWC2::Error HWCDisplay::GetHdrCapabilities(uint32_t *out_num_types, int32_t *out uint32_t num_types = 0; if (fixed_info.hdr_plus_supported) { +#ifdef TARGET_SUPPORTS_DOLBY_VISION num_types = UINT32(Hdr::HDR10_PLUS); } else { num_types = UINT32(Hdr::HLG); } // We support DOLBY_VISION, HDR10, HLG and HDR10_PLUS. +#else + num_types = UINT32(Hdr::HDR10_PLUS) - 1; + } else { + num_types = UINT32(Hdr::HLG) - 1; + } + + // We support HDR10, HLG and HDR10_PLUS. +#endif /* TARGET_SUPPORTS_DOLBY_VISION */ if (out_types == nullptr) { *out_num_types = num_types; } else { uint32_t max_out_types = std::min(*out_num_types, num_types); int32_t type = static_cast(Hdr::DOLBY_VISION); for (int32_t i = 0; i < max_out_types; i++) { +#ifndef TARGET_SUPPORTS_DOLBY_VISION + while (type == static_cast(Hdr::DOLBY_VISION) /* Skip list */) { + // Skip the type + type++; + } +#endif /* TARGET_SUPPORTS_DOLBY_VISION */ if (type > (num_types + 1)) { break; }