Merge "hwc2: Get Mapper instance in frame dump utility"
diff --git a/sdm/libs/core/strategy.cpp b/sdm/libs/core/strategy.cpp
index d682070..a02e309 100644
--- a/sdm/libs/core/strategy.cpp
+++ b/sdm/libs/core/strategy.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2014 - 2017, The Linux Foundation. All rights reserved.
+* Copyright (c) 2014 - 2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
@@ -146,6 +146,11 @@
Layer layer = *gpu_target_layer;
hw_layers_info_->index.push_back(hw_layers_info_->gpu_target_index);
hw_layers_info_->roi_index.push_back(0);
+ layer.transform.flip_horizontal ^= hw_panel_info_.panel_orientation.flip_horizontal;
+ layer.transform.flip_vertical ^= hw_panel_info_.panel_orientation.flip_vertical;
+ // Flip rect to match transform.
+ TransformHV(src_domain, layer.dst_rect, layer.transform, &layer.dst_rect);
+ // Scale to mixer resolution.
MapRect(src_domain, dst_domain, layer.dst_rect, &layer.dst_rect);
hw_layers_info_->hw_layers.push_back(layer);
diff --git a/sdm/libs/hwc2/hwc_display.cpp b/sdm/libs/hwc2/hwc_display.cpp
index dd049de..6f59b4c 100644
--- a/sdm/libs/hwc2/hwc_display.cpp
+++ b/sdm/libs/hwc2/hwc_display.cpp
@@ -1250,6 +1250,10 @@
HWC2::Error HWCDisplay::CommitLayerStack(void) {
+ if (flush_) {
+ return HWC2::Error::None;
+ }
+
if (skip_validate_ && !CanSkipValidate()) {
validated_ = false;
}
@@ -1265,37 +1269,36 @@
DumpInputBuffers();
- if (!flush_) {
- DisplayError error = kErrorUndefined;
- int status = 0;
- if (tone_mapper_) {
- if (layer_stack_.flags.hdr_present) {
- status = tone_mapper_->HandleToneMap(&layer_stack_);
- if (status != 0) {
- DLOGE("Error handling HDR in ToneMapper");
- }
- } else {
- tone_mapper_->Terminate();
+ DisplayError error = kErrorUndefined;
+ int status = 0;
+ if (tone_mapper_) {
+ if (layer_stack_.flags.hdr_present) {
+ status = tone_mapper_->HandleToneMap(&layer_stack_);
+ if (status != 0) {
+ DLOGE("Error handling HDR in ToneMapper");
}
- }
- error = display_intf_->Commit(&layer_stack_);
-
- if (error == kErrorNone) {
- // A commit is successfully submitted, start flushing on failure now onwards.
- flush_on_error_ = true;
} else {
- if (error == kErrorShutDown) {
- shutdown_pending_ = true;
- return HWC2::Error::Unsupported;
- } else if (error == kErrorNotValidated) {
- validated_ = false;
- return HWC2::Error::NotValidated;
- } else if (error != kErrorPermission) {
- DLOGE("Commit failed. Error = %d", error);
- // To prevent surfaceflinger infinite wait, flush the previous frame during Commit()
- // so that previous buffer and fences are released, and override the error.
- flush_ = true;
- }
+ tone_mapper_->Terminate();
+ }
+ }
+
+ error = display_intf_->Commit(&layer_stack_);
+
+ if (error == kErrorNone) {
+ // A commit is successfully submitted, start flushing on failure now onwards.
+ flush_on_error_ = true;
+ } else {
+ if (error == kErrorShutDown) {
+ shutdown_pending_ = true;
+ return HWC2::Error::Unsupported;
+ } else if (error == kErrorNotValidated) {
+ validated_ = false;
+ return HWC2::Error::NotValidated;
+ } else if (error != kErrorPermission) {
+ DLOGE("Commit failed. Error = %d", error);
+ // To prevent surfaceflinger infinite wait, flush the previous frame during Commit()
+ // so that previous buffer and fences are released, and override the error.
+ flush_ = true;
}
}