From patchwork Thu Nov 30 21:40:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Sowden X-Patchwork-Id: 10085675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EAEC3602B9 for ; Thu, 30 Nov 2017 21:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD3EE29F3A for ; Thu, 30 Nov 2017 21:40:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D24B32A32A; Thu, 30 Nov 2017 21:40:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E809629F3A for ; Thu, 30 Nov 2017 21:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750977AbdK3Vko (ORCPT ); Thu, 30 Nov 2017 16:40:44 -0500 Received: from kadath.azazel.net ([81.187.231.250]:60932 "EHLO kadath.azazel.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbdK3Vkm (ORCPT ); Thu, 30 Nov 2017 16:40:42 -0500 Received: from ulthar.dreamlands ([192.168.96.2]) by kadath.azazel.net with esmtp (Exim 4.89) (envelope-from ) id 1eKWZJ-0001ap-UK; Thu, 30 Nov 2017 21:40:30 +0000 From: Jeremy Sowden To: linux-media@vger.kernel.org, devel@driverdev.osuosl.org Cc: Jeremy Sowden Subject: [PATCH 3/3] media: atomisp: delete empty default struct values. Date: Thu, 30 Nov 2017 21:40:14 +0000 Message-Id: <20171130214014.31412-4-jeremy@azazel.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130214014.31412-1-jeremy@azazel.net> References: <20171129083835.tam3avqz5vishwqw@azazel.net> <20171130214014.31412-1-jeremy@azazel.net> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removing zero-valued struct-members left a number of the default struct-values empty. These values have now been removed. Signed-off-by: Jeremy Sowden --- .../atomisp/pci/atomisp2/css2400/ia_css_pipe.h | 1 - .../atomisp/pci/atomisp2/css2400/ia_css_types.h | 1 - .../isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h | 3 -- .../kernels/sdis/common/ia_css_sdis_common_types.h | 34 +++++----------------- .../isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c | 2 +- .../runtime/binary/interface/ia_css_binary.h | 6 ---- .../isp_param/interface/ia_css_isp_param_types.h | 9 ------ .../media/atomisp/pci/atomisp2/css2400/sh_css.c | 9 +++--- .../atomisp/pci/atomisp2/css2400/sh_css_legacy.h | 2 -- .../atomisp/pci/atomisp2/css2400/sh_css_metrics.h | 8 ----- 10 files changed, 12 insertions(+), 63 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h index a8f89866876d..9c6efaa66c93 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_pipe.h @@ -164,7 +164,6 @@ struct ia_css_pipe { #define IA_CSS_DEFAULT_PIPE \ (struct ia_css_pipe) { \ .config = DEFAULT_PIPE_CONFIG, \ - .extra_config = DEFAULT_PIPE_EXTRA_CONFIG, \ .info = DEFAULT_PIPE_INFO, \ .mode = IA_CSS_PIPE_ID_ACC, /* (pipe_id) */ \ .pipeline = DEFAULT_PIPELINE, \ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h index 0ae60a3d0643..e49fe5bc98b8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_types.h @@ -407,7 +407,6 @@ struct ia_css_grid_info { /** defaults for ia_css_grid_info structs */ #define DEFAULT_GRID_INFO \ (struct ia_css_grid_info) { \ - .s3a_grid = DEFAULT_3A_GRID_INFO, \ .dvs_grid = DEFAULT_DVS_GRID_INFO, \ .vamem_type = IA_CSS_VAMEM_TYPE_1 \ } diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h index 1309b06747d0..4297c3addcb2 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/s3a/s3a_1.0/ia_css_s3a_types.h @@ -98,9 +98,6 @@ struct ia_css_3a_grid_info { }; -#define DEFAULT_3A_GRID_INFO (struct ia_css_3a_grid_info) { } - - /* This struct should be split into 3, for AE, AWB and AF. * However, that will require driver/ 3A lib modifications. */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h index a969384430aa..4cfd31bd3e5f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/common/ia_css_sdis_common_types.h @@ -41,8 +41,6 @@ struct ia_css_sdis_info { uint32_t deci_factor_log2; }; -#define IA_CSS_DEFAULT_SDIS_INFO (struct ia_css_sdis_info) { } - /** DVS statistics grid * * ISP block: SDVS1 (DIS/DVS Support for DIS/DVS ver.1 (2-axes)) @@ -197,33 +195,15 @@ struct ia_css_dvs_stat_grid_info { /** DVS statistics generated by accelerator default grid info */ -#define DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG \ -(struct dvs_stat_public_dvs_global_cfg) { } - -#define DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \ -(struct dvs_stat_public_dvs_grd_cfg) { } - -#define DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(X_START) \ - (struct dvs_stat_public_dvs_level_fe_roi_cfg) { .x_start = X_START, } - -#define DEFAULT_DVS_STAT_GRID_INFO \ -(struct ia_css_dvs_stat_grid_info) { \ - .dvs_gbl_cfg = DEFAULT_DVS_STAT_PUBLIC_DVS_GLOBAL_CFG, \ - .grd_cfg = { \ - DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \ - DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG, \ - DEFAULT_DVS_STAT_PUBLIC_DVS_GRD_CFG \ - }, \ - .fe_roi_cfg = { \ - DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \ - DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(4), \ - DEFAULT_DVS_STAT_PUBLIC_DVS_LEVEL_FE_ROI_CFG(0), \ - } \ -} - #define DEFAULT_DVS_GRID_INFO \ (union ia_css_dvs_grid_u) { \ - .dvs_stat_grid_info = DEFAULT_DVS_STAT_GRID_INFO, \ + .dvs_stat_grid_info = (struct ia_css_dvs_stat_grid_info) { \ + .fe_roi_cfg = { \ + [1] = (struct dvs_stat_public_dvs_level_fe_roi_cfg) { \ + .x_start = 4 \ + } \ + } \ + } \ } /** Union that holds all types of DVS statistics grid info in diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c index e45a3c3fcf4a..0fdd696bf654 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/isp/kernels/sdis/sdis_1.0/ia_css_sdis.host.c @@ -169,7 +169,7 @@ ia_css_sdis_init_info( unsigned enabled) { if (!enabled) { - *dis = IA_CSS_DEFAULT_SDIS_INFO; + *dis = (struct ia_css_sdis_info) { }; return; } diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h index dcde6efa4943..e83a2fa8413b 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/binary/interface/ia_css_binary.h @@ -93,8 +93,6 @@ struct ia_css_cas_binary_descr { bool *is_output_stage; }; -#define IA_CSS_DEFAULT_CAS_BINARY_DESCR (struct ia_css_cas_binary_descr) { } - struct ia_css_binary_descr { int mode; bool online; @@ -169,10 +167,6 @@ struct ia_css_binary { .internal_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ .out_frame_info = {IA_CSS_BINARY_DEFAULT_FRAME_INFO}, \ .vf_frame_info = IA_CSS_BINARY_DEFAULT_FRAME_INFO, \ - .dis = IA_CSS_DEFAULT_SDIS_INFO, \ - .metrics = DEFAULT_BINARY_METRICS, \ - .mem_params = IA_CSS_DEFAULT_ISP_MEM_PARAMS, \ - .css_params = IA_CSS_DEFAULT_ISP_CSS_PARAMS, \ } enum ia_css_err diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h index 022db8a2a184..2cb61811e53c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isp_param/interface/ia_css_isp_param_types.h @@ -94,13 +94,4 @@ union ia_css_all_memory_offsets { } array[IA_CSS_NUM_PARAM_CLASSES]; }; -#define IA_CSS_DEFAULT_ISP_MEM_PARAMS \ - (struct ia_css_isp_param_host_segments) { } - -#define IA_CSS_DEFAULT_ISP_CSS_PARAMS \ - (struct ia_css_isp_param_css_segments) { } - -#define IA_CSS_DEFAULT_ISP_ISP_PARAMS \ - (struct ia_css_isp_param_isp_segments) { } - #endif /* _IA_CSS_ISP_PARAM_TYPES_H_ */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c index 9439d643fd03..59bf3402703f 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css.c @@ -5582,8 +5582,7 @@ static enum ia_css_err load_video_binaries(struct ia_css_pipe *pipe) /* we build up the pipeline starting at the end */ /* YUV post-processing if needed */ if (need_scaler) { - struct ia_css_cas_binary_descr cas_scaler_descr - = IA_CSS_DEFAULT_CAS_BINARY_DESCR; + struct ia_css_cas_binary_descr cas_scaler_descr = { }; /* NV12 is the common format that is supported by both */ /* yuv_scaler and the video_xx_isp2_min binaries. */ @@ -6236,8 +6235,8 @@ static enum ia_css_err load_primary_binaries( pipe_out_info->res); if (need_extra_yuv_scaler) { - struct ia_css_cas_binary_descr cas_scaler_descr - = IA_CSS_DEFAULT_CAS_BINARY_DESCR; + struct ia_css_cas_binary_descr cas_scaler_descr = { }; + err = ia_css_pipe_create_cas_scaler_desc_single_output( &capt_pp_out_info, pipe_out_info, @@ -7224,7 +7223,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe) struct ia_css_frame_info *vf_pp_in_info[IA_CSS_PIPE_MAX_OUTPUT_STAGE]; struct ia_css_yuvpp_settings *mycs; struct ia_css_binary *next_binary; - struct ia_css_cas_binary_descr cas_scaler_descr = IA_CSS_DEFAULT_CAS_BINARY_DESCR; + struct ia_css_cas_binary_descr cas_scaler_descr = { }; unsigned int i, j; bool need_isp_copy_binary = false; diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h index cd95d46a6212..c690a184ccd4 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_legacy.h @@ -52,8 +52,6 @@ struct ia_css_pipe_extra_config { bool disable_vf_pp; }; -#define DEFAULT_PIPE_EXTRA_CONFIG (struct ia_css_pipe_extra_config) { } - enum ia_css_err ia_css_pipe_create_extra(const struct ia_css_pipe_config *config, const struct ia_css_pipe_extra_config *extra_config, diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h index 275d6e8decf9..2ef9238d95ad 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h +++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/sh_css_metrics.h @@ -24,8 +24,6 @@ struct sh_css_pc_histogram { unsigned *msink; }; -#define DEFAULT_PC_HISTOGRAM (struct sh_css_pc_histogram) { } - struct sh_css_binary_metrics { unsigned mode; unsigned id; @@ -34,12 +32,6 @@ struct sh_css_binary_metrics { struct sh_css_binary_metrics *next; }; -#define DEFAULT_BINARY_METRICS \ -(struct sh_css_binary_metrics) { \ - .isp_histogram = DEFAULT_PC_HISTOGRAM, \ - .sp_histogram = DEFAULT_PC_HISTOGRAM, \ -} - struct ia_css_frame_metrics { unsigned num_frames; };