From 670b4e577ca2984196c3ba6198ec2f70340bab6b Mon Sep 17 00:00:00 2001 From: Ch Ganesh Kumar Date: Thu, 5 Apr 2018 17:52:17 +0530 Subject: sdm: Update vendor HDR capability logic HDR support capabilities were populated to SF, when panel and target supports HDR. At SF, HDR layer is forced to GPU composition with new HDR solution, if vendor does not support HDR. This change will populate marking HDR support to true (for all display types) when primary panel is internal. Change-Id: I8305ae672cf8a721abf25ce026f21dbcbbb17928 --- sdm/libs/core/display_base.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sdm') diff --git a/sdm/libs/core/display_base.cpp b/sdm/libs/core/display_base.cpp index a50dd944..22aff56f 100644 --- a/sdm/libs/core/display_base.cpp +++ b/sdm/libs/core/display_base.cpp @@ -401,8 +401,14 @@ DisplayError DisplayBase::GetConfig(DisplayConfigFixedInfo *fixed_info) { HWResourceInfo hw_resource_info = HWResourceInfo(); hw_info_intf_->GetHWResourceInfo(&hw_resource_info); - // hdr can be supported by display when target and panel supports HDR. - fixed_info->hdr_supported = (hw_resource_info.has_hdr && hw_panel_info_.hdr_enabled); + bool hdr_supported = hw_resource_info.has_hdr; + HWDisplayInterfaceInfo hw_disp_info = {}; + hw_info_intf_->GetFirstDisplayInterfaceType(&hw_disp_info); + if (hw_disp_info.type == kHDMI) { + hdr_supported = (hdr_supported && hw_panel_info_.hdr_enabled); + } + + fixed_info->hdr_supported = hdr_supported; // Populate luminance values only if hdr will be supported on that display fixed_info->max_luminance = fixed_info->hdr_supported ? hw_panel_info_.peak_luminance: 0; fixed_info->average_luminance = fixed_info->hdr_supported ? hw_panel_info_.average_luminance : 0; -- cgit v1.2.3 From 648ef743024c5ed1a5787a7bf9a2ee6cad9e659e Mon Sep 17 00:00:00 2001 From: Pullakavi Srinivas Date: Wed, 7 Mar 2018 15:15:14 +0530 Subject: hwc2: Avoid overwriting metadata refresh rate. -- Compute sanitized metadata refresh rate. -- Populate display's operating refresh rate to all the layers that donot support metadata refresh rate. Change-Id: Iaf17e4e10da543e110fcf6ba7648d60807069f98 --- sdm/libs/hwc2/hwc_display.cpp | 16 +++++++++++++--- sdm/libs/hwc2/hwc_display.h | 1 + sdm/libs/hwc2/hwc_layers.cpp | 1 + sdm/libs/hwc2/hwc_layers.h | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) (limited to 'sdm') diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp index 28a2a5ef..8888f114 100644 --- a/sdm/libs/hwc2/hwc_display.cpp +++ b/sdm/libs/hwc2/hwc_display.cpp @@ -596,11 +596,10 @@ void HWCDisplay::BuildLayerStack() { layer->src_rect.bottom = layer_buffer->height; } - if (layer->frame_rate > metadata_refresh_rate_) { + if (hwc_layer->HasMetaDataRefreshRate() && layer->frame_rate > metadata_refresh_rate_) { metadata_refresh_rate_ = SanitizeRefreshRate(layer->frame_rate); - } else { - layer->frame_rate = current_refresh_rate_; } + display_rect_ = Union(display_rect_, layer->dst_rect); geometry_changes_ |= hwc_layer->GetGeometryChanges(); @@ -1054,6 +1053,7 @@ HWC2::Error HWCDisplay::PrepareLayerStack(uint32_t *out_num_types, uint32_t *out return HWC2::Error::BadDisplay; } + UpdateRefreshRate(); if (!skip_prepare_) { DisplayError error = display_intf_->Prepare(&layer_stack_); if (error != kErrorNone) { @@ -2145,4 +2145,14 @@ HWC2::Error HWCDisplay::GetValidateDisplayOutput(uint32_t *out_num_types, return ((*out_num_types > 0) ? HWC2::Error::HasChanges : HWC2::Error::None); } +void HWCDisplay::UpdateRefreshRate() { + for (auto hwc_layer : layer_set_) { + if (hwc_layer->HasMetaDataRefreshRate()) { + continue; + } + auto layer = hwc_layer->GetSDMLayer(); + layer->frame_rate = current_refresh_rate_; + } +} + } // namespace sdm diff --git a/sdm/libs/hwc2/hwc_display.h b/sdm/libs/hwc2/hwc_display.h index d2620efb..86d9462f 100644 --- a/sdm/libs/hwc2/hwc_display.h +++ b/sdm/libs/hwc2/hwc_display.h @@ -328,6 +328,7 @@ class HWCDisplay : public DisplayEventHandler { private: void DumpInputBuffers(void); + void UpdateRefreshRate(); qService::QService *qservice_ = NULL; DisplayClass display_class_; uint32_t geometry_changes_ = GeometryChanges::kNone; diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp index 4250335e..aa4fb063 100644 --- a/sdm/libs/hwc2/hwc_layers.cpp +++ b/sdm/libs/hwc2/hwc_layers.cpp @@ -735,6 +735,7 @@ DisplayError HWCLayer::SetMetaData(const private_handle_t *pvt_handle, Layer *la uint32_t frame_rate = layer->frame_rate; if (getMetaData(handle, GET_REFRESH_RATE, &fps) == 0) { frame_rate = (fps != 0) ? RoundToStandardFPS(fps) : layer->frame_rate; + has_metadata_refresh_rate_ = true; } int32_t interlaced = 0; diff --git a/sdm/libs/hwc2/hwc_layers.h b/sdm/libs/hwc2/hwc_layers.h index 92267445..41ec6ede 100644 --- a/sdm/libs/hwc2/hwc_layers.h +++ b/sdm/libs/hwc2/hwc_layers.h @@ -99,6 +99,7 @@ class HWCLayer { bool IsScalingPresent(); bool IsRotationPresent(); bool IsNonIntegralSourceCrop() { return non_integral_source_crop_; } + bool HasMetaDataRefreshRate() { return has_metadata_refresh_rate_; } private: Layer *layer_ = nullptr; @@ -115,6 +116,7 @@ class HWCLayer { bool single_buffer_ = false; int buffer_fd_ = -1; bool non_integral_source_crop_ = false; + bool has_metadata_refresh_rate_ = false; // Composition requested by client(SF) HWC2::Composition client_requested_ = HWC2::Composition::Device; -- cgit v1.2.3