From: Eunyoung Lee Date: Wed, 7 Mar 2018 05:18:58 +0000 (+0900) Subject: [9610] fimc-is2: modify selecting MCSC OTF output path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d5517be859de38f2075c1392751dc6f9d7798301;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [9610] fimc-is2: modify selecting MCSC OTF output path Change-Id: If4e6f2c322477625fc24db62aae4dea9af666704 Signed-off-by: Eunyoung Lee --- diff --git a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcs.c b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcs.c index 51a74a1d5e26..9f74b137642c 100644 --- a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcs.c +++ b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcs.c @@ -17,6 +17,7 @@ #include "fimc-is-video.h" #include "fimc-is-type.h" +#ifdef USE_VRA_OTF static int fimc_is_ischain_mcs_bypass(struct fimc_is_subdev *leader, void *device_data, struct fimc_is_frame *frame, @@ -74,6 +75,7 @@ find_subdev: p_err: return ret; } +#endif static int fimc_is_ischain_mcs_cfg(struct fimc_is_subdev *leader, void *device_data, @@ -91,7 +93,9 @@ static int fimc_is_ischain_mcs_cfg(struct fimc_is_subdev *leader, struct param_mcs_input *input; struct param_control *control; struct fimc_is_device_ischain *device; +#ifdef USE_VRA_OTF struct fimc_is_subdev *subdev = NULL, *subdev_temp = NULL, *temp; +#endif device = (struct fimc_is_device_ischain *)device_data; @@ -169,6 +173,7 @@ static int fimc_is_ischain_mcs_cfg(struct fimc_is_subdev *leader, goto p_err; } +#ifdef USE_VRA_OTF list_for_each_entry_safe(subdev_temp, temp, &group->subdev_list, list) { if (subdev_temp == &group->leader) continue; @@ -186,6 +191,7 @@ find_subdev: } CALL_SOPS(subdev, cfg, device, frame, incrop, NULL, lindex, hindex, indexes); +#endif p_err: return ret; @@ -267,7 +273,11 @@ p_err: } const struct fimc_is_subdev_ops fimc_is_subdev_mcs_ops = { +#ifdef USE_VRA_OTF .bypass = fimc_is_ischain_mcs_bypass, +#else + .bypass = NULL, +#endif .cfg = fimc_is_ischain_mcs_cfg, .tag = fimc_is_ischain_mcs_tag, }; diff --git a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcsp.c b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcsp.c index 38763e27f6de..e981bb46af21 100644 --- a/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcsp.c +++ b/drivers/media/platform/exynos/fimc-is2/ischain/fimc-is-v6_10_0/fimc-is-subdev-mcsp.c @@ -359,7 +359,7 @@ static int fimc_is_ischain_mxp_stop(struct fimc_is_device_ischain *device, return ret; } -static int fimc_is_ischain_mxp_otf_enable(struct fimc_is_device_ischain *device, +static void fimc_is_ischain_mxp_otf_enable(struct fimc_is_device_ischain *device, struct fimc_is_subdev *subdev, struct fimc_is_frame *frame, struct param_mcs_output *mcs_output, @@ -368,16 +368,46 @@ static int fimc_is_ischain_mxp_otf_enable(struct fimc_is_device_ischain *device, u32 *hindex, u32 *indexes) { - int ret = 0; +#if !defined(USE_VRA_OTF) + struct param_mcs_input *input; - mdbgd_ischain("%s\n", device, __func__); + input = fimc_is_itf_g_param(device, frame, PARAM_MCS_INPUT); mcs_output->otf_cmd = OTF_OUTPUT_COMMAND_ENABLE; + + mcs_output->otf_format = OTF_OUTPUT_FORMAT_YUV422; + mcs_output->otf_bitwidth = OTF_OUTPUT_BIT_WIDTH_8BIT; + mcs_output->otf_order = OTF_OUTPUT_ORDER_BAYER_GR_BG; + + mcs_output->crop_offset_x = 0; + mcs_output->crop_offset_y = 0; + + if (input->otf_cmd == OTF_INPUT_COMMAND_ENABLE) { + mcs_output->crop_width = input->width; + mcs_output->crop_height = input->height; + } else { + mcs_output->crop_width = input->dma_crop_width; + mcs_output->crop_height = input->dma_crop_height; + } + + /* HACK */ + if (mcs_output->crop_width > 640 && mcs_output->crop_height > 480) { + mcs_output->width = mcs_output->crop_width; + mcs_output->height = mcs_output->crop_height; + } else { + mcs_output->width = 640; + mcs_output->height = 480; + } + *lindex |= LOWBIT_OF(index); *hindex |= HIGHBIT_OF(index); (*indexes)++; - return ret; + mdbg_pframe("OTF only enable [%d, %d, %d, %d]-->[%d, %d]\n", device, subdev, frame, + mcs_output->crop_offset_x, mcs_output->crop_offset_y, + mcs_output->crop_width, mcs_output->crop_height, + mcs_output->width, mcs_output->height); +#endif } static int fimc_is_ischain_mxp_tag(struct fimc_is_subdev *subdev, @@ -562,8 +592,8 @@ static int fimc_is_ischain_mxp_tag(struct fimc_is_subdev *subdev, } if ((node->vid - FIMC_IS_VIDEO_M0P_NUM) - == (ldr_frame->shot->uctl.scalerUd.mcsc_sub_blk_port[INTERFACE_TYPE_DS])) { - ret = fimc_is_ischain_mxp_otf_enable(device, + == (ldr_frame->shot->uctl.scalerUd.mcsc_sub_blk_port[INTERFACE_TYPE_DS])) + fimc_is_ischain_mxp_otf_enable(device, subdev, ldr_frame, mcs_output, @@ -571,11 +601,6 @@ static int fimc_is_ischain_mxp_tag(struct fimc_is_subdev *subdev, &lindex, &hindex, &indexes); - if (ret) { - merr("fimc_is_ischain_mxp_otf_enable is fail(%d)", device, ret); - goto p_err; - } - } target_addr[0] = 0; target_addr[1] = 0;