Fix checking wrong property id of pp. 27/63727/2
authorAndrii Sokolenko <a.sokolenko@samsung.com>
Fri, 25 Mar 2016 10:24:38 +0000 (12:24 +0200)
committerAndrii Sokolenko <a.sokolenko@samsung.com>
Fri, 25 Mar 2016 11:19:01 +0000 (13:19 +0200)
Change-Id: I23bb8a40ad0960e1ef26e4e8a8a87342428e8304
Signed-off-by: Andrii Sokolenko <a.sokolenko@samsung.com>
src/tdm_sprd_pp.c

index ca6700f..4e4d684 100755 (executable)
@@ -509,22 +509,27 @@ _sprd_pp_make_roadmap(tdm_sprd_pp_data *pp_data, tdm_info_pp *info)
                         height_leap_size = 0, width_leap_size = 0, i, max_size;
        TDM_DBG("Height %u", info->src_config.pos.h);
        unsigned int dst_height = (info->transform % 2 == 0) ? info->dst_config.pos.h : info->dst_config.pos.w;
+       //unsigned int dst_height = info->dst_config.pos.h;
        if (_sprd_pp_get_scale_leap(info->src_config.pos.h,
                                                                dst_height,
-                                                               height_leap, &height_leap_size) != TDM_ERROR_NONE) {
+                                                               (info->transform % 2 == 0)? height_leap : width_leap,
+                                                               (info->transform % 2 == 0)? &height_leap_size: &width_leap_size) != TDM_ERROR_NONE) {
                TDM_ERR("height %u -> %u ratio out of range", info->src_config.pos.h,
                                info->dst_config.pos.h);
                return TDM_ERROR_OPERATION_FAILED;
        }
        TDM_DBG("Width %u", info->src_config.pos.w);
        unsigned int dst_width = (info->transform % 2 == 0) ? info->dst_config.pos.w : info->dst_config.pos.h;
+       //unsigned int dst_width = info->dst_config.pos.w;
        if (_sprd_pp_get_scale_leap(info->src_config.pos.w,
                                                                dst_width,
-                                                               width_leap, &width_leap_size) != TDM_ERROR_NONE) {
+                                                               (info->transform % 2 == 0)? width_leap : height_leap,
+                                                               (info->transform % 2 == 0)? &width_leap_size : &height_leap_size) != TDM_ERROR_NONE) {
                TDM_ERR("width %u -> %u ratio out of range", info->src_config.pos.w,
                                info->dst_config.pos.w);
                return TDM_ERROR_OPERATION_FAILED;
        }
+
        memcpy(&pp_data->roadmap.step_info[0], info, sizeof(tdm_info_pp));
        pp_data->roadmap.step_info[0].dst_config.pos.h = height_leap[0];
        pp_data->roadmap.step_info[0].dst_config.pos.w = width_leap[0];
@@ -556,6 +561,8 @@ _sprd_pp_make_roadmap(tdm_sprd_pp_data *pp_data, tdm_info_pp *info)
                }
        }
        pp_data->roadmap.step_info[max_size - 1].dst_config = info->dst_config;
+       pp_data->roadmap.step_info[max_size - 1].dst_config.pos.h = height_leap[height_leap_size-1];
+       pp_data->roadmap.step_info[max_size - 1].dst_config.pos.w = width_leap[width_leap_size - 1];
        pp_data->roadmap.max_step = max_size;
        return TDM_ERROR_NONE;
 }
@@ -664,7 +671,7 @@ sprd_pp_commit(tdm_pp *pp)
                }
                for (i = 0; i < pp_data->roadmap.max_step; i++) {
                        pp_data->roadmap.prop_id[i] = _tdm_sprd_pp_set(pp_data, &pp_data->roadmap.step_info[i], pp_data->roadmap.prop_id[i]);
-                       if (pp_data->roadmap.prop_id <= 0) {
+                       if (pp_data->roadmap.prop_id[i] <= 0) {
                                TDM_ERR("Can't setup pp");
                                return TDM_ERROR_BAD_REQUEST;
                        }