hwc: add cursor support 51/164151/3
authorKonstantin Drabeniuk <k.drabeniuk@samsung.com>
Fri, 15 Dec 2017 15:58:33 +0000 (17:58 +0200)
committerSooChan Lim <sc1.lim@samsung.com>
Sat, 16 Dec 2017 03:13:16 +0000 (12:13 +0900)
Change-Id: I5526a04a3e8169eccced84fcdba14ead3b64d62a
Signed-off-by: Konstantin Drabeniuk <k.drabeniuk@samsung.com>
src/tdm_exynos.c
src/tdm_exynos_output.c

index 55622d8951c88aa847305f7b14b25d2293a21021..291a75285f1e1c0b720df50809e8f96175cfaec5 100644 (file)
@@ -470,7 +470,7 @@ failed:
 tdm_backend_module tdm_backend_module_data = {
        "exynos",
        "Samsung",
-       TDM_BACKEND_ABI_VERSION,
+       TDM_BACKEND_SET_ABI_VERSION(1, 5),
        tdm_exynos_init,
        tdm_exynos_deinit
 };
index 6b2f854a0846d9bcbcd7bea0ab8c7a4958ad3339..f083662913c632440bae2da7f40e5430a48731fa 100644 (file)
@@ -882,7 +882,9 @@ _find_maped_hwc_window_to_layer(struct list_head *hwc_wnds, int layer_zpos)
                        continue;
 
                if (hw->assigned_layer_zpos == layer_zpos &&
-                       (hw->validated_type == TDM_COMPOSITION_DEVICE || hw->is_device_to_client_transition))
+                       (hw->validated_type == TDM_COMPOSITION_DEVICE ||
+                        hw->validated_type == TDM_COMPOSITION_CURSOR ||
+                        hw->is_device_to_client_transition))
                        return hw;
        }
 
@@ -1480,6 +1482,13 @@ _can_set_hwc_window_on_hw_layer(tdm_exynos_hwc_window_data *hw)
        if (!IS_RGB(hw->info.src_config.format))
                return 0;
 
+       if (hw->info.dst_pos.x > hw->output_data->current_mode->hdisplay ||
+               hw->info.dst_pos.y > hw->output_data->current_mode->vdisplay)
+               return 0;
+
+       if (hw->info.src_config.pos.w < MIN_WIDTH || hw->info.src_config.pos.w % 2)
+               return 0;
+
        return 1;
 }
 
@@ -1539,9 +1548,10 @@ _map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
                         * will be mapped in the next iteration) or the composition type of
                         * current hwc_window is not TDM_COMPOSITION_DEVICE or hwc_window cannot
                         * be set on hw layer*/
-                       if (hw->client_type == TDM_COMPOSITION_DEVICE && layer_zpos != primary_layer_zpos) {
+                       if ((hw->client_type == TDM_COMPOSITION_DEVICE || hw->client_type == TDM_COMPOSITION_CURSOR) &&
+                               layer_zpos != primary_layer_zpos) {
                                if (_can_set_hwc_window_on_hw_layer(hw)) {
-                                       hw->validated_type = TDM_COMPOSITION_DEVICE;
+                                       hw->validated_type = hw->client_type;
                                        num_unmarked_layers--;
                                        hw->assigned_layer_zpos = layer_zpos;
                                        continue;
@@ -1585,7 +1595,7 @@ _map_hwc_windows_to_layers(tdm_exynos_output_data *exynos_output)
                layer_zpos++;
                /* break if the remaining windows are already marked in the
                 * previous iteration */
-               if (hw->validated_type == TDM_COMPOSITION_DEVICE)
+               if (hw->validated_type == TDM_COMPOSITION_DEVICE || hw->validated_type == TDM_COMPOSITION_CURSOR)
                        break;
                /* break if we have reached max hw layer or the composition type of
                 * current hwc_window is not TDM_COMPOSITION_DEVICE or hwc_window cannot
@@ -1651,7 +1661,7 @@ _print_validate_result(tdm_exynos_output_data *exynos_output)
                if (hw->client_type == TDM_COMPOSITION_NONE)
                        continue;
 
-               if (hw->validated_type == TDM_COMPOSITION_DEVICE)
+               if (hw->validated_type == TDM_COMPOSITION_DEVICE || hw->validated_type == TDM_COMPOSITION_CURSOR)
                        TDM_DBG(" window(%p) type: %s -> %s : is mapped to layer with %d zpos", hw,
                                        _comp_to_str(hw->client_type), _comp_to_str(hw->validated_type),
                                        hw->assigned_layer_zpos);