diff options
author | Dileep Marchya <dmarchya@codeaurora.org> | 2016-01-27 14:43:17 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-02-04 12:20:52 -0800 |
commit | 7d0727dbaf09b13ed945353b0e5b79254500a686 (patch) | |
tree | 81dcdde0fe32d06586aa8f69916d21e7c5b754f7 /sdm/libs/hwc/hwc_display.cpp | |
parent | fe3db9b5c3f07584ef125056f453d9cf5ce1baad (diff) | |
download | hardware_qcom_display-7d0727dbaf09b13ed945353b0e5b79254500a686.tar.gz hardware_qcom_display-7d0727dbaf09b13ed945353b0e5b79254500a686.tar.bz2 hardware_qcom_display-7d0727dbaf09b13ed945353b0e5b79254500a686.zip |
sdm: Mark layer as updating if geometry has changed.
- Consider a layer updating if layer geometry has changed. This will
trigger refresh on cache which might be impacted because of change
in position, crop though handles have not changed.
CRs-Fixed: 968235
Change-Id: I1b9f16c6e6fe4265f07ab44db887848225496f24
Diffstat (limited to 'sdm/libs/hwc/hwc_display.cpp')
-rw-r--r-- | sdm/libs/hwc/hwc_display.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sdm/libs/hwc/hwc_display.cpp b/sdm/libs/hwc/hwc_display.cpp index 69926c77d..823a76b2b 100644 --- a/sdm/libs/hwc/hwc_display.cpp +++ b/sdm/libs/hwc/hwc_display.cpp @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014 - 2015, The Linux Foundation. All rights reserved. +* Copyright (c) 2014 - 2016, 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 @@ -572,8 +572,7 @@ int HWCDisplay::PrePrepareLayerStack(hwc_display_contents_1_t *content_list) { layer.flags.updating = true; if (num_hw_layers <= kMaxLayerCount) { - LayerCache layer_cache = layer_stack_cache_.layer_cache[i]; - layer.flags.updating = IsLayerUpdating(hwc_layer, layer_cache); + layer.flags.updating = IsLayerUpdating(content_list, i); } #ifdef QTI_BSP if (hwc_layer.flags & HWC_SCREENSHOT_ANIMATOR_LAYER) { @@ -826,7 +825,6 @@ bool HWCDisplay::NeedsFrameBufferRefresh(hwc_display_contents_1_t *content_list) } for (uint32_t i = 0; i < layer_count; i++) { - hwc_layer_1_t &hwc_layer = content_list->hwLayers[i]; Layer &layer = layer_stack_.layers[i]; LayerCache &layer_cache = layer_stack_cache_.layer_cache[i]; @@ -843,7 +841,7 @@ bool HWCDisplay::NeedsFrameBufferRefresh(hwc_display_contents_1_t *content_list) return true; } - if ((layer.composition == kCompositionGPU) && IsLayerUpdating(hwc_layer, layer_cache)) { + if ((layer.composition == kCompositionGPU) && IsLayerUpdating(content_list, i)) { return true; } } @@ -851,16 +849,24 @@ bool HWCDisplay::NeedsFrameBufferRefresh(hwc_display_contents_1_t *content_list) return false; } -bool HWCDisplay::IsLayerUpdating(const hwc_layer_1_t &hwc_layer, const LayerCache &layer_cache) { +bool HWCDisplay::IsLayerUpdating(hwc_display_contents_1_t *content_list, int layer_index) { + hwc_layer_1_t &hwc_layer = content_list->hwLayers[layer_index]; + LayerCache &layer_cache = layer_stack_cache_.layer_cache[layer_index]; + const private_handle_t *pvt_handle = static_cast<const private_handle_t *>(hwc_layer.handle); const MetaData_t *meta_data = pvt_handle ? reinterpret_cast<MetaData_t *>(pvt_handle->base_metadata) : NULL; - // If a layer is in single buffer mode, it should be considered as updating always + // Layer should be considered updating if + // a) layer is in single buffer mode, or + // b) layer handle has changed, or + // c) layer plane alpha has changed, or + // d) layer stack geometry has changed return ((meta_data && (meta_data->operation & SET_SINGLE_BUFFER_MODE) && - meta_data->isSingleBufferMode) || + meta_data->isSingleBufferMode) || (layer_cache.handle != hwc_layer.handle) || - (layer_cache.plane_alpha != hwc_layer.planeAlpha)); + (layer_cache.plane_alpha != hwc_layer.planeAlpha) || + (content_list->flags & HWC_GEOMETRY_CHANGED)); } void HWCDisplay::CacheLayerStackInfo(hwc_display_contents_1_t *content_list) { |