summaryrefslogtreecommitdiff
path: root/sdm/libs/hwc2
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-12-20 08:18:25 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-20 08:18:25 -0800
commit6fecb59fc2644ed03c4c5633b54b1732a2992752 (patch)
treeaefddeb98e33f4a8e01dc92a2832565f8809d019 /sdm/libs/hwc2
parent2796e8c3e06e75939bd7636814c54cec2913a728 (diff)
parentae0570951d4ea251a83902bc8fc48e5fe089b08b (diff)
downloaddisplay-6fecb59fc2644ed03c4c5633b54b1732a2992752.tar.gz
Merge "sdm: Add support for single buffer layers"
Diffstat (limited to 'sdm/libs/hwc2')
-rw-r--r--sdm/libs/hwc2/hwc_display.cpp9
-rw-r--r--sdm/libs/hwc2/hwc_layers.cpp18
-rw-r--r--sdm/libs/hwc2/hwc_layers.h4
3 files changed, 30 insertions, 1 deletions
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index 7829fcd0..0c48b05f 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -542,6 +542,12 @@ void HWCDisplay::BuildLayerStack() {
secure_display_active = true;
}
+ if (hwc_layer->IsSingleBuffered() &&
+ !(hwc_layer->IsRotationPresent() || hwc_layer->IsScalingPresent())) {
+ layer->flags.single_buffer = true;
+ layer_stack_.flags.single_buffered_layer_present = true;
+ }
+
if (hwc_layer->GetClientRequestedCompositionType() == HWC2::Composition::Cursor) {
// Currently we support only one HWCursor & only at top most z-order
if ((*layer_set_.rbegin())->GetId() == hwc_layer->GetId()) {
@@ -2061,7 +2067,8 @@ bool HWCDisplay::CanSkipValidate() {
}
// Layer Stack checks
- if (layer_stack_.flags.hdr_present && (tone_mapper_ && tone_mapper_->IsActive())) {
+ if ((layer_stack_.flags.hdr_present && (tone_mapper_ && tone_mapper_->IsActive())) ||
+ layer_stack_.flags.single_buffered_layer_present) {
DLOGV_IF(kTagClient, "HDR content present with tone mapping enabled. Returning false.");
return false;
}
diff --git a/sdm/libs/hwc2/hwc_layers.cpp b/sdm/libs/hwc2/hwc_layers.cpp
index cd9ce7be..51384f93 100644
--- a/sdm/libs/hwc2/hwc_layers.cpp
+++ b/sdm/libs/hwc2/hwc_layers.cpp
@@ -772,6 +772,9 @@ DisplayError HWCLayer::SetMetaData(const private_handle_t *pvt_handle, Layer *la
GetUBWCStatsFromMetaData(&cr_stats[0], &(layer_buffer->ubwc_crstats[0]));
} // if (getMetaData)
+ single_buffer_ = false;
+ getMetaData(const_cast<private_handle_t *>(handle), GET_SINGLE_BUFFER_MODE, &single_buffer_);
+
return kErrorNone;
}
@@ -891,4 +894,19 @@ int32_t HWCLayer::PopReleaseFence(void) {
return fence;
}
+bool HWCLayer::IsRotationPresent() {
+ return ((layer_->transform.rotation != 0.0f) ||
+ layer_->transform.flip_horizontal ||
+ layer_->transform.flip_vertical);
+}
+
+bool HWCLayer::IsScalingPresent() {
+ uint32_t src_width = static_cast<uint32_t>(layer_->src_rect.right - layer_->src_rect.left);
+ uint32_t src_height = static_cast<uint32_t>(layer_->src_rect.bottom - layer_->src_rect.top);
+ uint32_t dst_width = static_cast<uint32_t>(layer_->dst_rect.right - layer_->dst_rect.left);
+ uint32_t dst_height = static_cast<uint32_t>(layer_->dst_rect.bottom - layer_->dst_rect.top);
+
+ return ((src_width != dst_width) || (dst_height != src_height));
+}
+
} // namespace sdm
diff --git a/sdm/libs/hwc2/hwc_layers.h b/sdm/libs/hwc2/hwc_layers.h
index a7b65c8e..5f5792fa 100644
--- a/sdm/libs/hwc2/hwc_layers.h
+++ b/sdm/libs/hwc2/hwc_layers.h
@@ -94,6 +94,9 @@ class HWCLayer {
bool SupportLocalConversion(ColorPrimaries working_primaries);
void ResetValidation() { needs_validate_ = false; }
bool NeedsValidation() { return (needs_validate_ || geometry_changes_); }
+ bool IsSingleBuffered() { return single_buffer_; }
+ bool IsScalingPresent();
+ bool IsRotationPresent();
private:
Layer *layer_ = nullptr;
@@ -107,6 +110,7 @@ class HWCLayer {
LayerTransform layer_transform_ = {};
LayerRect dst_rect_ = {};
bool needs_validate_ = true;
+ bool single_buffer_ = false;
// Composition requested by client(SF)
HWC2::Composition client_requested_ = HWC2::Composition::Device;