hwc: initialize the validated_types at validation 23/191823/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Oct 2018 09:52:46 +0000 (18:52 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 23 Oct 2018 11:48:28 +0000 (20:48 +0900)
Change-Id: I1139ee2600de06cf0dd8afad380e323bb4002f2b

src/tdm_sprd_hwc.c

index 540a0c2..b307a75 100644 (file)
@@ -133,7 +133,7 @@ _sprd_get_number_of_visible_windows(tdm_sprd_hwc_data *hwc_data)
        RETURN_VAL_IF_FAIL(hwc_data, 0);
 
        LIST_FOR_EACH_ENTRY(window, &hwc_data->hwc_window_list, link) {
-               if (window->client_type == TDM_COMPOSITION_NONE)
+               if (window->validated_type == TDM_COMPOSITION_NONE)
                        continue;
 
                number++;
@@ -343,6 +343,7 @@ tdm_error
 sprd_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_wnds, uint32_t *num_types)
 {
        tdm_sprd_hwc_data *hwc_data = hwc;
+       tdm_sprd_hwc_window_data *hwc_window_data = NULL;
        tdm_sprd_hwc_window_data **composited_list = NULL;
        int i = 0, zpos = 0;
 
@@ -353,6 +354,14 @@ sprd_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_w
 
        hwc_data->need_target_window = 1;
 
+       /* initialize the validated_types */
+       LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &hwc_data->hwc_window_list, link) {
+               if (hwc_window_data->validated_type == TDM_COMPOSITION_NONE)
+                       continue;
+
+               hwc_window_data->validated_type = TDM_COMPOSITION_NONE;
+       }
+
        if (num_wnds == 0) {
                hwc_data->need_target_window = 1;
        } else if (num_wnds == 1) {
@@ -472,14 +481,6 @@ sprd_hwc_accept_changes(tdm_hwc *hwc)
 
        RETURN_VAL_IF_FAIL(hwc_data != NULL, TDM_ERROR_INVALID_PARAMETER);
 
-       tdm_sprd_hwc_window_data *hwc_window_data = NULL;
-       LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &hwc_data->hwc_window_list, link) {
-               if (hwc_window_data->client_type == TDM_COMPOSITION_NONE)
-                       continue;
-
-               hwc_window_data->client_type = hwc_window_data->validated_type;
-       }
-
        return TDM_ERROR_NONE;
 }