hwc: fix the typo and the comments 85/201685/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 19 Mar 2019 01:45:46 +0000 (10:45 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 19 Mar 2019 01:45:46 +0000 (10:45 +0900)
Change-Id: Icb1d59ee5d2a6947e89a24a50fb631f409c328b9

src/tdm_sprd_hwc.c
src/tdm_sprd_hwc_window.c

index 1175132..17d4675 100644 (file)
@@ -111,19 +111,22 @@ _sprd_hwc_window_get_tbm_surface_queue(tdm_hwc_window *hwc_window, tdm_error *er
 {
        tdm_sprd_hwc_window_data *hwc_window_data = NULL;
        tbm_surface_queue_h tqueue = NULL;
+       int width, height;
+       tbm_format format;
 
        if (error)
                *error = TDM_ERROR_INVALID_PARAMETER;
 
        RETURN_VAL_IF_FAIL(hwc_window != NULL, NULL);
+
        hwc_window_data = hwc_window;
 
-       int wight = hwc_window_data->info.src_config.size.h;
-       int hight = hwc_window_data->info.src_config.size.v;
-       tbm_format format = hwc_window_data->info.src_config.format;
+       width = hwc_window_data->info.src_config.size.h;
+       height = hwc_window_data->info.src_config.size.v;
+       format = hwc_window_data->info.src_config.format;
 
        if (!hwc_window_data->tqueue) {
-               tqueue = tbm_surface_queue_create(NUM_BUFFERS, wight, hight, format, TBM_BO_SCANOUT);
+               tqueue = tbm_surface_queue_create(NUM_BUFFERS, width, height, format, TBM_BO_SCANOUT);
                if (error)
                        *error = TDM_ERROR_OPERATION_FAILED;
                RETURN_VAL_IF_FAIL(tqueue != NULL, NULL);
@@ -167,14 +170,14 @@ _sprd_hwc_prepare_commit(tdm_sprd_hwc_data *hwc_data)
        int use_layers_zpos[NUM_LAYERS] = {0,};
        int i;
 
-       /* set target hwc window */
+       /* set target hwc window to the layer */
        if (hwc_data->need_target_window) {
                layer_data = tdm_sprd_output_get_layer(hwc_data->output_data, ZPOS_OSD);
                _sprd_hwc_layer_attach_window(layer_data, hwc_data->target_hwc_window);
                use_layers_zpos[hwc_data->target_hwc_window->lzpos] = 1;
        }
 
-       /* set hwc windows */
+       /* 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)
@@ -199,6 +202,9 @@ _sprd_hwc_prepare_commit(tdm_sprd_hwc_data *hwc_data)
        return TDM_ERROR_NONE;
 }
 
+/* assign the validated_type to the composited_wnds
+ * assign the layer_zpos to the composited_wnds
+ */
 static void
 _sprd_hwc_apply_policy(tdm_sprd_hwc_data *hwc_data , tdm_hwc_window **composited_wnds, uint32_t num_wnds)
 {
@@ -436,6 +442,7 @@ sprd_hwc_get_client_target_buffer_queue(tdm_hwc *hwc, tdm_error *error)
 
        if (error)
                *error = TDM_ERROR_NONE;
+
        return tqueue;
 }
 
@@ -445,9 +452,6 @@ sprd_hwc_set_client_target_buffer(tdm_hwc *hwc, tbm_surface_h buffer, tdm_region
        tdm_sprd_hwc_data *hwc_data = hwc;
        tdm_error err;
 
-       /* TODO: as the sprd-driver currently doesn't support DEVICE to CLIENT transition.
-        * we silence skip 'composited_wnds' */
-
        RETURN_VAL_IF_FAIL(hwc_data != NULL, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(hwc_data->target_hwc_window  != NULL, TDM_ERROR_OPERATION_FAILED);
 
index 52c5c0c..dd13f1b 100644 (file)
@@ -59,6 +59,7 @@ sprd_hwc_window_set_composition_type(tdm_hwc_window *hwc_window,
        RETURN_VAL_IF_FAIL(hwc_window_data != NULL, TDM_ERROR_INVALID_PARAMETER);
        RETURN_VAL_IF_FAIL(hwc_data != NULL, TDM_ERROR_INVALID_PARAMETER);
 
+       /* change the client_type when it is different from one which has before */
        if (hwc_window_data->client_type == comp_type)
                return TDM_ERROR_NONE;