hwc: change the variable from i to lzpos 86/201686/2
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 19 Mar 2019 01:46:17 +0000 (10:46 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 19 Mar 2019 02:20:19 +0000 (11:20 +0900)
Change-Id: Id9fb11c3c01e57205611be663aef4c24bd7b34fb

src/tdm_sprd_hwc.c

index 17d4675..0bdf783 100644 (file)
@@ -168,7 +168,7 @@ _sprd_hwc_prepare_commit(tdm_sprd_hwc_data *hwc_data)
        tdm_sprd_hwc_window_data *hwc_window_data = NULL;
        tdm_sprd_layer_data *layer_data = NULL;
        int use_layers_zpos[NUM_LAYERS] = {0,};
-       int i;
+       int lzpos = 0;
 
        /* set target hwc window to the layer */
        if (hwc_data->need_target_window) {
@@ -180,8 +180,9 @@ _sprd_hwc_prepare_commit(tdm_sprd_hwc_data *hwc_data)
        /* set the hwc_windows to the layers */
        LIST_FOR_EACH_ENTRY_REV(hwc_window_data, &hwc_data->hwc_window_list, link) {
                if (hwc_window_data->validated_type == TDM_HWC_WIN_COMPOSITION_NONE ||
-                   hwc_window_data->validated_type == TDM_HWC_WIN_COMPOSITION_CLIENT)
+                       hwc_window_data->validated_type == TDM_HWC_WIN_COMPOSITION_CLIENT)
                        continue;
+
                if (hwc_window_data == hwc_data->target_hwc_window)
                        continue;
 
@@ -191,14 +192,20 @@ _sprd_hwc_prepare_commit(tdm_sprd_hwc_data *hwc_data)
        }
 
        /* unset the unused layers */
-       for (i = 0; i < NUM_LAYERS; i++) {
-               if (use_layers_zpos[i])
+       for (lzpos = 0; lzpos < NUM_LAYERS; lzpos++) {
+               if (use_layers_zpos[lzpos])
                        continue;
 
-               layer_data = tdm_sprd_output_get_layer(hwc_data->output_data, use_layers_zpos[i]);
+               layer_data = tdm_sprd_output_get_layer(hwc_data->output_data, use_layers_zpos[lzpos]);
                _sprd_hwc_layer_attach_window(layer_data, NULL);
        }
 
+       /* for debug */
+       for (lzpos = NUM_LAYERS -1 ; lzpos >= 0; lzpos--) {
+               if (use_layers_zpos[lzpos])
+                       TDM_DBG(" lzpos(%d) : %s", lzpos, use_layers_zpos[lzpos] ? "SET" : "UNSET");
+       }
+
        return TDM_ERROR_NONE;
 }