[COMMON] fimc-is2: Code cleanup before adding new feature - hw-mcsc
authorSunmi Lee <carrotsm.lee@samsung.com>
Mon, 11 Jun 2018 07:01:09 +0000 (16:01 +0900)
committerSunyoung Kang <sy0816.kang@samsung.com>
Mon, 23 Jul 2018 08:05:16 +0000 (17:05 +0900)
Change-Id: I46a857df3be5d9dc200b8797b6b140542b7e31f0
Signed-off-by: Sunmi Lee <carrotsm.lee@samsung.com>
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-v1.c
drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-tdnr-v2.c

index 5110a8972e97358811ff42bc2f5b79e8d3fe0676..ffa8e9301811f48c419bb07ffef571d203098b4f 100644 (file)
@@ -256,8 +256,8 @@ void fimc_is_hw_mcsc_hw_info(struct fimc_is_hw_ip *hw_ip, struct fimc_is_hw_mcsc
                return;
 
        sinfo_hw("==== h/w info(ver:0x%X) ====\n", hw_ip, cap->hw_ver);
-       info_hw("[IN] max_out:%d, in(otf/dma):%d/%d, hwfc:%d, tdnr:%d\n",
-                       cap->max_output, cap->in_otf, cap->in_dma, cap->hwfc, cap->tdnr);
+       info_hw("[IN] out:%d, in(otf:%d/dma:%d), hwfc:%d, tdnr:%d, djag:%d, ds_vra:%d, ysum:%d\n",
+               cap->max_output, cap->in_otf, cap->in_dma, cap->hwfc, cap->tdnr, cap->djag, cap->ds_vra, cap->ysum);
        for (i = MCSC_OUTPUT0; i < cap->max_output; i++)
                info_hw("[OUT%d] out(otf/dma):%d/%d, hwfc:%d\n", i,
                        cap->out_otf[i], cap->out_dma[i], cap->out_hwfc[i]);
@@ -343,6 +343,7 @@ static int fimc_is_hw_mcsc_open(struct fimc_is_hw_ip *hw_ip, u32 instance,
                        return 0;
        }
 
+       /* initialize of shared values between MCSC0 and MCSC1 */
        for (output_id = MCSC_OUTPUT0; output_id < cap->max_output; output_id++)
                set_bit(output_id, &hw_mcsc_out_configured);
        clear_bit(HW_MCSC_OUT_CLEARED_ALL, &hw_mcsc_out_configured);
@@ -2275,7 +2276,7 @@ int fimc_is_hw_mcsc_output_yuvrange(struct fimc_is_hw_ip *hw_ip, struct param_mc
        bool config = true;
        struct fimc_is_hw_mcsc *hw_mcsc = NULL;
 #if !defined(USE_YUV_RANGE_BY_ISP)
-       scaler_setfile_contents contents;
+       struct scaler_setfile_contents contents;
 #endif
        struct fimc_is_hw_mcsc_cap *cap = GET_MCSC_HW_CAP(hw_ip);
 
index 272de61652f8cb70ebd82e55f6323d77c2cea3c6..ceee8573574ff86ae767c08c8c4dd45962b3d69f 100644 (file)
@@ -8,8 +8,8 @@
  * published by the Free Software Foundation.
  */
 
-#ifndef FIMC_IS_SUBDEV_MCSC_H
-#define FIMC_IS_SUBDEV_MCSC_H
+#ifndef FIMC_IS_HW_MCSC_H
+#define FIMC_IS_HW_MCSC_H
 
 #include "fimc-is-hw-control.h"
 #include "fimc-is-interface-library.h"
@@ -232,7 +232,7 @@ struct ni_dep_factors {
        struct yuv_table_config yuv_tables;
 };
 
-typedef struct {
+struct scaler_setfile_contents {
        /* Brightness/Contrast control param */
        u32 y_offset;
        u32 y_gain;
@@ -242,9 +242,9 @@ typedef struct {
        u32 c_gain01;
        u32 c_gain10;
        u32 c_gain11;
-} scaler_setfile_contents;
+};
 
-typedef struct {
+struct tdnr_setfile_contents {
        bool    tdnr_enable;
        u32     num_of_noiseindexes;
        u32     compression_binary_error_thr;
@@ -256,7 +256,7 @@ typedef struct {
        struct regional_ni_indep_config         regional_indep_cfg;
        struct spatial_ni_indep_config          spatial_indep_cfg;
        struct ni_dep_factors                   ni_dep_factors[MAX_NOISEINDEX_DEPENDED_CONFIGS];
-} tdnr_setfile_contents;
+};
 
 struct tdnr_configs {
        struct general_config                   general_cfg;
@@ -340,9 +340,9 @@ struct hw_api_scaler_setfile {
         * 0 : SCALER_OUTPUT_YUV_RANGE_FULL
         * 1 : SCALER_OUTPUT_YUV_RANGE_NARROW
         */
-       scaler_setfile_contents contents[2];
+       struct scaler_setfile_contents contents[2];
 #ifdef MCSC_DNR_USE_TUNING
-       tdnr_setfile_contents tdnr_contents;
+       struct tdnr_setfile_contents tdnr_contents;
 #endif
 #ifdef MCSC_USE_DEJAG_TUNING_PARAM
        /* Setfile tuning parameters for DJAG (Lhotse)
@@ -396,7 +396,7 @@ struct fimc_is_hw_mcsc {
        bool    rep_flag[FIMC_IS_STREAM_COUNT];
        int     yuv_range;
        u32     instance;
-       ulong   out_en;
+       ulong   out_en;         /* This flag save whether the capture video node of MCSC is opened or not. */
        ulong   blk_set_ctrl[FIMC_IS_STREAM_COUNT];
        u32     prev_hwfc_output_ids;
 
index afbd659d52de83ac78de1f308bc152a2d511948f..9ebf749ac6435dbd82933001a19ed0da8ce7065c 100644 (file)
@@ -797,7 +797,7 @@ static void interpolate_yuv_table_factor(struct ni_dep_factors *interpolated_fac
                        diff_ni_actual_to_bottom);
 }
 
-static void reconfigure_ni_depended_tuneset(tdnr_setfile_contents *tdnr_tuneset,
+static void reconfigure_ni_depended_tuneset(struct tdnr_setfile_contents *tdnr_tuneset,
        struct tdnr_configs *tdnr_cfgs,
        u32 noise_index,
        u32 bottom_ni_index,
@@ -857,7 +857,7 @@ static int fimc_is_hw_mcsc_cfg_tdnr_tuning_param(struct fimc_is_hw_ip *hw_ip,
        int ret = 0;
        int ni_idx, arr_idx;
        struct fimc_is_hw_mcsc *hw_mcsc = NULL;
-       tdnr_setfile_contents *tdnr_tuneset;
+       struct tdnr_setfile_contents *tdnr_tuneset;
        struct tdnr_configs tdnr_cfgs;
        u32 max_ref_ni = 0, min_ref_ni = 0;
        u32 bottom_ni_index = 0, top_ni_index = 0;
index 4c0020c856f32d066ee14dd63106c5ec2a88b092..f616f81fe047b1e32db3ad305abcf67afb3c3320 100644 (file)
@@ -125,7 +125,7 @@ static int fimc_is_hw_mcsc_check_tdnr_mode_pre(struct fimc_is_hw_ip *hw_ip,
        u32 lindex, hindex;
 #ifdef MCSC_DNR_USE_TUNING
        enum exynos_sensor_position sensor_position;
-       tdnr_setfile_contents *tdnr_tuneset;
+       struct tdnr_setfile_contents *tdnr_tuneset;
 #endif
        bool setfile_tdnr_enable = true;
 
@@ -733,7 +733,7 @@ static void interpolate_yuv_table_factor(struct ni_dep_factors *interpolated_fac
                        diff_ni_actual_to_bottom);
 }
 
-static void reconfigure_ni_depended_tuneset(tdnr_setfile_contents *tdnr_tuneset,
+static void reconfigure_ni_depended_tuneset(struct tdnr_setfile_contents *tdnr_tuneset,
        struct tdnr_configs *tdnr_cfgs,
        u32 noise_index,
        u32 bottom_ni_index,
@@ -783,7 +783,7 @@ static int fimc_is_hw_mcsc_cfg_tdnr_tuning_param(struct fimc_is_hw_ip *hw_ip,
        int ret = 0;
        int ni_idx, arr_idx;
        struct fimc_is_hw_mcsc *hw_mcsc = NULL;
-       tdnr_setfile_contents *tdnr_tuneset;
+       struct tdnr_setfile_contents *tdnr_tuneset;
        struct tdnr_configs tdnr_cfgs;
        u32 max_ref_ni = 0, min_ref_ni = 0;
        u32 bottom_ni_index = 0, top_ni_index = 0;