return 1;
}
+static void
+_reset_hwc_windows_grabbed_layer_zpos(struct list_head *hwc_window_list)
+{
+ tdm_exynos_hwc_window_data *hw = NULL;
+
+ LIST_FOR_EACH_ENTRY(hw, hwc_window_list, link) {
+ hw->grabbed_layer_zpos = -1;
+ }
+}
+
+static int
+_is_device_to_client_transition(struct list_head *hwc_window_list)
+{
+ tdm_exynos_hwc_window_data *hw = NULL;
+
+ LIST_FOR_EACH_ENTRY(hw, hwc_window_list, link)
+ if (hw->is_device_to_client_transition)
+ return 1;
+
+ return 0;
+}
+
static tdm_error
_tdm_exynos_display_prepare_commit(tdm_exynos_output_data *output_data) {
/* preempt the hwc_wnd which was mapped to the primary layer */
hw = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, primary_layer_zpos);
- hw->assigned_layer_zpos = -1;
- hw->prev_assigned_layer_zpos = -1;
+ if (hw)
+ hw->assigned_layer_zpos = -1;
_update_layers_info(output_data);
}
* within 'device to client transition' state, so after such transition
* has finished, we trigger a revalidate event to reevaluate the overlay policy */
tdm_backend_trigger_need_validate_event(output_data);
+
+ hw = NULL;
+
+ LIST_FOR_EACH_ENTRY(hw, &output_data->hwc_window_list, link)
+ hw->is_device_to_client_transition = 0;
}
+ if (_is_device_to_client_transition(&output_data->hwc_window_list))
+ return TDM_ERROR_NONE;
+
+ _reset_hwc_windows_grabbed_layer_zpos(&output_data->hwc_window_list);
+
LIST_FOR_EACH_ENTRY(layer, &output_data->layer_list, link) {
if (output_data->need_target_window && layer->zpos == primary_layer_zpos)
continue;
continue;
hw = _find_maped_hwc_window_to_layer(&output_data->hwc_window_list, layer->zpos);
+ if (hw)
+ hw->grabbed_layer_zpos = layer->zpos;
_set_hwc_window_buffer_to_layer(layer, hw);
}
- if (device_to_client_transition_finished) {
- hw = NULL;
-
- LIST_FOR_EACH_ENTRY(hw, &output_data->hwc_window_list, link)
- hw->is_device_to_client_transition = 0;
- }
-
return TDM_ERROR_NONE;
}
hw->prev_validated_type = hw->validated_type;
}
-static void
-_update_windows_previous_assigned_layer_zpos(struct list_head *hwc_wnds)
-{
- tdm_exynos_hwc_window_data *hw = NULL;
-
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE) {
- hw->prev_assigned_layer_zpos = -1;
- continue;
- }
-
- hw->prev_assigned_layer_zpos = hw->assigned_layer_zpos;
- }
-}
-
static void
_reset_composition_types(struct list_head *hwc_window_list)
{
if (!output_data->need_target_window)
output_data->target_hwc_window->surface = NULL;
- LIST_FOR_EACH_ENTRY(hw, &output_data->hwc_window_list, link)
+ LIST_FOR_EACH_ENTRY(hw, &output_data->hwc_window_list, link) {
+ if (!output_data->need_target_window)
+ hw->present_on_target_wnd = 0;
+
if (hw->client_type == TDM_COMPOSITION_NONE)
hw->surface = NULL;
+ }
}
static void
continue;
}
- hw->assigned_layer_zpos = hw->prev_assigned_layer_zpos;
+ hw->assigned_layer_zpos = hw->grabbed_layer_zpos;
}
}
if (hw->client_type == TDM_COMPOSITION_NONE)
continue;
- if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE &&
+ if (hw->grabbed_layer_zpos >= 0 &&
hw->validated_type == TDM_COMPOSITION_CLIENT)
hw->is_device_to_client_transition = 1;
hw->validated_type = TDM_COMPOSITION_CLIENT;
}
-
- /* move to 'device to client transition' state hwc_wnds
- * which were mapped to overlays, but which weren't reset to
- * CLIENT by e20 or _map_hwc_windows_to_layers() func */
- LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
- continue;
-
- if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE &&
- hw->validated_type == TDM_COMPOSITION_CLIENT)
- hw->is_device_to_client_transition = 1;
- }
}
/* if we got at least one device -> client transition or we have
tdm_exynos_hwc_window_data *hw = NULL;
LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
- if (hw->client_type == TDM_COMPOSITION_NONE)
+ if (hw->client_type == TDM_COMPOSITION_NONE) {
+ if (hw->is_device_to_client_transition)
+ return 1;
+
continue;
+ }
- if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE &&
- hw->validated_type == TDM_COMPOSITION_CLIENT)
- return 1;
- if (hw->is_device_to_client_transition)
+ if (hw->grabbed_layer_zpos >= 0 &&
+ hw->validated_type == TDM_COMPOSITION_CLIENT)
return 1;
}
}
_update_windows_previous_type(&exynos_output->hwc_window_list);
- _update_windows_previous_assigned_layer_zpos(&exynos_output->hwc_window_list);
}
_reset_buffers_for_unvis_hwc_windows(exynos_output);