Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion composer/Android.bp
Original file line number Diff line number Diff line change
@@ -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,
},
Expand Down
11 changes: 11 additions & 0 deletions composer/hwc_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1600,22 +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<int32_t>(Hdr::DOLBY_VISION);
for (int32_t i = 0; i < max_out_types; i++) {
#ifndef TARGET_SUPPORTS_DOLBY_VISION
while (type == static_cast<int32_t>(Hdr::DOLBY_VISION) /* Skip list */) {
// Skip the type
type++;
}
#endif /* TARGET_SUPPORTS_DOLBY_VISION */
if (type > (num_types + 1)) {
break;
}
Expand Down
7 changes: 7 additions & 0 deletions composer/hwc_display_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down