hwc: add print_validate_result 20/193120/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 15 Nov 2018 02:01:52 +0000 (11:01 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 15 Nov 2018 02:01:52 +0000 (11:01 +0900)
Change-Id: I6f93877c15e76e152d34e2a7928a5c819c9308ba

src/tdm_sprd_hwc.c

index a5723b8..3171c1e 100644 (file)
@@ -11,6 +11,53 @@ tbm_format hwc_window_video_formats[] = {
        TBM_FORMAT_YUV420
 };
 
+const char *
+_comp_to_str(tdm_hwc_window_composition composition_type)
+{
+       if (composition_type == TDM_HWC_WIN_COMPOSITION_CLIENT)
+               return "CLIENT";
+       else if (composition_type == TDM_HWC_WIN_COMPOSITION_DEVICE)
+               return "DEVICE";
+       else if (composition_type == TDM_HWC_WIN_COMPOSITION_CURSOR)
+               return "CURSOR";
+       else if (composition_type == TDM_HWC_WIN_COMPOSITION_VIDEO)
+               return "VIDEO";
+       else if (composition_type == TDM_HWC_WIN_COMPOSITION_NONE)
+               return "SKIP";
+
+       return "unknown";
+}
+
+static void
+_print_validate_result(tdm_sprd_hwc_data *hwc_data, tdm_hwc_window **composited_wnds, uint32_t num_wnds)
+{
+       tdm_sprd_hwc_window_data *hwc_window_data = NULL;
+       int i;
+
+       for (i = 0; i < num_wnds; i++) {
+               hwc_window_data = composited_wnds[i];
+               switch (hwc_window_data->validated_type) {
+                       case TDM_HWC_WIN_COMPOSITION_CLIENT:
+                               TDM_DBG(" window(%p) %s -> %s : lzpos(%d) on TARGET WINDOW", hwc_window_data,
+                                               _comp_to_str(hwc_window_data->client_type),
+                                               _comp_to_str(hwc_window_data->validated_type),
+                                           hwc_data->target_hwc_window->zpos);
+                               break;
+                       case TDM_HWC_WIN_COMPOSITION_DEVICE:
+                       case TDM_HWC_WIN_COMPOSITION_VIDEO:
+                       case TDM_HWC_WIN_COMPOSITION_CURSOR:
+                       case TDM_HWC_WIN_COMPOSITION_NONE:
+                               TDM_DBG(" window(%p) %s -> %s : lzpos(%d)", hwc_window_data,
+                                               _comp_to_str(hwc_window_data->client_type),
+                                               _comp_to_str(hwc_window_data->validated_type),
+                                           hwc_window_data->zpos);
+                               break;
+                       default:
+                               break;
+               }
+       }
+}
+
 static int
 _sprd_hwc_window_is_reserved_buffer(tdm_sprd_hwc_window_data *hwc_window_data) {
        tbm_bo bo = NULL;
@@ -432,6 +479,9 @@ sprd_hwc_validate(tdm_hwc *hwc, tdm_hwc_window **composited_wnds, uint32_t num_w
 
        *num_types = _sprd_output_get_changed_number(hwc_data);
 
+       /* print the result */
+       _print_validate_result(hwc_data, composited_wnds, num_wnds);
+
        return TDM_ERROR_NONE;
 }