[{"id":30318,"web_url":"https://patchwork.libcamera.org/comment/30318/","msgid":"<2bgye3njnazbxbdxwwd62svg3eja66pirpzg3rusn7ba4dloe7@qxg4glychnx4>","date":"2024-07-04T10:48:18","subject":"Re: [PATCH v1 01/11] include: rkisp1: Update header for extensible\n\tparameters","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Laurent\n\nOn Thu, Jul 04, 2024 at 01:52:20AM GMT, Laurent Pinchart wrote:\n> From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>\n> Update the rkisp1-config.h header with the definitions for the\n> extensible parameters format.\n>\n> TODO: add a link to lore that points to v3 of the extensible paramters\n> series\n\nyeah, let's do that.\n\nOnce v5 and companding support are in media stage, this and 8/11\nshould be squashed probably\n\n>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  include/linux/rkisp1-config.h | 489 ++++++++++++++++++++++++++++++++++\n>  1 file changed, 489 insertions(+)\n>\n> diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\n> index f87c6bd49a5b..2fe735943d02 100644\n> --- a/include/linux/rkisp1-config.h\n> +++ b/include/linux/rkisp1-config.h\n> @@ -996,4 +996,493 @@ struct rkisp1_stat_buffer {\n>  \tstruct rkisp1_cif_isp_stat params;\n>  };\n>\n> +/*---------- PART3: Extensible Configuration Parameters  ------------*/\n> +\n> +/**\n> + * enum rkisp1_ext_params_block_type - RkISP1 extensible params block type\n> + *\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS: Black level subtraction\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC: Defect pixel cluster correction\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_SDG: Sensor de-gamma\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_GAIN: Auto white balance gains\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_FLT: ISP filtering\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_BDM: Bayer de-mosaic\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_CTK: Cross-talk correction\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_GOC: Gamma out correction\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF: De-noise pre-filter\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH: De-noise pre-filter strength\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_CPROC: Color processing\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_IE: Image effects\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_LSC: Lens shading correction\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_MEAS: Auto white balance statistics\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_HST_MEAS: Histogram statistics\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AEC_MEAS: Auto exposure statistics\n> + * @RKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS: Auto-focus statistics\n> + */\n> +enum rkisp1_ext_params_block_type {\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_BLS,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_SDG,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_GAIN,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_FLT,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_BDM,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_CTK,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_GOC,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_DPF,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_CPROC,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_IE,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_LSC,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_MEAS,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_HST_MEAS,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_AEC_MEAS,\n> +\tRKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS,\n> +};\n> +\n> +/**\n> + * enum rkisp1_ext_params_block_enable - RkISP1 extensible parameter block\n> + *\t\t\t\t\t enable flags\n> + *\n> + * @RKISP1_EXT_PARAMS_BLOCK_DISABLE: Disable the HW block\n> + * @RKISP1_EXT_PARAMS_BLOCK_ENABLE: Enable the HW block\n> + */\n> +enum rkisp1_ext_params_block_enable {\n> +\tRKISP1_EXT_PARAMS_BLOCK_DISABLE,\n> +\tRKISP1_EXT_PARAMS_BLOCK_ENABLE,\n> +};\n> +\n> +/**\n> + * struct rkisp1_ext_params_block_header - RkISP1 extensible parameter block\n> + *\t\t\t\t\t   header\n> + *\n> + * This structure represents the common part of all the ISP configuration\n> + * blocks. Each parameters block shall embed an instance of this structure type\n> + * as its first member, followed by the block-specific configuration data. The\n> + * driver inspects this common header to discern the block type and its size and\n> + * properly handle the block content by casting it to the correct block-specific\n> + * type.\n> + *\n> + * The @type field is one of the values enumerated by\n> + * :c:type:`rkisp1_ext_params_block_type` and specifies how the data should be\n> + * interpreted by the driver. The @size field specifies the size of the\n> + * parameters block and is used by the driver for validation purposes.\n> + *\n> + * The @enable field specifies the ISP block enablement state. The possible\n> + * enablement states are enumerated by :c:type:`rkisp1_ext_params_block_enable`.\n> + * When userspace needs to configure and enable an ISP block it shall fully\n> + * populate the block configuration and the @enable flag shall be set to\n> + * RKISP1_EXT_PARAMS_BLOCK_ENABLE. When userspace simply wants to disable the\n> + * ISP block the @enable flag shall be set to RKISP1_EXT_PARAMS_BLOCK_DISABLE.\n> + * The driver ignores the rest of the block configuration structure in this\n> + * case.\n> + *\n> + * If a new configuration of an ISP block has to be applied userspace shall\n> + * fully populate the ISP block configuration and set the @enable flag to\n> + * RKISP1_EXT_PARAMS_BLOCK_ENABLE.\n> + *\n> + * Userspace is responsible for correctly populating the parameters block header\n> + * fields (@type, @enable and @size) and the block-specific parameters.\n> + *\n> + * For example:\n> + *\n> + * .. code-block:: c\n> + *\n> + *\tvoid populate_bls(struct rkisp1_ext_params_block_header *block) {\n> + *\t\tstruct rkisp1_ext_params_bls_config *bls =\n> + *\t\t\t(struct rkisp1_ext_params_bls_config *)block;\n> + *\n> + *\t\tbls->header.type = RKISP1_EXT_PARAMS_BLOCK_ID_BLS;\n> + *\t\tbls->header.enable = RKISP1_EXT_PARAMS_BLOCK_ENABLE;\n> + *\t\tbls->header.size = sizeof(*bls);\n> + *\n> + *\t\tbls->config.enable_auto = 0;\n> + *\t\tbls->config.fixed_val.r = blackLevelRed_;\n> + *\t\tbls->config.fixed_val.gr = blackLevelGreenR_;\n> + *\t\tbls->config.fixed_val.gb = blackLevelGreenB_;\n> + *\t\tbls->config.fixed_val.b = blackLevelBlue_;\n> + *\t}\n> + *\n> + * @type: The parameters block type, see\n> + *\t  :c:type:`rkisp1_ext_params_block_type`\n> + * @enable: The block enable flag, see\n> + *\t   :c:type:`rkisp1_ext_params_block_enable`\n> + * @size: Size (in bytes) of the parameters block, including this header\n> + */\n> +struct rkisp1_ext_params_block_header {\n> +\t__u16 type;\n> +\t__u16 enable;\n> +\t__u16 size;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_bls_config - RkISP1 extensible params BLS config\n> + *\n> + * RkISP1 extensible parameters Black Level Subtraction configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Black Level Subtraction configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_bls_config`\n> + */\n> +struct rkisp1_ext_params_bls_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_bls_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_dpcc_config - RkISP1 extensible params DPCC config\n> + *\n> + * RkISP1 extensible parameters Defective Pixel Cluster Correction configuration\n> + * block. Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Defective Pixel Cluster Correction configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_dpcc_config`\n> + */\n> +struct rkisp1_ext_params_dpcc_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_dpcc_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_sdg_config - RkISP1 extensible params SDG config\n> + *\n> + * RkISP1 extensible parameters Sensor Degamma configuration block. Identified\n> + * by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_SDG`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Sensor Degamma configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_sdg_config`\n> + */\n> +struct rkisp1_ext_params_sdg_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_sdg_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_lsc_config - RkISP1 extensible params LSC config\n> + *\n> + * RkISP1 extensible parameters Lens Shading Correction configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_LSC`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Lens Shading Correction configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_lsc_config`\n> + */\n> +struct rkisp1_ext_params_lsc_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_lsc_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_awb_gain_config - RkISP1 extensible params AWB\n> + *\t\t\t\t\t      gain config\n> + *\n> + * RkISP1 extensible parameters Auto-White Balance Gains configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_GAIN`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Auto-White Balance Gains configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_awb_gain_config`\n> + */\n> +struct rkisp1_ext_params_awb_gain_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_awb_gain_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_flt_config - RkISP1 extensible params FLT config\n> + *\n> + * RkISP1 extensible parameters Filter configuration block. Identified by\n> + * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_FLT`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Filter configuration, see :c:type:`rkisp1_cif_isp_flt_config`\n> + */\n> +struct rkisp1_ext_params_flt_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_flt_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_bdm_config - RkISP1 extensible params BDM config\n> + *\n> + * RkISP1 extensible parameters Demosaicing configuration block. Identified by\n> + * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_BDM`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Demosaicing configuration, see :c:type:`rkisp1_cif_isp_bdm_config`\n> + */\n> +struct rkisp1_ext_params_bdm_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_bdm_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_ctk_config - RkISP1 extensible params CTK config\n> + *\n> + * RkISP1 extensible parameters Cross-Talk configuration block. Identified by\n> + * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_CTK`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Cross-Talk configuration, see :c:type:`rkisp1_cif_isp_ctk_config`\n> + */\n> +struct rkisp1_ext_params_ctk_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_ctk_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_goc_config - RkISP1 extensible params GOC config\n> + *\n> + * RkISP1 extensible parameters Gamma-Out configuration block. Identified by\n> + * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_GOC`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Gamma-Out configuration, see :c:type:`rkisp1_cif_isp_goc_config`\n> + */\n> +struct rkisp1_ext_params_goc_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_goc_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_dpf_config - RkISP1 extensible params DPF config\n> + *\n> + * RkISP1 extensible parameters De-noise Pre-Filter configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: De-noise Pre-Filter configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_dpf_config`\n> + */\n> +struct rkisp1_ext_params_dpf_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_dpf_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_dpf_strength_config - RkISP1 extensible params DPF\n> + *\t\t\t\t\t\t  strength config\n> + *\n> + * RkISP1 extensible parameters De-noise Pre-Filter strength configuration\n> + * block. Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_DPF_STRENGTH`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: De-noise Pre-Filter strength configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_dpf_strength_config`\n> + */\n> +struct rkisp1_ext_params_dpf_strength_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_dpf_strength_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_cproc_config - RkISP1 extensible params CPROC config\n> + *\n> + * RkISP1 extensible parameters Color Processing configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_CPROC`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Color processing configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_cproc_config`\n> + */\n> +struct rkisp1_ext_params_cproc_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_cproc_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_ie_config - RkISP1 extensible params IE config\n> + *\n> + * RkISP1 extensible parameters Image Effect configuration block. Identified by\n> + * :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_IE`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Image Effect configuration, see :c:type:`rkisp1_cif_isp_ie_config`\n> + */\n> +struct rkisp1_ext_params_ie_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_ie_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_awb_meas_config - RkISP1 extensible params AWB\n> + *\t\t\t\t\t      Meas config\n> + *\n> + * RkISP1 extensible parameters Auto-White Balance Measurement configuration\n> + * block. Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AWB_MEAS`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Auto-White Balance measure configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_awb_meas_config`\n> + */\n> +struct rkisp1_ext_params_awb_meas_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_awb_meas_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_hst_config - RkISP1 extensible params Histogram config\n> + *\n> + * RkISP1 extensible parameters Histogram statistics configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_HST_MEAS`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Histogram statistics configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_hst_config`\n> + */\n> +struct rkisp1_ext_params_hst_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_hst_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_aec_config - RkISP1 extensible params AEC config\n> + *\n> + * RkISP1 extensible parameters Auto-Exposure statistics configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AEC_MEAS`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Auto-Exposure statistics configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_aec_config`\n> + */\n> +struct rkisp1_ext_params_aec_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_aec_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct rkisp1_ext_params_afc_config - RkISP1 extensible params AFC config\n> + *\n> + * RkISP1 extensible parameters Auto-Focus statistics configuration block.\n> + * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_AFC_MEAS`.\n> + *\n> + * @header: The RkISP1 extensible parameters header, see\n> + *\t    :c:type:`rkisp1_ext_params_block_header`\n> + * @config: Auto-Focus statistics configuration, see\n> + *\t    :c:type:`rkisp1_cif_isp_afc_config`\n> + */\n> +struct rkisp1_ext_params_afc_config {\n> +\tstruct rkisp1_ext_params_block_header header;\n> +\tstruct rkisp1_cif_isp_afc_config config;\n> +} __attribute__((aligned(8)));\n> +\n> +#define RKISP1_EXT_PARAMS_MAX_SIZE\t\t\t\t\t\\\n> +\t(sizeof(struct rkisp1_ext_params_bls_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_dpcc_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_sdg_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_lsc_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_awb_gain_config)\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_flt_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_bdm_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_ctk_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_goc_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_dpf_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_dpf_strength_config)\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_cproc_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_ie_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_awb_meas_config)\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_hst_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_aec_config)\t\t\t+\\\n> +\tsizeof(struct rkisp1_ext_params_afc_config))\n> +\n> +/**\n> + * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version\n> + *\n> + * @RKISP1_EXT_PARAM_BUFFER_V1: First version of RkISP1 extensible parameters\n> + */\n> +enum rksip1_ext_param_buffer_version {\n> +\tRKISP1_EXT_PARAM_BUFFER_V1 = 1,\n> +};\n> +\n> +/**\n> + * struct rkisp1_ext_params_cfg - RkISP1 extensible parameters configuration\n> + *\n> + * This struct contains the configuration parameters of the RkISP1 ISP\n> + * algorithms, serialized by userspace into a data buffer. Each configuration\n> + * parameter block is represented by a block-specific structure which contains a\n> + * :c:type:`rkisp1_ext_params_block_header` entry as first member. Userspace\n> + * populates the @data buffer with configuration parameters for the blocks that\n> + * it intends to configure. As a consequence, the data buffer effective size\n> + * changes according to the number of ISP blocks that userspace intends to\n> + * configure and is set by userspace in the @data_size field.\n> + *\n> + * The parameters buffer is versioned by the @version field to allow modifying\n> + * and extending its definition. Userspace shall populate the @version field to\n> + * inform the driver about the version it intends to use. The driver will parse\n> + * and handle the @data buffer according to the data layout specific to the\n> + * indicated version and return an error if the desired version is not\n> + * supported.\n> + *\n> + * For each ISP block that userspace wants to configure, a block-specific\n> + * structure is appended to the @data buffer, one after the other without gaps\n> + * in between nor overlaps. Userspace shall populate the @data_size field with\n> + * the effective size, in bytes, of the @data buffer.\n> + *\n> + * The expected memory layout of the parameters buffer is::\n> + *\n> + *\t+-------------------- struct rkisp1_ext_params_cfg -------------------+\n> + *\t| version = RKISP_EXT_PARAMS_BUFFER_V1;                               |\n> + *\t| data_size = sizeof(struct rkisp1_ext_params_bls_config)             |\n> + *\t|           + sizeof(struct rkisp1_ext_params_dpcc_config);           |\n> + *\t| +------------------------- data  ---------------------------------+ |\n> + *\t| | +------------- struct rkisp1_ext_params_bls_config -----------+ | |\n> + *\t| | | +-------- struct rkisp1_ext_params_block_header  ---------+ | | |\n> + *\t| | | | type = RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS;                | | | |\n> + *\t| | | | enable = RKISP1_EXT_PARAMS_BLOCK_ENABLE;                | | | |\n> + *\t| | | | size = sizeof(struct rkisp1_ext_params_bls_config);     | | | |\n> + *\t| | | +---------------------------------------------------------+ | | |\n> + *\t| | | +---------- struct rkisp1_cif_isp_bls_config -------------+ | | |\n> + *\t| | | | enable_auto = 0;                                        | | | |\n> + *\t| | | | fixed_val.r = 256;                                      | | | |\n> + *\t| | | | fixed_val.gr = 256;                                     | | | |\n> + *\t| | | | fixed_val.gb = 256;                                     | | | |\n> + *\t| | | | fixed_val.b = 256;                                      | | | |\n> + *\t| | | +---------------------------------------------------------+ | | |\n> + *\t| | +------------ struct rkisp1_ext_params_dpcc_config -----------+ | |\n> + *\t| | | +-------- struct rkisp1_ext_params_block_header  ---------+ | | |\n> + *\t| | | | type = RKISP1_EXT_PARAMS_BLOCK_TYPE_DPCC;               | | | |\n> + *\t| | | | enable = RKISP1_EXT_PARAMS_BLOCK_ENABLE;                | | | |\n> + *\t| | | | size = sizeof(struct rkisp1_ext_params_dpcc_config);    | | | |\n> + *\t| | | +---------------------------------------------------------+ | | |\n> + *\t| | | +---------- struct rkisp1_cif_isp_dpcc_config ------------+ | | |\n> + *\t| | | | mode = RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE;          | | | |\n> + *\t| | | | output_mode =                                           | | | |\n> + *\t| | | |   RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER; | | | |\n> + *\t| | | | set_use = ... ;                                         | | | |\n> + *\t| | | | ...  = ... ;                                            | | | |\n> + *\t| | | +---------------------------------------------------------+ | | |\n> + *\t| | +-------------------------------------------------------------+ | |\n> + *\t| +-----------------------------------------------------------------+ |\n> + *\t+---------------------------------------------------------------------+\n> + *\n> + * @version: The RkISP1 extensible parameters buffer version, see\n> + *\t     :c:type:`rksip1_ext_param_buffer_version`\n> + * @data_size: The RkISP1 configuration data effective size, excluding this\n> + *\t       header\n> + * @data: The RkISP1 extensible configuration data blocks\n> + */\n> +struct rkisp1_ext_params_cfg {\n> +\t__u32 version;\n> +\t__u32 data_size;\n> +\t__u8 data[RKISP1_EXT_PARAMS_MAX_SIZE];\n> +};\n> +\n>  #endif /* _RKISP1_CONFIG_H */\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 41CB3BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jul 2024 10:48:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 135F262E22;\n\tThu,  4 Jul 2024 12:48:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C8FD1619C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jul 2024 12:48:21 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A737E502;\n\tThu,  4 Jul 2024 12:47:52 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"OIHCjgCs\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720090072;\n\tbh=f4G3RogkhcpnQMD2LGKebm3Txx7FErVa4fi5Qyhs2Zk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=OIHCjgCsUEU53PGo7SwbzwsnoicQO/vy6h/wZc4yRa7Bf1UWGcqnGeQ9hVyOPaNW8\n\ttSZgArcQDgCwkQ01f8mGSJ4VxNtlUWNbwWN80tyjYdDIm4Uobe9K26nh/KfHnMIQt7\n\t4W6gl4/+y49tCJwsRCr4Gc41GK9Q3sMCPI5zZmYg=","Date":"Thu, 4 Jul 2024 12:48:18 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v1 01/11] include: rkisp1: Update header for extensible\n\tparameters","Message-ID":"<2bgye3njnazbxbdxwwd62svg3eja66pirpzg3rusn7ba4dloe7@qxg4glychnx4>","References":"<20240703225230.3530-1-laurent.pinchart@ideasonboard.com>\n\t<20240703225230.3530-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240703225230.3530-2-laurent.pinchart@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]