]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
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 54b66d19016f4f3079fdb5d3eb43487363c35ce8..3698f43518c90d0bcdf6e50c06a422f622810748 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 ddc087c50ec5fabd6feb12c7315e6ec121f107d6..40a0b4070c0654ec0fb4a1e0309f2470786d510a 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 f5282bb6ad6c7d5e61069fc4005a98941916b9a2..b5004592ac1792f3ee58f51657959b95b6310576 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 2fbd2bf703140909c5c50ac5c1d6fed95a50de9b..ee58db7758e1c22144db55fc96e028ee0e0a96c5 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,