summaryrefslogtreecommitdiffstats
path: root/sdm/libs/core/strategy.cpp
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2016-03-01 19:35:00 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-03-15 05:52:19 -0700
commit9b2cc73da0503d873709cc47974d94279438495d (patch)
tree04d0ad85809f6468137c4ca50de903a88973795a /sdm/libs/core/strategy.cpp
parentce3cffca4886cbddecd72ed1c1d7776eee45d981 (diff)
downloadhardware_qcom_display-9b2cc73da0503d873709cc47974d94279438495d.tar.gz
hardware_qcom_display-9b2cc73da0503d873709cc47974d94279438495d.tar.bz2
hardware_qcom_display-9b2cc73da0503d873709cc47974d94279438495d.zip
sdm: Fix default ROI initialization
Frame buffer resolution can be different from panel resolution for actionsafe usecase. Initialization of ROI needs to be with respect to panel resolution, So derive default ROI information from panel width and height instead of deriving it from frame buffer dest coordinates. CRs-Fixed: 984159 Change-Id: I0d728a44989acf4041ed479f40f6646f8ba6d719
Diffstat (limited to 'sdm/libs/core/strategy.cpp')
-rw-r--r--sdm/libs/core/strategy.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/sdm/libs/core/strategy.cpp b/sdm/libs/core/strategy.cpp
index 582fda7d3..794b437b4 100644
--- a/sdm/libs/core/strategy.cpp
+++ b/sdm/libs/core/strategy.cpp
@@ -32,9 +32,10 @@
namespace sdm {
Strategy::Strategy(ExtensionInterface *extension_intf, DisplayType type,
- const HWResourceInfo &hw_resource_info, const HWPanelInfo &hw_panel_info)
+ const HWResourceInfo &hw_resource_info, const HWPanelInfo &hw_panel_info,
+ const HWDisplayAttributes &hw_display_attributes)
: extension_intf_(extension_intf), display_type_(type), hw_resource_info_(hw_resource_info),
- hw_panel_info_(hw_panel_info) {
+ hw_panel_info_(hw_panel_info), hw_display_attributes_(hw_display_attributes) {
}
DisplayError Strategy::Init() {
@@ -163,24 +164,21 @@ void Strategy::GenerateROI() {
return;
}
- LayerStack *layer_stack = hw_layers_info_->stack;
- LayerRect &dst_rect = layer_stack->layers[fb_layer_index_].dst_rect;
- // The destination co-ordinates of the FB layer map to the panel and may be different than source
- float fb_x_res = dst_rect.right - dst_rect.left;
- float fb_y_res = dst_rect.bottom - dst_rect.top;
+ float disp_x_res = hw_display_attributes_.x_pixels;
+ float disp_y_res = hw_display_attributes_.y_pixels;
if (!hw_resource_info_.is_src_split &&
- ((fb_x_res > hw_resource_info_.max_mixer_width) ||
+ ((disp_x_res > hw_resource_info_.max_mixer_width) ||
((display_type_ == kPrimary) && hw_panel_info_.split_info.right_split))) {
split_display = true;
}
if (split_display) {
float left_split = FLOAT(hw_panel_info_.split_info.left_split);
- hw_layers_info_->left_partial_update = (LayerRect) {0.0f, 0.0f, left_split, fb_y_res};
- hw_layers_info_->right_partial_update = (LayerRect) {left_split, 0.0f, fb_x_res, fb_y_res};
+ hw_layers_info_->left_partial_update = (LayerRect) {0.0f, 0.0f, left_split, disp_y_res};
+ hw_layers_info_->right_partial_update = (LayerRect) {left_split, 0.0f, disp_x_res, disp_y_res};
} else {
- hw_layers_info_->left_partial_update = (LayerRect) {0.0f, 0.0f, fb_x_res, fb_y_res};
+ hw_layers_info_->left_partial_update = (LayerRect) {0.0f, 0.0f, disp_x_res, disp_y_res};
hw_layers_info_->right_partial_update = (LayerRect) {0.0f, 0.0f, 0.0f, 0.0f};
}
}