From 58e35d35be720cace6dc3d46b793ab09c313f122 Mon Sep 17 00:00:00 2001 From: Wooyeon Kim Date: Wed, 27 Mar 2019 18:16:22 +0900 Subject: [PATCH] [COMMON] fimc-is2: divide mcsc cur_setfile by instance PR JIRA ID: CPR-880 Change-Id: Id5119ff5bee7716de1cc38b4efabc262d6fc461b Signed-off-by: Wooyeon Kim --- .../fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c | 17 +++++++++-------- .../fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h | 2 +- .../fimc-is2/hardware/fimc-is-hw-tdnr-v2.c | 4 ++-- .../fimc-is2/hardware/fimc-is-hw-uvsp-cac.c | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c index 80145323a194..9958c38365a7 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c @@ -269,7 +269,7 @@ int check_sc_core_running(struct fimc_is_hw_ip *hw_ip, struct fimc_is_hw_mcsc_ca static int fimc_is_hw_mcsc_open(struct fimc_is_hw_ip *hw_ip, u32 instance, struct fimc_is_group *group) { - int ret = 0, i; + int ret = 0, i, j; struct fimc_is_hw_mcsc *hw_mcsc; struct fimc_is_hw_mcsc_cap *cap; u32 output_id; @@ -314,9 +314,10 @@ static int fimc_is_hw_mcsc_open(struct fimc_is_hw_ip *hw_ip, u32 instance, msdbg_hw(2, "open: [G:0x%x], framemgr[%s]", instance, hw_ip, GROUP_ID(group->id), hw_ip->framemgr->name); - for (i = 0; i < SENSOR_POSITION_MAX; i++) - hw_mcsc->cur_setfile[i] = NULL; - + for (i = 0; i < SENSOR_POSITION_MAX; i++) { + for (j = 0; j < FIMC_IS_STREAM_COUNT; j++) + hw_mcsc->cur_setfile[i][j] = NULL; + } if (check_sc_core_running(hw_ip, cap)) return 0; @@ -1198,7 +1199,7 @@ static int fimc_is_hw_mcsc_apply_setfile(struct fimc_is_hw_ip *hw_ip, u32 scenar hw_mcsc = (struct fimc_is_hw_mcsc *)hw_ip->priv_info; - hw_mcsc->cur_setfile[sensor_position] = + hw_mcsc->cur_setfile[sensor_position][instance] = &hw_mcsc->setfile[sensor_position][setfile_index]; msinfo_hw("setfile (%d) scenario (%d)\n", instance, hw_ip, @@ -1625,7 +1626,7 @@ int fimc_is_hw_mcsc_poly_phase(struct fimc_is_hw_ip *hw_ip, struct param_mcs_inp vratio = (u32)((temp_height << MCSC_PRECISION) / poly_dst_height); sensor_position = hw_ip->hardware->sensor_position[instance]; - setfile = hw_mcsc->cur_setfile[sensor_position]; + setfile = hw_mcsc->cur_setfile[sensor_position][instance]; #if defined(USE_UVSP_CAC) sc_coef = &setfile->sc_coef; #else @@ -1701,7 +1702,7 @@ int fimc_is_hw_mcsc_post_chain(struct fimc_is_hw_ip *hw_ip, struct param_mcs_inp vratio = (u32)((temp_height << MCSC_PRECISION) / dst_height); sensor_position = hw_ip->hardware->sensor_position[instance]; - setfile = hw_mcsc->cur_setfile[sensor_position]; + setfile = hw_mcsc->cur_setfile[sensor_position][instance]; #if defined(USE_UVSP_CAC) sc_coef = &setfile->sc_coef; #else @@ -2118,7 +2119,7 @@ int fimc_is_hw_mcsc_output_yuvrange(struct fimc_is_hw_ip *hw_ip, struct param_mc hw_mcsc->yuv_range = yuv; /* save for ISP */ sensor_position = hw_ip->hardware->sensor_position[instance]; - setfile = hw_mcsc->cur_setfile[sensor_position]; + setfile = hw_mcsc->cur_setfile[sensor_position][instance]; #if defined(USE_UVSP_CAC) sc_bchs = &setfile->sc_bchs[yuv]; #else diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h index 4663eac73811..17a5802f473b 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h @@ -185,7 +185,7 @@ struct fimc_is_hw_mcsc_cap { #define SUBBLK_MAX (3) struct fimc_is_hw_mcsc { struct hw_mcsc_setfile setfile[SENSOR_POSITION_MAX][FIMC_IS_MAX_SETFILE]; - struct hw_mcsc_setfile *cur_setfile[SENSOR_POSITION_MAX]; + struct hw_mcsc_setfile *cur_setfile[SENSOR_POSITION_MAX][FIMC_IS_STREAM_COUNT]; struct fimc_is_hw_mcsc_cap cap; u32 in_img_format; diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c index 9ea4157f1d81..a0d64eaa6861 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c @@ -171,7 +171,7 @@ static int fimc_is_hw_mcsc_check_tdnr_mode_pre(struct fimc_is_hw_ip *hw_ip, */ #ifdef MCSC_DNR_USE_TUNING sensor_position = hw_ip->hardware->sensor_position[atomic_read(&hw_ip->instance)]; - tdnr_tuneset = &hw_mcsc->cur_setfile[sensor_position]->tdnr_contents; + tdnr_tuneset = &hw_mcsc->cur_setfile[sensor_position][frame->instance]->tdnr_contents; setfile_tdnr_enable = tdnr_tuneset->tdnr_enable; #endif @@ -863,7 +863,7 @@ static int fimc_is_hw_mcsc_cfg_tdnr_tuning_param(struct fimc_is_hw_ip *hw_ip, #ifdef MCSC_DNR_USE_TUNING instance = atomic_read(&hw_ip->instance); sensor_position = hw_ip->hardware->sensor_position[instance]; - tdnr_tuneset = &hw_mcsc->cur_setfile[sensor_position]->tdnr_contents; + tdnr_tuneset = &hw_mcsc->cur_setfile[sensor_position][frame->instance]->tdnr_contents; use_tdnr_tuning = true; #endif diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c index 1f41426a027c..18f911acd639 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c @@ -187,7 +187,7 @@ int fimc_is_hw_mcsc_update_cac_register(struct fimc_is_hw_ip *hw_ip, } sensor_position = hw_ip->hardware->sensor_position[instance]; - setfile = hw_mcsc->cur_setfile[sensor_position]; + setfile = hw_mcsc->cur_setfile[sensor_position][instance]; /* calculate cac parameters */ #ifdef FIXED_TDNR_NOISE_INDEX @@ -536,7 +536,7 @@ int fimc_is_hw_mcsc_update_uvsp_register(struct fimc_is_hw_ip *hw_ip, return ret; sensor_position = hw_ip->hardware->sensor_position[instance]; - setfile = hw_mcsc->cur_setfile[sensor_position]; + setfile = hw_mcsc->cur_setfile[sensor_position][instance]; cal_info = &hw_ip->hardware->cal_info[sensor_position]; sdbg_hw(10, "TEST: get_lnr_intprl(11, 20, 1, 1, 3) = %d\n", -- 2.20.1