remove the old implementation of 'smooth transition' mechanism. 21/163621/1 accepted/tizen/unified/20171213.040845 submit/tizen/20171212.223103
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Tue, 12 Dec 2017 10:38:46 +0000 (12:38 +0200)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Tue, 12 Dec 2017 10:38:46 +0000 (12:38 +0200)
Change-Id: I311ccee9445ef2a129f7812286e0ac72de8e9f90
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
src/tdm_sprd_display.c

index 876f0cb..fffff7b 100644 (file)
@@ -149,8 +149,6 @@ struct _tdm_sprd_hwc_window_data {
        tdm_hwc_window_composition client_type;
        /* validated_type stores the type after running Validate */
        tdm_hwc_window_composition validated_type;
-       /* prev_validated_type is used to achieve requirements tied with the client_candidate type */
-       tdm_hwc_window_composition prev_validated_type;
 
        tdm_hwc_window_flag flags;
 };
@@ -1195,25 +1193,6 @@ sprd_output_set_vblank_handler(tdm_output *output, tdm_output_vblank_handler fun
        return TDM_ERROR_NONE;
 }
 
-static int
-_are_windows_with_client_candidate_type(struct list_head *hwc_wnds)
-{
-       tdm_sprd_hwc_window_data *hw = NULL;
-
-       RETURN_VAL_IF_FAIL(hwc_wnds, 0);
-
-       LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
-
-               if (hw->client_type == TDM_COMPOSITION_NONE)
-                       continue;
-
-               if (hw->validated_type == TDM_COMPOSITION_CLIENT_CANDIDATE)
-                       return 1;
-       }
-
-       return 0;
-}
-
 static tdm_error
 _tdm_sprd_display_prepare_commit(tdm_sprd_output_data *output_data) {
 
@@ -1234,9 +1213,6 @@ _tdm_sprd_display_prepare_commit(tdm_sprd_output_data *output_data) {
                _sprd_layer_attach_window(layer, output_data->video_hwc_window);
        }
 
-       if (_are_windows_with_client_candidate_type(&output_data->hwc_window_list))
-               return TDM_ERROR_NONE;
-
        /* set hwc windows */
        LIST_FOR_EACH_ENTRY_REV(hw, &output_data->hwc_window_list, link) {
                if (hw->client_type == TDM_COMPOSITION_NONE)
@@ -1857,7 +1833,6 @@ _sprd_output_hwc_window_create(tdm_output *output, tdm_hwc_window_info *info, td
 
        sprd_hwc_window->output_data = output;
        sprd_hwc_window->zpos = 0;
-       sprd_hwc_window->prev_validated_type = TDM_COMPOSITION_NONE;
 
        if (info)
                memcpy(&sprd_hwc_window->info, info, sizeof(tdm_hwc_window_info));
@@ -1915,8 +1890,6 @@ _comp_to_str(tdm_hwc_window_composition composition_type)
 {
        if (composition_type == TDM_COMPOSITION_CLIENT)
                return "CLIENT";
-       else if (composition_type == TDM_COMPOSITION_CLIENT_CANDIDATE)
-               return "CLIENT_CANDIDATE";
        else if (composition_type == TDM_COMPOSITION_DEVICE_CANDIDATE)
                return "DEVICE_CANDIDATE";
        else if (composition_type == TDM_COMPOSITION_DEVICE)
@@ -1947,75 +1920,6 @@ _get_number_of_visible_windows(tdm_sprd_output_data *sprd_output)
        return number;
 }
 
-static void
-_update_windows_previous_type(struct list_head *hwc_wnds)
-{
-       tdm_sprd_hwc_window_data *hw = NULL;
-
-       RETURN_VOID_IF_FAIL(hwc_wnds);
-
-       LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
-               hw->prev_validated_type = hw->validated_type;
-       }
-}
-
-static void
-_reset_windows_to_client(struct list_head *hwc_wnds)
-{
-       tdm_sprd_hwc_window_data *hw = NULL;
-
-       RETURN_VOID_IF_FAIL(hwc_wnds);
-
-       LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
-
-               if (hw->client_type == TDM_COMPOSITION_NONE)
-                       continue;
-
-               if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE_CANDIDATE)
-                       hw->validated_type = TDM_COMPOSITION_CLIENT;
-
-               if (hw->prev_validated_type == TDM_COMPOSITION_CLIENT)
-                       hw->validated_type = TDM_COMPOSITION_CLIENT;
-
-               else if (hw->prev_validated_type == TDM_COMPOSITION_CLIENT_CANDIDATE)
-                       hw->validated_type = TDM_COMPOSITION_CLIENT_CANDIDATE;
-
-               else if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE)
-                       hw->validated_type = TDM_COMPOSITION_CLIENT_CANDIDATE;
-       }
-}
-
-/*
- * If we got at least one device -> client transition or we still have at
- * least one window at the client_candidate state we reset all windows
- * to the client/client_candidate state as it's a reference implementation
- * of the driver
- */
-static int
-_is_reset_to_client_needed(struct list_head *hwc_wnds)
-{
-       tdm_sprd_hwc_window_data *hw = NULL;
-
-       RETURN_VAL_IF_FAIL(hwc_wnds, 0);
-
-       LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
-
-               if (hw->client_type == TDM_COMPOSITION_NONE)
-                       continue;
-
-               /* client_type is kept, as a TDM_COMPOSITION_CLIENT_CANDIDATE, by the client(e20)
-                * till buffer (of this window) being composited to the fb_target */
-               if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE &&
-                               hw->validated_type == TDM_COMPOSITION_CLIENT)
-                       return 1;
-
-               if (hw->client_type == TDM_COMPOSITION_CLIENT_CANDIDATE)
-                       return 1;
-       }
-
-       return 0;
-}
-
 tdm_error
 sprd_output_hwc_validate(tdm_output *output, uint32_t *num_types)
 {
@@ -2028,7 +1932,6 @@ sprd_output_hwc_validate(tdm_output *output, uint32_t *num_types)
        int need_target_buffer = 0;
        int is_client_detected = 0;
        int max_hw_layer = HW_LAYER_NUM;
-       int need_reset_wnds_to_client;
 
        sprd_data = sprd_output->sprd_data;
        RETURN_VAL_IF_FAIL(sprd_data != NULL, TDM_ERROR_INVALID_PARAMETER);
@@ -2090,18 +1993,6 @@ sprd_output_hwc_validate(tdm_output *output, uint32_t *num_types)
        if (is_client_detected)
                need_target_buffer = 1;
 
-       need_reset_wnds_to_client =
-                       _is_reset_to_client_needed(&sprd_output->hwc_window_list);
-
-       if (need_reset_wnds_to_client) {
-               _reset_windows_to_client(&sprd_output->hwc_window_list);
-
-               /* restore previous value */
-               need_target_buffer = sprd_output->need_target_buffer;
-       }
-
-       _update_windows_previous_type(&sprd_output->hwc_window_list);
-
        LIST_FOR_EACH_ENTRY(hw, &sprd_output->hwc_window_list, link) {
                if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;