[COMMON] fimc-is2: divide mcsc cur_setfile by instance
authorWooyeon Kim <wooy88.kim@samsung.com>
Wed, 27 Mar 2019 09:16:22 +0000 (18:16 +0900)
committerlingsen1 <lingsen1@lenovo.com>
Mon, 10 Jun 2019 03:24:52 +0000 (11:24 +0800)
 PR JIRA ID: CPR-880

CRs-fixed: (CR)

Change-Id: Id5119ff5bee7716de1cc38b4efabc262d6fc461b
Signed-off-by: Wooyeon Kim <wooy88.kim@samsung.com>
Reviewed-on: https://gerrit.mot.com/1328889
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Dawei Wang <wangdw10@motorola.com>
Reviewed-by: Zhichao Chen <chenzc2@motorola.com>
Submit-Approved: Jira Key

drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.c
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-mcscaler-v2.h
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c

index 80145323a1943147c97fea2b87e62afc16cadeed..9958c38365a76326df0a2a300bda57948dc59d35 100644 (file)
@@ -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
index 4663eac738117d92dfc8de6a8026bfd6b2f91de2..17a5802f473b78d470f545558373ba3963349a1d 100644 (file)
@@ -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;
index 9ea4157f1d81cdc520406ac5586d8ba81dfb85de..a0d64eaa6861d917b1217fcc0f43100cabe8f69f 100644 (file)
@@ -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
 
index 1f41426a027cfa5758927e46b4f6853ec3cfca03..18f911acd639923b637f83fc638617204d7520c2 100644 (file)
@@ -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",