hwc: set need_target_window if there are no visible hwc_windows 92/164492/2
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Tue, 19 Dec 2017 09:04:28 +0000 (11:04 +0200)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 19 Dec 2017 23:35:44 +0000 (23:35 +0000)
Change-Id: Ia2bc21752ec662fafbf5ba44e5b9b23c8dd3bf24
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
src/tdm_exynos_output.c

index c0094cb629bbf57a48248ed400ccf9f3b7a8ee15..52d86de17f0d0e54a99f0f5abad9e46384187cea 100644 (file)
@@ -976,6 +976,21 @@ _is_device_to_client_transition(struct list_head *hwc_window_list)
        return 0;
 }
 
+static int
+_get_number_of_visible_windows(struct list_head *hwc_window_list)
+{
+       int number = 0;
+       tdm_exynos_hwc_window_data *window = NULL;
+
+       LIST_FOR_EACH_ENTRY(window, hwc_window_list, link) {
+               if (window->client_type == TDM_COMPOSITION_NONE)
+                       continue;
+               number++;
+       }
+
+       return number;
+}
+
 static tdm_error
 _tdm_exynos_display_prepare_commit(tdm_exynos_output_data *output_data) {
 
@@ -986,6 +1001,9 @@ _tdm_exynos_display_prepare_commit(tdm_exynos_output_data *output_data) {
 
        RETURN_VAL_IF_FAIL(output_data->need_validate == 0, TDM_ERROR_OPERATION_FAILED);
 
+       if (!_get_number_of_visible_windows(&output_data->hwc_window_list))
+               output_data->need_target_window = 1;
+
        /* set target hwc window */
        if (output_data->need_target_window) {
                layer = _exynos_output_get_layer(output_data, primary_layer_zpos);
@@ -1425,21 +1443,6 @@ _comp_to_str(tdm_hwc_window_composition composition_type)
        return "unknown";
 }
 
-static int
-_get_number_of_visible_windows(struct list_head *hwc_window_list)
-{
-       int number = 0;
-       tdm_exynos_hwc_window_data *window = NULL;
-
-       LIST_FOR_EACH_ENTRY(window, hwc_window_list, link) {
-               if (window->client_type == TDM_COMPOSITION_NONE)
-                       continue;
-               number++;
-       }
-
-       return number;
-}
-
 /* If there is only 1 visible hwc_window it should be placed on the
  * primary layer. The primary layer should always be used.
  */