hwc: add _can_set_hwc_window_on_hw_layer static func 78/162978/1
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Wed, 6 Dec 2017 14:10:42 +0000 (16:10 +0200)
committerKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Wed, 6 Dec 2017 14:10:42 +0000 (16:10 +0200)
Change-Id: I0791ab7fe271dc9de52b5a7c87d4f4b6865bd9d8
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
src/tdm_exynos_output.c

index 1633950afeecfdce7301b92cc835bf861592242d..72c2f6919d4710a6d9680d1fe4462a49f054b391 100644 (file)
@@ -1454,6 +1454,26 @@ _reset_composition_types(struct list_head *hwc_window_list)
        }
 }
 
+static int
+_can_set_hwc_window_on_hw_layer(tdm_exynos_hwc_window_data *hw)
+{
+       if (!hw->surface)
+               return 0;
+
+       if (hw->info.transform != TDM_TRANSFORM_NORMAL)
+               return 0;
+
+       if (hw->info.src_config.pos.w != hw->info.dst_pos.w)
+               return 0;
+
+       if (hw->info.src_config.pos.h != hw->info.dst_pos.h)
+               return 0;
+
+       if (!IS_RGB(hw->info.src_config.format))
+               return 0;
+
+       return 1;
+}
 static void
 _map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
 {
@@ -1477,7 +1497,7 @@ _map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
                        layer_zpos--;
                        if (hw->client_type == TDM_COMPOSITION_DEVICE && layer_zpos != primary_layer_zpos) {
                                /* check format */
-                               if (IS_RGB(hw->info.src_config.format)) {
+                               if (_can_set_hwc_window_on_hw_layer(hw)) {
                                        hw->validated_type = TDM_COMPOSITION_DEVICE;
                                        num_unmarked_layers--;
                                        hw->assigned_layer_zpos = layer_zpos;
@@ -1516,7 +1536,7 @@ _map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
                if ((hw->client_type == TDM_COMPOSITION_DEVICE)
                        && layer_zpos < max_hw_layer_zpos) {
                        /* check format */
-                       if (IS_RGB(hw->info.src_config.format)) {
+                       if (_can_set_hwc_window_on_hw_layer(hw)) {
                                hw->validated_type = TDM_COMPOSITION_DEVICE;
                                hw->assigned_layer_zpos = layer_zpos;
                                continue;