hwc: use TDM_COMPOSITION_NONE instead of TDM_HWC_WINDOW_FLAG_SKIP 84/161484/5
authorRoman Marchenko <r.marchenko@samsung.com>
Thu, 23 Nov 2017 13:41:11 +0000 (15:41 +0200)
committerRoman Marchenko <r.marchenko@samsung.com>
Fri, 24 Nov 2017 06:29:01 +0000 (08:29 +0200)
Change-Id: Iadf5b265a52cef5b6577bb193982d9adeb7371d0
Signed-off-by: Roman Marchenko <r.marchenko@samsung.com>
src/tdm_sprd_display.c

index 5aa7af4..66bae8b 100644 (file)
@@ -1204,7 +1204,7 @@ _are_windows_with_client_candidate_type(struct list_head *hwc_wnds)
 
        LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
 
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                if (hw->validated_type == TDM_COMPOSITION_CLIENT_CANDIDATE)
@@ -1234,7 +1234,7 @@ _tdm_sprd_display_prepare_commit(tdm_sprd_output_data *output_data) {
 
        /* set hwc windows */
        LIST_FOR_EACH_ENTRY_REV(hw, &output_data->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
                if (hw->client_type != TDM_COMPOSITION_DEVICE && hw->client_type != TDM_COMPOSITION_VIDEO)
                        continue;
@@ -1809,7 +1809,7 @@ _sprd_output_get_changed_number(tdm_sprd_output_data *sprd_output)
        RETURN_VAL_IF_FAIL(sprd_output, TDM_ERROR_INVALID_PARAMETER);
 
        LIST_FOR_EACH_ENTRY(hw, &sprd_output->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                if (hw->client_type != hw->validated_type)
@@ -1851,7 +1851,7 @@ _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_CLIENT;
+       sprd_hwc_window->prev_validated_type = TDM_COMPOSITION_NONE;
 
        if (info)
                memcpy(&sprd_hwc_window->info, info, sizeof(tdm_hwc_window_info));
@@ -1915,6 +1915,8 @@ _comp_to_str(tdm_hwc_window_composition composition_type)
                return "CURSOR";
        else if (composition_type == TDM_COMPOSITION_VIDEO)
                return "VIDEO";
+       else if (composition_type == TDM_COMPOSITION_NONE)
+               return "NONE";
 
        return "unknown";
 }
@@ -1928,7 +1930,7 @@ _get_number_of_visible_windows(tdm_sprd_output_data *sprd_output)
        RETURN_VAL_IF_FAIL(sprd_output, 0);
 
        LIST_FOR_EACH_ENTRY(window, &sprd_output->hwc_window_list, link) {
-               if (window->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (window->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                number++;
@@ -1945,11 +1947,6 @@ _update_windows_previous_type(struct list_head *hwc_wnds)
        RETURN_VOID_IF_FAIL(hwc_wnds);
 
        LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP) {
-                       hw->prev_validated_type = TDM_COMPOSITION_CLIENT;
-                       continue;
-               }
-
                hw->prev_validated_type = hw->validated_type;
        }
 }
@@ -1963,7 +1960,7 @@ _reset_windows_to_client(struct list_head *hwc_wnds)
 
        LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
 
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                if (hw->prev_validated_type == TDM_COMPOSITION_DEVICE_CANDIDATE)
@@ -1998,7 +1995,7 @@ _is_reset_to_client_needed(struct list_head *hwc_wnds)
 
        LIST_FOR_EACH_ENTRY(hw, hwc_wnds, link) {
 
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                /* client_type is kept, as a TDM_COMPOSITION_CLIENT_CANDIDATE, by the client(e20)
@@ -2043,7 +2040,7 @@ sprd_output_hwc_validate(tdm_output *output, uint32_t *num_types)
        is_client_detected = 0;
        /* check client_type */
        LIST_FOR_EACH_ENTRY(hw, &sprd_output->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                if ((hw->client_type == TDM_COMPOSITION_DEVICE || hw->client_type == TDM_COMPOSITION_VIDEO)
@@ -2062,7 +2059,7 @@ sprd_output_hwc_validate(tdm_output *output, uint32_t *num_types)
        is_client_detected = 0;
        /* check format and flags for DEVICE_CANDIDATE */
        LIST_FOR_EACH_ENTRY(hw, &sprd_output->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                if (hw->validated_type == TDM_COMPOSITION_DEVICE_CANDIDATE) {
@@ -2111,7 +2108,7 @@ sprd_output_hwc_validate(tdm_output *output, uint32_t *num_types)
        _update_windows_previous_type(&sprd_output->hwc_window_list);
 
        LIST_FOR_EACH_ENTRY(hw, &sprd_output->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                TDM_DBG(" window(%p) type: %s -> %s", hw,
@@ -2147,7 +2144,7 @@ sprd_output_hwc_get_changed_composition_types(tdm_output *output,
 
        tdm_sprd_hwc_window_data *hw = NULL;
        LIST_FOR_EACH_ENTRY_REV(hw, &sprd_output->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                if (num >= *num_elements)
@@ -2175,7 +2172,7 @@ sprd_output_hwc_accept_changes(tdm_output *output)
 
        tdm_sprd_hwc_window_data *hw = NULL;
        LIST_FOR_EACH_ENTRY_REV(hw, &sprd_output->hwc_window_list, link) {
-               if (hw->flags & TDM_HWC_WINDOW_FLAG_SKIP)
+               if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
                hw->client_type = hw->validated_type;
@@ -2303,6 +2300,8 @@ sprd_hwc_window_set_composition_type(tdm_hwc_window *hwc_window,
                return TDM_ERROR_NONE;
 
        sprd_hwc_window->client_type = comp_type;
+       if (comp_type == TDM_COMPOSITION_NONE)
+               sprd_hwc_window->validated_type = comp_type;
        sprd_output->need_validate = 1;
 
        return TDM_ERROR_NONE;