media: atomisp: ia_css_binary_get_shading_info(): don't test version
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 26 Apr 2020 16:56:54 +0000 (18:56 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 May 2020 10:32:17 +0000 (12:32 +0200)
It doesn't make any sense to change the number of parameters
for this function depending on the ISP version.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe_public.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h
drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/src/binary.c
drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c

index 54b66d1..3698f43 100644 (file)
@@ -182,11 +182,10 @@ struct ia_css_pipe_info {
             pixels normally used to initialize the ISP filters.
             This is why the raw output resolution should normally be set to
             the input resolution - 8x8. */
-#ifdef ISP2401
+       /* ISP2401 */
        struct ia_css_resolution output_system_in_res_info;
        /** For IPU3 only. Info about output system in resolution which is considered
             as gdc out resolution. */
-#endif
        struct ia_css_shading_info shading_info;
        /** After an image pipe is created, this field will contain the info
             for the shading correction. */
index ddc087c..40a0b40 100644 (file)
@@ -219,12 +219,8 @@ ia_css_binary_get_shading_info(const struct ia_css_binary *binary,
                               enum ia_css_shading_correction_type type,
                               unsigned int required_bds_factor,
                               const struct ia_css_stream_config *stream_config,
-#ifndef ISP2401
-                              struct ia_css_shading_info *info);
-#else
                               struct ia_css_shading_info *shading_info,
                               struct ia_css_pipe_config *pipe_config);
-#endif
 
 enum ia_css_err
 ia_css_binary_3a_grid_info(const struct ia_css_binary *binary,
index f5282bb..b500459 100644 (file)
@@ -706,28 +706,21 @@ ia_css_binary_get_shading_info(const struct ia_css_binary *binary,                        /* [in] */
                               enum ia_css_shading_correction_type type,                /* [in] */
                               unsigned int required_bds_factor,                        /* [in] */
                               const struct ia_css_stream_config *stream_config,        /* [in] */
-#ifndef ISP2401
-                              struct ia_css_shading_info *info)                        /* [out] */
-#else
                               struct ia_css_shading_info *shading_info,                /* [out] */
                               struct ia_css_pipe_config *pipe_config)                  /* [out] */
-#endif
 {
        enum ia_css_err err;
 
        assert(binary);
-#ifndef ISP2401
-       assert(info);
-#else
        assert(shading_info);
 
        IA_CSS_ENTER_PRIVATE("binary=%p, type=%d, required_bds_factor=%d, stream_config=%p",
                             binary, type, required_bds_factor, stream_config);
-#endif
 
        if (type == IA_CSS_SHADING_CORRECTION_TYPE_1)
 #ifndef ISP2401
-               err = ia_css_binary_get_shading_info_type_1(binary, required_bds_factor, stream_config, info);
+               err = ia_css_binary_get_shading_info_type_1(binary, required_bds_factor, stream_config,
+                                                           shading_info);
 #else
                err = ia_css_binary_get_shading_info_type_1(binary, required_bds_factor, stream_config,
                        shading_info, pipe_config);
index 2fbd2bf..ee58db7 100644 (file)
@@ -5507,23 +5507,12 @@ static enum ia_css_err sh_css_pipe_configure_output(
 
 static enum ia_css_err
 sh_css_pipe_get_shading_info(struct ia_css_pipe *pipe,
-#ifndef ISP2401
-                            struct ia_css_shading_info *info)
-#else
                             struct ia_css_shading_info *shading_info,
                             struct ia_css_pipe_config *pipe_config)
-#endif
 {
        enum ia_css_err err = IA_CSS_SUCCESS;
        struct ia_css_binary *binary = NULL;
 
-       assert(pipe);
-#ifndef ISP2401
-       assert(info);
-#else
-       assert(shading_info);
-       assert(pipe_config);
-#endif
        ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
                            "sh_css_pipe_get_shading_info() enter:\n");
 
@@ -5535,11 +5524,8 @@ sh_css_pipe_get_shading_info(struct ia_css_pipe *pipe,
                                                     IA_CSS_SHADING_CORRECTION_TYPE_1,
                                                     pipe->required_bds_factor,
                                                     (const struct ia_css_stream_config *)&pipe->stream->config,
-#ifndef ISP2401
-                                                    info);
-#else
                                                     shading_info, pipe_config);
-#endif
+
                /* Other function calls can be added here when other shading correction types will be added
                 * in the future.
                 */
@@ -5550,11 +5536,7 @@ sh_css_pipe_get_shading_info(struct ia_css_pipe *pipe,
                 * information. It is not a error case, and then
                 * this function should return IA_CSS_SUCCESS.
                 */
-#ifndef ISP2401
-               memset(info, 0, sizeof(*info));
-#else
                memset(shading_info, 0, sizeof(*shading_info));
-#endif
        }
        return err;
 }
@@ -9951,16 +9933,18 @@ EXIT:
                                if (err != IA_CSS_SUCCESS)
                                        goto ERR;
                        }
-#ifdef ISP2401
-                       pipe_info->output_system_in_res_info = curr_pipe->config.output_system_in_res;
-#endif
+
+                       if (atomisp_hw_is_isp2401)
+                               pipe_info->output_system_in_res_info = curr_pipe->config.output_system_in_res;
+
                        if (!spcopyonly) {
-                               err = sh_css_pipe_get_shading_info(curr_pipe,
-#ifndef ISP2401
-                                                                  &pipe_info->shading_info);
-#else
-                                                                  & pipe_info->shading_info, &curr_pipe->config);
-#endif
+                               if (!atomisp_hw_is_isp2401)
+                                       err = sh_css_pipe_get_shading_info(curr_pipe,
+                                                                          &pipe_info->shading_info, NULL);
+                               else
+                                       err = sh_css_pipe_get_shading_info(curr_pipe,
+                                                                          &pipe_info->shading_info, &curr_pipe->config);
+
                                if (err != IA_CSS_SUCCESS)
                                        goto ERR;
                                err = sh_css_pipe_get_grid_info(curr_pipe,