Show a patch.

GET /api/patches/1290/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1290,
    "url": "https://patchwork.libcamera.org/api/patches/1290/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1290/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20190524162139.4446-5-jacopo@jmondi.org>",
    "date": "2019-05-24T16:21:37",
    "name": "[libcamera-devel,4/6] include: linux: Add intel-ipu3 kernel header",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "355dd8204606ad2acaffed484a44b0f446b4c545",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1290/mbox/",
    "series": [
        {
            "id": 326,
            "url": "https://patchwork.libcamera.org/api/series/326/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=326",
            "date": "2019-05-24T16:21:33",
            "name": "META_OUTPUT support + IPU3 parameters tuning",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/326/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1290/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1290/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C3A2760003\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 May 2019 18:20:41 +0200 (CEST)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id D915C240012;\n\tFri, 24 May 2019 16:20:39 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 24 May 2019 18:21:37 +0200",
        "Message-Id": "<20190524162139.4446-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190524162139.4446-1-jacopo@jmondi.org>",
        "References": "<20190524162139.4446-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 4/6] include: linux: Add intel-ipu3 kernel\n\theader",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Fri, 24 May 2019 16:20:42 -0000"
    },
    "content": "Add kernel header for Intel IPU3. As the driver is currently in staging,\nthe header file is not exported as part of the standard kernel uAPI.\n\nManually export it using script/headers_install.sh and temporary copy it\nin libcamera's linux headers directory as long as it get not exported as\npart of the standard kernel headers in future Linux releases.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/linux/intel-ipu3.h | 2779 ++++++++++++++++++++++++++++++++++++\n 1 file changed, 2779 insertions(+)\n create mode 100644 include/linux/intel-ipu3.h",
    "diff": "diff --git a/include/linux/intel-ipu3.h b/include/linux/intel-ipu3.h\nnew file mode 100644\nindex 000000000000..f758c9ba230b\n--- /dev/null\n+++ b/include/linux/intel-ipu3.h\n@@ -0,0 +1,2779 @@\n+/* SPDX-License-Identifier: GPL-2.0 */\n+/* Copyright (C) 2017 - 2018 Intel Corporation */\n+\n+#ifndef __IPU3_UAPI_H\n+#define __IPU3_UAPI_H\n+\n+#include <linux/types.h>\n+\n+/* from /drivers/staging/media/ipu3/include/videodev2.h */\n+\n+/* Vendor specific - used for IPU3 camera sub-system */\n+#define V4L2_META_FMT_IPU3_PARAMS\tv4l2_fourcc('i', 'p', '3', 'p') /* IPU3 processing parameters */\n+#define V4L2_META_FMT_IPU3_STAT_3A\tv4l2_fourcc('i', 'p', '3', 's') /* IPU3 3A statistics */\n+\n+/* from include/uapi/linux/v4l2-controls.h */\n+#define V4L2_CID_INTEL_IPU3_BASE\t(V4L2_CID_USER_BASE + 0x10c0)\n+#define V4L2_CID_INTEL_IPU3_MODE\t(V4L2_CID_INTEL_IPU3_BASE + 1)\n+\n+/******************* ipu3_uapi_stats_3a *******************/\n+\n+#define IPU3_UAPI_MAX_STRIPES\t\t\t\t2\n+#define IPU3_UAPI_MAX_BUBBLE_SIZE\t\t\t10\n+\n+#define IPU3_UAPI_GRID_START_MASK\t\t\t((1 << 12) - 1)\n+#define IPU3_UAPI_GRID_Y_START_EN\t\t\t(1 << 15)\n+\n+/* controls generation of meta_data (like FF enable/disable) */\n+#define IPU3_UAPI_AWB_RGBS_THR_B_EN\t\t\t(1 << 14)\n+#define IPU3_UAPI_AWB_RGBS_THR_B_INCL_SAT\t\t(1 << 15)\n+\n+/**\n+ * struct ipu3_uapi_grid_config - Grid plane config\n+ *\n+ * @width:\tGrid horizontal dimensions, in number of grid blocks(cells).\n+ * @height:\tGrid vertical dimensions, in number of grid cells.\n+ * @block_width_log2:\tLog2 of the width of each cell in pixels.\n+ *\t\t\tfor (2^3, 2^4, 2^5, 2^6, 2^7), values [3, 7].\n+ * @block_height_log2:\tLog2 of the height of each cell in pixels.\n+ *\t\t\tfor (2^3, 2^4, 2^5, 2^6, 2^7), values [3, 7].\n+ * @height_per_slice:\tThe number of blocks in vertical axis per slice.\n+ *\t\t\tDefault 2.\n+ * @x_start: X value of top left corner of Region of Interest(ROI).\n+ * @y_start: Y value of top left corner of ROI\n+ * @x_end: X value of bottom right corner of ROI\n+ * @y_end: Y value of bottom right corner of ROI\n+ *\n+ * Due to the size of total amount of collected data, most statistics\n+ * create a grid-based output, and the data is then divided into \"slices\".\n+ */\n+struct ipu3_uapi_grid_config {\n+\t__u8 width;\n+\t__u8 height;\n+\t__u16 block_width_log2:3;\n+\t__u16 block_height_log2:3;\n+\t__u16 height_per_slice:8;\n+\t__u16 x_start;\n+\t__u16 y_start;\n+\t__u16 x_end;\n+\t__u16 y_end;\n+} __attribute__((packed));\n+\n+/*\n+ * The grid based data is divided into \"slices\" called set, each slice of setX\n+ * refers to ipu3_uapi_grid_config width * height_per_slice.\n+ */\n+#define IPU3_UAPI_AWB_MAX_SETS\t\t\t\t60\n+/* Based on grid size 80 * 60 and cell size 16 x 16 */\n+#define IPU3_UAPI_AWB_SET_SIZE\t\t\t\t1280\n+#define IPU3_UAPI_AWB_MD_ITEM_SIZE\t\t\t8\n+#define IPU3_UAPI_AWB_SPARE_FOR_BUBBLES \\\n+\t(IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \\\n+\t IPU3_UAPI_AWB_MD_ITEM_SIZE)\n+#define IPU3_UAPI_AWB_MAX_BUFFER_SIZE \\\n+\t(IPU3_UAPI_AWB_MAX_SETS * \\\n+\t (IPU3_UAPI_AWB_SET_SIZE + IPU3_UAPI_AWB_SPARE_FOR_BUBBLES))\n+\n+\n+/**\n+ * struct ipu3_uapi_awb_raw_buffer - AWB raw buffer\n+ *\n+ * @meta_data: buffer to hold auto white balance meta data which is\n+ *\t\tthe average values for each color channel.\n+ */\n+struct ipu3_uapi_awb_raw_buffer {\n+\t__u8 meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n+\t\t__attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_awb_config_s - AWB config\n+ *\n+ * @rgbs_thr_gr: gr threshold value.\n+ * @rgbs_thr_r: Red threshold value.\n+ * @rgbs_thr_gb: gb threshold value.\n+ * @rgbs_thr_b: Blue threshold value.\n+ * @grid: &ipu3_uapi_grid_config, the default grid resolution is 16x16 cells.\n+ *\n+ * The threshold is a saturation measure range [0, 8191], 8191 is default.\n+ * Values over threshold may be optionally rejected for averaging.\n+ */\n+struct ipu3_uapi_awb_config_s {\n+\t__u16 rgbs_thr_gr;\n+\t__u16 rgbs_thr_r;\n+\t__u16 rgbs_thr_gb;\n+\t__u16 rgbs_thr_b;\n+\tstruct ipu3_uapi_grid_config grid;\n+} __attribute__((aligned(32))) __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_awb_config - AWB config wrapper\n+ *\n+ * @config: config for auto white balance as defined by &ipu3_uapi_awb_config_s\n+ */\n+struct ipu3_uapi_awb_config {\n+\tstruct ipu3_uapi_awb_config_s config __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+#define IPU3_UAPI_AE_COLORS\t\t\t\t4\t/* R, G, B, Y */\n+#define IPU3_UAPI_AE_BINS\t\t\t\t256\n+#define IPU3_UAPI_AE_WEIGHTS\t\t\t\t96\n+\n+/**\n+ + * struct ipu3_uapi_ae_raw_buffer - AE global weighted histogram\n+ + *\n+ + * @vals: Sum of IPU3_UAPI_AE_COLORS in cell\n+ + *\n+ + * Each histogram contains IPU3_UAPI_AE_BINS bins. Each bin has 24 bit unsigned\n+ + * for counting the number of the pixel.\n+ + */\n+struct ipu3_uapi_ae_raw_buffer {\n+\t__u32 vals[IPU3_UAPI_AE_BINS * IPU3_UAPI_AE_COLORS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ae_raw_buffer_aligned - AE raw buffer\n+ *\n+ * @buff: &ipu3_uapi_ae_raw_buffer to hold full frame meta data.\n+ */\n+struct ipu3_uapi_ae_raw_buffer_aligned {\n+\tstruct ipu3_uapi_ae_raw_buffer buff __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ae_grid_config - AE weight grid\n+ *\n+ * @width: Grid horizontal dimensions. Value: [16, 32], default 16.\n+ * @height: Grid vertical dimensions. Value: [16, 24], default 16.\n+ * @block_width_log2: Log2 of the width of the grid cell, value: [3, 7].\n+ * @block_height_log2: Log2 of the height of the grid cell, value: [3, 7].\n+ *\t\t\tdefault is 3 (cell size 8x8), 4 cell per grid.\n+ * @reserved0: reserved\n+ * @ae_en: 0: does not write to &ipu3_uapi_ae_raw_buffer_aligned array,\n+ *\t\t1: write normally.\n+ * @rst_hist_array: write 1 to trigger histogram array reset.\n+ * @done_rst_hist_array: flag for histogram array reset done.\n+ * @x_start: X value of top left corner of ROI, default 0.\n+ * @y_start: Y value of top left corner of ROI, default 0.\n+ * @x_end: X value of bottom right corner of ROI\n+ * @y_end: Y value of bottom right corner of ROI\n+ *\n+ * The AE block accumulates 4 global weighted histograms(R, G, B, Y) over\n+ * a defined ROI within the frame. The contribution of each pixel into the\n+ * histogram, defined by &ipu3_uapi_ae_weight_elem LUT, is indexed by a grid.\n+ */\n+struct ipu3_uapi_ae_grid_config {\n+\t__u8 width;\n+\t__u8 height;\n+\t__u8 block_width_log2:4;\n+\t__u8 block_height_log2:4;\n+\t__u8 reserved0:5;\n+\t__u8 ae_en:1;\n+\t__u8 rst_hist_array:1;\n+\t__u8 done_rst_hist_array:1;\n+\t__u16 x_start;\n+\t__u16 y_start;\n+\t__u16 x_end;\n+\t__u16 y_end;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ae_weight_elem - AE weights LUT\n+ *\n+ * @cell0: weighted histogram grid value.\n+ * @cell1: weighted histogram grid value.\n+ * @cell2: weighted histogram grid value.\n+ * @cell3: weighted histogram grid value.\n+ * @cell4: weighted histogram grid value.\n+ * @cell5: weighted histogram grid value.\n+ * @cell6: weighted histogram grid value.\n+ * @cell7: weighted histogram grid value.\n+ *\n+ * Use weighted grid value to give a different contribution factor to each cell.\n+ * Precision u4, range [0, 15].\n+ */\n+struct ipu3_uapi_ae_weight_elem {\n+\t__u32 cell0:4;\n+\t__u32 cell1:4;\n+\t__u32 cell2:4;\n+\t__u32 cell3:4;\n+\t__u32 cell4:4;\n+\t__u32 cell5:4;\n+\t__u32 cell6:4;\n+\t__u32 cell7:4;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ae_ccm - AE coefficients for WB and CCM\n+ *\n+ * @gain_gr: WB gain factor for the gr channels. Default 256.\n+ * @gain_r: WB gain factor for the r channel. Default 256.\n+ * @gain_b: WB gain factor for the b channel. Default 256.\n+ * @gain_gb: WB gain factor for the gb channels. Default 256.\n+ * @mat: 4x4 matrix that transforms Bayer quad output from WB to RGB+Y.\n+ *\n+ * Default:\n+ *\t128, 0, 0, 0,\n+ *\t0, 128, 0, 0,\n+ *\t0, 0, 128, 0,\n+ *\t0, 0, 0, 128,\n+ *\n+ * As part of the raw frame pre-process stage, the WB and color conversion need\n+ * to be applied to expose the impact of these gain operations.\n+ */\n+struct ipu3_uapi_ae_ccm {\n+\t__u16 gain_gr;\n+\t__u16 gain_r;\n+\t__u16 gain_b;\n+\t__u16 gain_gb;\n+\t__s16 mat[16];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ae_config - AE config\n+ *\n+ * @grid_cfg:\tconfig for auto exposure statistics grid. See struct\n+ *\t\t&ipu3_uapi_ae_grid_config\n+ * @weights:\t&IPU3_UAPI_AE_WEIGHTS is based on 32x24 blocks in the grid.\n+ *\t\tEach grid cell has a corresponding value in weights LUT called\n+ *\t\tgrid value, global histogram is updated based on grid value and\n+ *\t\tpixel value.\n+ * @ae_ccm:\tColor convert matrix pre-processing block.\n+ *\n+ * Calculate AE grid from image resolution, resample ae weights.\n+ */\n+struct ipu3_uapi_ae_config {\n+\tstruct ipu3_uapi_ae_grid_config grid_cfg __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_ae_weight_elem weights[\n+\t\t\tIPU3_UAPI_AE_WEIGHTS] __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_ae_ccm ae_ccm __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_af_filter_config - AF 2D filter for contrast measurements\n+ *\n+ * @y1_coeff_0:\tfilter Y1, structure: 3x11, support both symmetry and\n+ *\t\tanti-symmetry type. A12 is center, A1-A11 are neighbours.\n+ *\t\tfor analyzing low frequency content, used to calculate sum\n+ *\t\tof gradients in x direction.\n+ * @y1_coeff_0.a1:\tfilter1 coefficients A1, u8, default 0.\n+ * @y1_coeff_0.a2:\tfilter1 coefficients A2, u8, default 0.\n+ * @y1_coeff_0.a3:\tfilter1 coefficients A3, u8, default 0.\n+ * @y1_coeff_0.a4:\tfilter1 coefficients A4, u8, default 0.\n+ * @y1_coeff_1:\t\tStruct\n+ * @y1_coeff_1.a5:\tfilter1 coefficients A5, u8, default 0.\n+ * @y1_coeff_1.a6:\tfilter1 coefficients A6, u8, default 0.\n+ * @y1_coeff_1.a7:\tfilter1 coefficients A7, u8, default 0.\n+ * @y1_coeff_1.a8:\tfilter1 coefficients A8, u8, default 0.\n+ * @y1_coeff_2:\t\tStruct\n+ * @y1_coeff_2.a9:\tfilter1 coefficients A9, u8, default 0.\n+ * @y1_coeff_2.a10:\tfilter1 coefficients A10, u8, default 0.\n+ * @y1_coeff_2.a11:\tfilter1 coefficients A11, u8, default 0.\n+ * @y1_coeff_2.a12:\tfilter1 coefficients A12, u8, default 128.\n+ * @y1_sign_vec:\tEach bit corresponds to one coefficient sign bit,\n+ *\t\t\t0: positive, 1: negative, default 0.\n+ * @y2_coeff_0:\tY2, same structure as Y1. For analyzing high frequency content.\n+ * @y2_coeff_0.a1:\tfilter2 coefficients A1, u8, default 0.\n+ * @y2_coeff_0.a2:\tfilter2 coefficients A2, u8, default 0.\n+ * @y2_coeff_0.a3:\tfilter2 coefficients A3, u8, default 0.\n+ * @y2_coeff_0.a4:\tfilter2 coefficients A4, u8, default 0.\n+ * @y2_coeff_1:\tStruct\n+ * @y2_coeff_1.a5:\tfilter2 coefficients A5, u8, default 0.\n+ * @y2_coeff_1.a6:\tfilter2 coefficients A6, u8, default 0.\n+ * @y2_coeff_1.a7:\tfilter2 coefficients A7, u8, default 0.\n+ * @y2_coeff_1.a8:\tfilter2 coefficients A8, u8, default 0.\n+ * @y2_coeff_2:\tStruct\n+ * @y2_coeff_2.a9:\tfilter1 coefficients A9, u8, default 0.\n+ * @y2_coeff_2.a10:\tfilter1 coefficients A10, u8, default 0.\n+ * @y2_coeff_2.a11:\tfilter1 coefficients A11, u8, default 0.\n+ * @y2_coeff_2.a12:\tfilter1 coefficients A12, u8, default 128.\n+ * @y2_sign_vec:\tEach bit corresponds to one coefficient sign bit,\n+ *\t\t\t0: positive, 1: negative, default 0.\n+ * @y_calc:\tPre-processing that converts Bayer quad to RGB+Y values to be\n+ *\t\tused for building histogram. Range [0, 32], default 8.\n+ * Rule:\n+ *\t\ty_gen_rate_gr + y_gen_rate_r + y_gen_rate_b + y_gen_rate_gb = 32\n+ *\t\tA single Y is calculated based on sum of Gr/R/B/Gb based on\n+ *\t\ttheir contribution ratio.\n+ * @y_calc.y_gen_rate_gr:\tContribution ratio Gr for Y\n+ * @y_calc.y_gen_rate_r:\tContribution ratio R for Y\n+ * @y_calc.y_gen_rate_b:\tContribution ratio B for Y\n+ * @y_calc.y_gen_rate_gb:\tContribution ratio Gb for Y\n+ * @nf:\tThe shift right value that should be applied during the Y1/Y2 filter to\n+ *\tmake sure the total memory needed is 2 bytes per grid cell.\n+ * @nf.reserved0:\treserved\n+ * @nf.y1_nf:\tNormalization factor for the convolution coeffs of y1,\n+ *\t\tshould be log2 of the sum of the abs values of the filter\n+ *\t\tcoeffs, default 7 (2^7 = 128).\n+ * @nf.reserved1:\treserved\n+ * @nf.y2_nf:\tNormalization factor for y2, should be log2 of the sum of the\n+ *\t\tabs values of the filter coeffs.\n+ * @nf.reserved2:\treserved\n+ */\n+struct ipu3_uapi_af_filter_config {\n+\tstruct {\n+\t\t__u8 a1;\n+\t\t__u8 a2;\n+\t\t__u8 a3;\n+\t\t__u8 a4;\n+\t} y1_coeff_0;\n+\tstruct {\n+\t\t__u8 a5;\n+\t\t__u8 a6;\n+\t\t__u8 a7;\n+\t\t__u8 a8;\n+\t} y1_coeff_1;\n+\tstruct {\n+\t\t__u8 a9;\n+\t\t__u8 a10;\n+\t\t__u8 a11;\n+\t\t__u8 a12;\n+\t} y1_coeff_2;\n+\n+\t__u32 y1_sign_vec;\n+\n+\tstruct {\n+\t\t__u8 a1;\n+\t\t__u8 a2;\n+\t\t__u8 a3;\n+\t\t__u8 a4;\n+\t} y2_coeff_0;\n+\tstruct {\n+\t\t__u8 a5;\n+\t\t__u8 a6;\n+\t\t__u8 a7;\n+\t\t__u8 a8;\n+\t} y2_coeff_1;\n+\tstruct {\n+\t\t__u8 a9;\n+\t\t__u8 a10;\n+\t\t__u8 a11;\n+\t\t__u8 a12;\n+\t} y2_coeff_2;\n+\n+\t__u32 y2_sign_vec;\n+\n+\tstruct {\n+\t\t__u8 y_gen_rate_gr;\n+\t\t__u8 y_gen_rate_r;\n+\t\t__u8 y_gen_rate_b;\n+\t\t__u8 y_gen_rate_gb;\n+\t} y_calc;\n+\n+\tstruct {\n+\t\t__u32 reserved0:8;\n+\t\t__u32 y1_nf:4;\n+\t\t__u32 reserved1:4;\n+\t\t__u32 y2_nf:4;\n+\t\t__u32 reserved2:12;\n+\t} nf;\n+} __attribute__((packed));\n+\n+#define IPU3_UAPI_AF_MAX_SETS\t\t\t\t24\n+#define IPU3_UAPI_AF_MD_ITEM_SIZE\t\t\t4\n+#define IPU3_UAPI_AF_SPARE_FOR_BUBBLES \\\n+\t(IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \\\n+\t IPU3_UAPI_AF_MD_ITEM_SIZE)\n+#define IPU3_UAPI_AF_Y_TABLE_SET_SIZE\t\t\t128\n+#define IPU3_UAPI_AF_Y_TABLE_MAX_SIZE \\\n+\t(IPU3_UAPI_AF_MAX_SETS * \\\n+\t (IPU3_UAPI_AF_Y_TABLE_SET_SIZE + IPU3_UAPI_AF_SPARE_FOR_BUBBLES) * \\\n+\t IPU3_UAPI_MAX_STRIPES)\n+\n+/**\n+ * struct ipu3_uapi_af_raw_buffer - AF meta data\n+ *\n+ * @y_table:\tEach color component will be convolved separately with filter1\n+ *\t\tand filter2 and the result will be summed out and averaged for\n+ *\t\teach cell.\n+ */\n+struct ipu3_uapi_af_raw_buffer {\n+\t__u8 y_table[IPU3_UAPI_AF_Y_TABLE_MAX_SIZE] __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_af_config_s - AF config\n+ *\n+ * @filter_config: AF uses Y1 and Y2 filters as configured in\n+ *\t\t   &ipu3_uapi_af_filter_config\n+ * @padding: paddings\n+ * @grid_cfg: See &ipu3_uapi_grid_config, default resolution 16x16. Use large\n+ *\t      grid size for large image and vice versa.\n+ */\n+struct ipu3_uapi_af_config_s {\n+\tstruct ipu3_uapi_af_filter_config filter_config __attribute__((aligned(32)));\n+\t__u8 padding[4];\n+\tstruct ipu3_uapi_grid_config grid_cfg __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+#define IPU3_UAPI_AWB_FR_MAX_SETS\t\t\t24\n+#define IPU3_UAPI_AWB_FR_MD_ITEM_SIZE\t\t\t8\n+#define IPU3_UAPI_AWB_FR_BAYER_TBL_SIZE\t\t\t256\n+#define IPU3_UAPI_AWB_FR_SPARE_FOR_BUBBLES \\\n+\t(IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \\\n+\t IPU3_UAPI_AWB_FR_MD_ITEM_SIZE)\n+#define IPU3_UAPI_AWB_FR_BAYER_TABLE_MAX_SIZE \\\n+\t(IPU3_UAPI_AWB_FR_MAX_SETS * \\\n+\t(IPU3_UAPI_AWB_FR_BAYER_TBL_SIZE + \\\n+\t IPU3_UAPI_AWB_FR_SPARE_FOR_BUBBLES) * IPU3_UAPI_MAX_STRIPES)\n+\n+/**\n+ * struct ipu3_uapi_awb_fr_meta_data - AWB filter response meta data\n+ *\n+ * @meta_data: Statistics output on the grid after convolving with 1D filter.\n+ */\n+struct ipu3_uapi_awb_fr_raw_buffer {\n+\t__u8 meta_data[IPU3_UAPI_AWB_FR_BAYER_TABLE_MAX_SIZE]\n+\t\t__attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_awb_fr_config_s - AWB filter response config\n+ *\n+ * @grid_cfg:\tgrid config, default 16x16.\n+ * @bayer_coeff:\t1D Filter 1x11 center symmetry/anti-symmetry.\n+ *\t\t\tcoefficients defaults { 0, 0, 0, 0, 0, 128 }.\n+ *\t\t\tApplied on whole image for each Bayer channel separately\n+ *\t\t\tby a weighted sum of its 11x1 neighbors.\n+ * @reserved1:\treserved\n+ * @bayer_sign:\tsign of filter coefficients, default 0.\n+ * @bayer_nf:\tnormalization factor for the convolution coeffs, to make sure\n+ *\t\ttotal memory needed is within pre-determined range.\n+ *\t\tNF should be the log2 of the sum of the abs values of the\n+ *\t\tfilter coeffs, range [7, 14], default 7.\n+ * @reserved2:\treserved\n+ */\n+struct ipu3_uapi_awb_fr_config_s {\n+\tstruct ipu3_uapi_grid_config grid_cfg;\n+\t__u8 bayer_coeff[6];\n+\t__u16 reserved1;\n+\t__u32 bayer_sign;\n+\t__u8 bayer_nf;\n+\t__u8 reserved2[3];\n+} __attribute__((aligned(32))) __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_4a_config - 4A config\n+ *\n+ * @awb_config: &ipu3_uapi_awb_config_s, default resolution 16x16\n+ * @ae_grd_config: auto exposure statistics &ipu3_uapi_ae_grid_config\n+ * @padding: paddings\n+ * @af_config: auto focus config &ipu3_uapi_af_config_s\n+ * @awb_fr_config: &ipu3_uapi_awb_fr_config_s, default resolution 16x16\n+ */\n+struct ipu3_uapi_4a_config {\n+\tstruct ipu3_uapi_awb_config_s awb_config __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_ae_grid_config ae_grd_config;\n+\t__u8 padding[20];\n+\tstruct ipu3_uapi_af_config_s af_config;\n+\tstruct ipu3_uapi_awb_fr_config_s awb_fr_config;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bubble_info - Bubble info for host side debugging\n+ *\n+ * @num_of_stripes: A single frame is divided into several parts called stripes\n+ *\t\t    due to limitation on line buffer memory.\n+ *\t\t    The separation between the stripes is vertical. Each such\n+ *\t\t    stripe is processed as a single frame by the ISP pipe.\n+ * @padding: padding bytes.\n+ * @num_sets: number of sets.\n+ * @padding1: padding bytes.\n+ * @size_of_set: set size.\n+ * @padding2: padding bytes.\n+ * @bubble_size: is the amount of padding in the bubble expressed in \"sets\".\n+ * @padding3: padding bytes.\n+ */\n+struct ipu3_uapi_bubble_info {\n+\t__u32 num_of_stripes __attribute__((aligned(32)));\n+\t__u8 padding[28];\n+\t__u32 num_sets;\n+\t__u8 padding1[28];\n+\t__u32 size_of_set;\n+\t__u8 padding2[28];\n+\t__u32 bubble_size;\n+\t__u8 padding3[28];\n+} __attribute__((packed));\n+\n+/*\n+ * struct ipu3_uapi_stats_3a_bubble_info_per_stripe\n+ */\n+struct ipu3_uapi_stats_3a_bubble_info_per_stripe {\n+\tstruct ipu3_uapi_bubble_info awb[IPU3_UAPI_MAX_STRIPES];\n+\tstruct ipu3_uapi_bubble_info af[IPU3_UAPI_MAX_STRIPES];\n+\tstruct ipu3_uapi_bubble_info awb_fr[IPU3_UAPI_MAX_STRIPES];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ff_status - Enable bits for each 3A fixed function\n+ *\n+ * @awb_en: auto white balance enable\n+ * @padding: padding config\n+ * @ae_en: auto exposure enable\n+ * @padding1: padding config\n+ * @af_en: auto focus enable\n+ * @padding2: padding config\n+ * @awb_fr_en: awb filter response enable bit\n+ * @padding3: padding config\n+ */\n+struct ipu3_uapi_ff_status {\n+\t__u32 awb_en __attribute__((aligned(32)));\n+\t__u8 padding[28];\n+\t__u32 ae_en;\n+\t__u8 padding1[28];\n+\t__u32 af_en;\n+\t__u8 padding2[28];\n+\t__u32 awb_fr_en;\n+\t__u8 padding3[28];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_stats_3a - 3A statistics\n+ *\n+ * @awb_raw_buffer: auto white balance meta data &ipu3_uapi_awb_raw_buffer\n+ * @ae_raw_buffer: auto exposure raw data &ipu3_uapi_ae_raw_buffer_aligned\n+ * @af_raw_buffer: &ipu3_uapi_af_raw_buffer for auto focus meta data\n+ * @awb_fr_raw_buffer: value as specified by &ipu3_uapi_awb_fr_raw_buffer\n+ * @stats_4a_config: 4a statistics config as defined by &ipu3_uapi_4a_config.\n+ * @ae_join_buffers: 1 to use ae_raw_buffer.\n+ * @padding: padding config\n+ * @stats_3a_bubble_per_stripe: a &ipu3_uapi_stats_3a_bubble_info_per_stripe\n+ * @stats_3a_status: 3a statistics status set in &ipu3_uapi_ff_status\n+ */\n+struct ipu3_uapi_stats_3a {\n+\tstruct ipu3_uapi_awb_raw_buffer awb_raw_buffer;\n+\tstruct ipu3_uapi_ae_raw_buffer_aligned\n+\t\t\tae_raw_buffer[IPU3_UAPI_MAX_STRIPES];\n+\tstruct ipu3_uapi_af_raw_buffer af_raw_buffer;\n+\tstruct ipu3_uapi_awb_fr_raw_buffer awb_fr_raw_buffer;\n+\tstruct ipu3_uapi_4a_config stats_4a_config;\n+\t__u32 ae_join_buffers;\n+\t__u8 padding[28];\n+\tstruct ipu3_uapi_stats_3a_bubble_info_per_stripe\n+\t\t\tstats_3a_bubble_per_stripe;\n+\tstruct ipu3_uapi_ff_status stats_3a_status;\n+} __attribute__((packed));\n+\n+/******************* ipu3_uapi_acc_param *******************/\n+\n+#define IPU3_UAPI_ISP_VEC_ELEMS\t\t\t\t64\n+#define IPU3_UAPI_ISP_TNR3_VMEM_LEN\t\t\t9\n+\n+#define IPU3_UAPI_BNR_LUT_SIZE\t\t\t\t32\n+\n+/* number of elements in gamma correction LUT */\n+#define IPU3_UAPI_GAMMA_CORR_LUT_ENTRIES\t\t256\n+\n+/* largest grid is 73x56, for grid_height_per_slice of 2, 73x2 = 146 */\n+#define IPU3_UAPI_SHD_MAX_CELLS_PER_SET\t\t\t146\n+#define IPU3_UAPI_SHD_MAX_CFG_SETS\t\t\t28\n+/* Normalization shift aka nf */\n+#define IPU3_UAPI_SHD_BLGR_NF_SHIFT\t\t\t13\n+#define IPU3_UAPI_SHD_BLGR_NF_MASK\t\t\t7\n+\n+#define IPU3_UAPI_YUVP2_TCC_MACC_TABLE_ELEMENTS\t\t16\n+#define IPU3_UAPI_YUVP2_TCC_INV_Y_LUT_ELEMENTS\t\t14\n+#define IPU3_UAPI_YUVP2_TCC_GAIN_PCWL_LUT_ELEMENTS\t258\n+#define IPU3_UAPI_YUVP2_TCC_R_SQR_LUT_ELEMENTS\t\t24\n+\n+#define IPU3_UAPI_ANR_LUT_SIZE\t\t\t\t26\n+#define IPU3_UAPI_ANR_PYRAMID_SIZE\t\t\t22\n+\n+#define IPU3_UAPI_LIN_LUT_SIZE\t\t\t\t64\n+\n+/* Bayer Noise Reduction related structs */\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_wb_gains_config - White balance gains\n+ *\n+ * @gr:\twhite balance gain for Gr channel.\n+ * @r:\twhite balance gain for R channel.\n+ * @b:\twhite balance gain for B channel.\n+ * @gb:\twhite balance gain for Gb channel.\n+ *\n+ * Precision u3.13, range [0, 8). White balance correction is done by applying\n+ * a multiplicative gain to each color channels prior to BNR.\n+ */\n+struct ipu3_uapi_bnr_static_config_wb_gains_config {\n+\t__u16 gr;\n+\t__u16 r;\n+\t__u16 b;\n+\t__u16 gb;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_wb_gains_thr_config - Threshold config\n+ *\n+ * @gr:\twhite balance threshold gain for Gr channel.\n+ * @r:\twhite balance threshold gain for R channel.\n+ * @b:\twhite balance threshold gain for B channel.\n+ * @gb:\twhite balance threshold gain for Gb channel.\n+ *\n+ * Defines the threshold that specifies how different a defect pixel can be from\n+ * its neighbors.(used by dynamic defect pixel correction sub block)\n+ * Precision u4.4 range [0, 8].\n+ */\n+struct ipu3_uapi_bnr_static_config_wb_gains_thr_config {\n+\t__u8 gr;\n+\t__u8 r;\n+\t__u8 b;\n+\t__u8 gb;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_thr_coeffs_config - Noise model\n+ *\t\t\t\tcoefficients that controls noise threshold\n+ *\n+ * @cf:\tFree coefficient for threshold calculation, range [0, 8191], default 0.\n+ * @reserved0:\treserved\n+ * @cg:\tGain coefficient for threshold calculation, [0, 31], default 8.\n+ * @ci:\tIntensity coefficient for threshold calculation. range [0, 0x1f]\n+ *\tdefault 6.\n+ * \tformat: u3.2 (3 most significant bits represent whole number,\n+ *\t2 least significant bits represent the fractional part\n+ *\twith each count representing 0.25)\n+ *\te.g. 6 in binary format is 00110, that translates to 1.5\n+ * @reserved1:\treserved\n+ * @r_nf:\tNormalization shift value for r^2 calculation, range [12, 20]\n+ *\t\twhere r is a radius of pixel [row, col] from centor of sensor.\n+ *\t\tdefault 14.\n+ *\n+ * Threshold used to distinguish between noise and details.\n+ */\n+struct ipu3_uapi_bnr_static_config_thr_coeffs_config {\n+\t__u32 cf:13;\n+\t__u32 reserved0:3;\n+\t__u32 cg:5;\n+\t__u32 ci:5;\n+\t__u32 reserved1:1;\n+\t__u32 r_nf:5;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_thr_ctrl_shd_config - Shading config\n+ *\n+ * @gr:\tCoefficient defines lens shading gain approximation for gr channel\n+ * @r:\tCoefficient defines lens shading gain approximation for r channel\n+ * @b:\tCoefficient defines lens shading gain approximation for b channel\n+ * @gb:\tCoefficient defines lens shading gain approximation for gb channel\n+ *\n+ * Parameters for noise model (NM) adaptation of BNR due to shading correction.\n+ * All above have precision of u3.3, default to 0.\n+ */\n+struct ipu3_uapi_bnr_static_config_thr_ctrl_shd_config {\n+\t__u8 gr;\n+\t__u8 r;\n+\t__u8 b;\n+\t__u8 gb;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_opt_center_config - Optical center config\n+ *\n+ * @x_reset:\tReset value of X (col start - X center). Precision s12.0.\n+ * @reserved0:\treserved\n+ * @y_reset:\tReset value of Y (row start - Y center). Precision s12.0.\n+ * @reserved2:\treserved\n+ *\n+ * Distance from corner to optical center for NM adaptation due to shading\n+ * correction (should be calculated based on shading tables)\n+ */\n+struct ipu3_uapi_bnr_static_config_opt_center_config {\n+\t__s32 x_reset:13;\n+\t__u32 reserved0:3;\n+\t__s32 y_reset:13;\n+\t__u32 reserved2:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_lut_config - BNR square root lookup table\n+ *\n+ * @values: pre-calculated values of square root function.\n+ *\n+ * LUT implementation of square root operation.\n+ */\n+struct ipu3_uapi_bnr_static_config_lut_config {\n+\t__u8 values[IPU3_UAPI_BNR_LUT_SIZE];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_bp_ctrl_config - Detect bad pixels (bp)\n+ *\n+ * @bp_thr_gain:\tDefines the threshold that specifies how different a\n+ *\t\t\tdefect pixel can be from its neighbors. Threshold is\n+ *\t\t\tdependent on de-noise threshold calculated by algorithm.\n+ *\t\t\tRange [4, 31], default 4.\n+ * @reserved0:\treserved\n+ * @defect_mode:\tMode of addressed defect pixels,\n+ *\t\t\t0 - single defect pixel is expected,\n+ *\t\t\t1 - 2 adjacent defect pixels are expected, default 1.\n+ * @bp_gain:\tDefines how 2nd derivation that passes through a defect pixel\n+ *\t\tis different from 2nd derivations that pass through\n+ *\t\tneighbor pixels. u4.2, range [0, 256], default 8.\n+ * @reserved1:\treserved\n+ * @w0_coeff:\tBlending coefficient of defect pixel correction.\n+ *\t\tPrecision u4, range [0, 8], default 8.\n+ * @reserved2:\treserved\n+ * @w1_coeff:\tEnable influence of incorrect defect pixel correction to be\n+ *\t\tavoided. Precision u4, range [1, 8], default 8.\n+ * @reserved3:\treserved\n+ */\n+struct ipu3_uapi_bnr_static_config_bp_ctrl_config {\n+\t__u32 bp_thr_gain:5;\n+\t__u32 reserved0:2;\n+\t__u32 defect_mode:1;\n+\t__u32 bp_gain:6;\n+\t__u32 reserved1:18;\n+\t__u32 w0_coeff:4;\n+\t__u32 reserved2:4;\n+\t__u32 w1_coeff:4;\n+\t__u32 reserved3:20;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_dn_detect_ctrl_config - Denoising config\n+ *\n+ * @alpha:\tWeight of central element of smoothing filter.\n+ * @beta:\tWeight of peripheral elements of smoothing filter, default 4.\n+ * @gamma:\tWeight of diagonal elements of smoothing filter, default 4.\n+ *\n+ * beta and gamma parameter define the strength of the noise removal filter.\n+ *\t\tAll above has precision u0.4, range [0, 0xf]\n+ *\t\tformat: u0.4 (no / zero bits represent whole number,\n+ *\t\t4 bits represent the fractional part\n+ *\t\twith each count representing 0.0625)\n+ *\t\te.g. 0xf translates to 0.0625x15 = 0.9375\n+ *\n+ * @reserved0:\treserved\n+ * @max_inf:\tMaximum increase of peripheral or diagonal element influence\n+ *\t\trelative to the pre-defined value range: [0x5, 0xa]\n+ * @reserved1:\treserved\n+ * @gd_enable:\tGreen disparity enable control, 0 - disable, 1 - enable.\n+ * @bpc_enable:\tBad pixel correction enable control, 0 - disable, 1 - enable.\n+ * @bnr_enable:\tBayer noise removal enable control, 0 - disable, 1 - enable.\n+ * @ff_enable:\tFixed function enable, 0 - disable, 1 - enable.\n+ * @reserved2:\treserved\n+ */\n+struct ipu3_uapi_bnr_static_config_dn_detect_ctrl_config {\n+\t__u32 alpha:4;\n+\t__u32 beta:4;\n+\t__u32 gamma:4;\n+\t__u32 reserved0:4;\n+\t__u32 max_inf:4;\n+\t__u32 reserved1:7;\n+\t__u32 gd_enable:1;\n+\t__u32 bpc_enable:1;\n+\t__u32 bnr_enable:1;\n+\t__u32 ff_enable:1;\n+\t__u32 reserved2:1;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_opt_center_sqr_config - BNR optical square\n+ *\n+ * @x_sqr_reset: Reset value of X^2.\n+ * @y_sqr_reset: Reset value of Y^2.\n+ *\n+ * Please note:\n+ *\n+ *    #. X and Y ref to\n+ *       &ipu3_uapi_bnr_static_config_opt_center_config\n+ *    #. Both structs are used in threshold formula to calculate r^2, where r\n+ *       is a radius of pixel [row, col] from centor of sensor.\n+ */\n+struct ipu3_uapi_bnr_static_config_opt_center_sqr_config {\n+\t__u32 x_sqr_reset;\n+\t__u32 y_sqr_reset;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config - BNR static config\n+ *\n+ * @wb_gains:\twhite balance gains &ipu3_uapi_bnr_static_config_wb_gains_config\n+ * @wb_gains_thr:\twhite balance gains threshold as defined by\n+ *\t\t\t&ipu3_uapi_bnr_static_config_wb_gains_thr_config\n+ * @thr_coeffs:\tcoefficients of threshold\n+ *\t\t&ipu3_uapi_bnr_static_config_thr_coeffs_config\n+ * @thr_ctrl_shd:\tcontrol of shading threshold\n+ *\t\t\t&ipu3_uapi_bnr_static_config_thr_ctrl_shd_config\n+ * @opt_center:\toptical center &ipu3_uapi_bnr_static_config_opt_center_config\n+ *\n+ * Above parameters and opt_center_sqr are used for white balance and shading.\n+ *\n+ * @lut:\tlookup table &ipu3_uapi_bnr_static_config_lut_config\n+ * @bp_ctrl:\tdetect and remove bad pixels as defined in struct\n+ *\t\t&ipu3_uapi_bnr_static_config_bp_ctrl_config\n+ * @dn_detect_ctrl:\tdetect and remove noise.\n+ *\t\t\t&ipu3_uapi_bnr_static_config_dn_detect_ctrl_config\n+ * @column_size:\tThe number of pixels in column.\n+ * @opt_center_sqr:\tReset value of r^2 to optical center, see\n+ *\t\t\t&ipu3_uapi_bnr_static_config_opt_center_sqr_config.\n+ */\n+struct ipu3_uapi_bnr_static_config {\n+\tstruct ipu3_uapi_bnr_static_config_wb_gains_config wb_gains;\n+\tstruct ipu3_uapi_bnr_static_config_wb_gains_thr_config wb_gains_thr;\n+\tstruct ipu3_uapi_bnr_static_config_thr_coeffs_config thr_coeffs;\n+\tstruct ipu3_uapi_bnr_static_config_thr_ctrl_shd_config thr_ctrl_shd;\n+\tstruct ipu3_uapi_bnr_static_config_opt_center_config opt_center;\n+\tstruct ipu3_uapi_bnr_static_config_lut_config lut;\n+\tstruct ipu3_uapi_bnr_static_config_bp_ctrl_config bp_ctrl;\n+\tstruct ipu3_uapi_bnr_static_config_dn_detect_ctrl_config dn_detect_ctrl;\n+\t__u32 column_size;\n+\tstruct ipu3_uapi_bnr_static_config_opt_center_sqr_config opt_center_sqr;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_bnr_static_config_green_disparity - Correct green disparity\n+ *\n+ * @gd_red:\tShading gain coeff for gr disparity level in bright red region.\n+ *\t\tPrecision u0.6, default 4(0.0625).\n+ * @reserved0:\treserved\n+ * @gd_green:\tShading gain coeff for gr disparity level in bright green\n+ *\t\tregion. Precision u0.6, default 4(0.0625).\n+ * @reserved1:\treserved\n+ * @gd_blue:\tShading gain coeff for gr disparity level in bright blue region.\n+ *\t\tPrecision u0.6, default 4(0.0625).\n+ * @reserved2:\treserved\n+ * @gd_black:\tMaximal green disparity level in dark region (stronger disparity\n+ *\t\tassumed to be image detail). Precision u14, default 80.\n+ * @reserved3:\treserved\n+ * @gd_shading:\tChange maximal green disparity level according to square\n+ *\t\tdistance from image center.\n+ * @reserved4:\treserved\n+ * @gd_support:\tLower bound for the number of second green color pixels in\n+ *\t\tcurrent pixel neighborhood with less than threshold difference\n+ *\t\tfrom it.\n+ *\n+ * The shading gain coeff of red, green, blue and black are used to calculate\n+ * threshold given a pixel's color value and its coordinates in the image.\n+ *\n+ * @reserved5:\treserved\n+ * @gd_clip:\tTurn green disparity clip on/off, [0, 1], default 1.\n+ * @gd_central_weight:\tCentral pixel weight in 9 pixels weighted sum.\n+ */\n+struct ipu3_uapi_bnr_static_config_green_disparity {\n+\t__u32 gd_red:6;\n+\t__u32 reserved0:2;\n+\t__u32 gd_green:6;\n+\t__u32 reserved1:2;\n+\t__u32 gd_blue:6;\n+\t__u32 reserved2:10;\n+\t__u32 gd_black:14;\n+\t__u32 reserved3:2;\n+\t__u32 gd_shading:7;\n+\t__u32 reserved4:1;\n+\t__u32 gd_support:2;\n+\t__u32 reserved5:1;\n+\t__u32 gd_clip:1;\n+\t__u32 gd_central_weight:4;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_dm_config - De-mosaic parameters\n+ *\n+ * @dm_en:\tde-mosaic enable.\n+ * @ch_ar_en:\tChecker artifacts removal enable flag. Default 0.\n+ * @fcc_en:\tFalse color correction (FCC) enable flag. Default 0.\n+ * @reserved0:\treserved\n+ * @frame_width:\tdo not care\n+ * @gamma_sc:\tSharpening coefficient (coefficient of 2-d derivation of\n+ *\t\tcomplementary color in Hamilton-Adams interpolation).\n+ *\t\tu5, range [0, 31], default 8.\n+ * @reserved1:\treserved\n+ * @lc_ctrl:\tParameter that controls weights of Chroma Homogeneity metric\n+ *\t\tin calculation of final homogeneity metric.\n+ *\t\tu5, range [0, 31], default 7.\n+ * @reserved2:\treserved\n+ * @cr_param1:\tFirst parameter that defines Checker artifact removal\n+ *\t\tfeature gain. Precision u5, range [0, 31], default 8.\n+ * @reserved3:\treserved\n+ * @cr_param2:\tSecond parameter that defines Checker artifact removal\n+ *\t\tfeature gain. Precision u5, range [0, 31], default 8.\n+ * @reserved4:\treserved\n+ * @coring_param:\tDefines power of false color correction operation.\n+ *\t\t\tlow for preserving edge colors, high for preserving gray\n+ *\t\t\tedge artifacts.\n+ *\t\t\tPrecision u1.4, range [0, 1.9375], default 4 (0.25).\n+ * @reserved5:\treserved\n+ *\n+ * The demosaic fixed function block is responsible to covert Bayer(mosaiced)\n+ * images into color images based on demosaicing algorithm.\n+ */\n+struct ipu3_uapi_dm_config {\n+\t__u32 dm_en:1;\n+\t__u32 ch_ar_en:1;\n+\t__u32 fcc_en:1;\n+\t__u32 reserved0:13;\n+\t__u32 frame_width:16;\n+\n+\t__u32 gamma_sc:5;\n+\t__u32 reserved1:3;\n+\t__u32 lc_ctrl:5;\n+\t__u32 reserved2:3;\n+\t__u32 cr_param1:5;\n+\t__u32 reserved3:3;\n+\t__u32 cr_param2:5;\n+\t__u32 reserved4:3;\n+\n+\t__u32 coring_param:5;\n+\t__u32 reserved5:27;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_ccm_mat_config - Color correction matrix\n+ *\n+ * @coeff_m11: CCM 3x3 coefficient, range [-65536, 65535]\n+ * @coeff_m12: CCM 3x3 coefficient, range [-8192, 8191]\n+ * @coeff_m13: CCM 3x3 coefficient, range [-32768, 32767]\n+ * @coeff_o_r: Bias 3x1 coefficient, range [-8191, 8181]\n+ * @coeff_m21: CCM 3x3 coefficient, range [-32767, 32767]\n+ * @coeff_m22: CCM 3x3 coefficient, range [-8192, 8191]\n+ * @coeff_m23: CCM 3x3 coefficient, range [-32768, 32767]\n+ * @coeff_o_g: Bias 3x1 coefficient, range [-8191, 8181]\n+ * @coeff_m31: CCM 3x3 coefficient, range [-32768, 32767]\n+ * @coeff_m32: CCM 3x3 coefficient, range [-8192, 8191]\n+ * @coeff_m33: CCM 3x3 coefficient, range [-32768, 32767]\n+ * @coeff_o_b: Bias 3x1 coefficient, range [-8191, 8181]\n+ *\n+ * Transform sensor specific color space to standard sRGB by applying 3x3 matrix\n+ * and adding a bias vector O. The transformation is basically a rotation and\n+ * translation in the 3-dimensional color spaces. Here are the defaults:\n+ *\n+ *\t9775,\t-2671,\t1087,\t0\n+ *\t-1071,\t8303,\t815,\t0\n+ *\t-23,\t-7887,\t16103,\t0\n+ */\n+struct ipu3_uapi_ccm_mat_config {\n+\t__s16 coeff_m11;\n+\t__s16 coeff_m12;\n+\t__s16 coeff_m13;\n+\t__s16 coeff_o_r;\n+\t__s16 coeff_m21;\n+\t__s16 coeff_m22;\n+\t__s16 coeff_m23;\n+\t__s16 coeff_o_g;\n+\t__s16 coeff_m31;\n+\t__s16 coeff_m32;\n+\t__s16 coeff_m33;\n+\t__s16 coeff_o_b;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_gamma_corr_ctrl - Gamma correction\n+ *\n+ * @enable: gamma correction enable.\n+ * @reserved: reserved\n+ */\n+struct ipu3_uapi_gamma_corr_ctrl {\n+\t__u32 enable:1;\n+\t__u32 reserved:31;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_gamma_corr_lut - Per-pixel tone mapping implemented as LUT.\n+ *\n+ * @lut:\t256 tabulated values of the gamma function. LUT[1].. LUT[256]\n+ *\t\tformat u13.0, range [0, 8191].\n+ *\n+ * The tone mapping operation is done by a Piece wise linear graph\n+ * that is implemented as a lookup table(LUT). The pixel component input\n+ * intensity is the X-axis of the graph which is the table entry.\n+ */\n+struct ipu3_uapi_gamma_corr_lut {\n+\t__u16 lut[IPU3_UAPI_GAMMA_CORR_LUT_ENTRIES];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_gamma_config - Gamma config\n+ *\n+ * @gc_ctrl: control of gamma correction &ipu3_uapi_gamma_corr_ctrl\n+ * @gc_lut: lookup table of gamma correction &ipu3_uapi_gamma_corr_lut\n+ */\n+struct ipu3_uapi_gamma_config {\n+\tstruct ipu3_uapi_gamma_corr_ctrl gc_ctrl __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_gamma_corr_lut gc_lut __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_csc_mat_config - Color space conversion matrix config\n+ *\n+ * @coeff_c11:\tConversion matrix value, format s0.14, range [-16384, 16383].\n+ * @coeff_c12:\tConversion matrix value, format s0.14, range [-8192, 8191].\n+ * @coeff_c13:\tConversion matrix value, format s0.14, range [-16384, 16383].\n+ * @coeff_b1:\tBias 3x1 coefficient, s13.0 range [-8192, 8191].\n+ * @coeff_c21:\tConversion matrix value, format s0.14, range [-16384, 16383].\n+ * @coeff_c22:\tConversion matrix value, format s0.14, range [-8192, 8191].\n+ * @coeff_c23:\tConversion matrix value, format s0.14, range [-16384, 16383].\n+ * @coeff_b2:\tBias 3x1 coefficient, s13.0 range [-8192, 8191].\n+ * @coeff_c31:\tConversion matrix value, format s0.14, range [-16384, 16383].\n+ * @coeff_c32:\tConversion matrix value, format s0.14, range [-8192, 8191].\n+ * @coeff_c33:\tConversion matrix value, format s0.14, range [-16384, 16383].\n+ * @coeff_b3:\tBias 3x1 coefficient, s13.0 range [-8192, 8191].\n+ *\n+ * To transform each pixel from RGB to YUV (Y - brightness/luminance,\n+ * UV -chroma) by applying the pixel's values by a 3x3 matrix and adding an\n+ * optional bias 3x1 vector. Here are the default values for the matrix:\n+ *\n+ *\t4898,   9617,  1867, 0,\n+ *\t-2410, -4732,  7143, 0,\n+ *\t10076, -8437, -1638, 0,\n+ *\n+ *\t(i.e. for real number 0.299, 0.299 * 2^14 becomes 4898.)\n+ */\n+struct ipu3_uapi_csc_mat_config {\n+\t__s16 coeff_c11;\n+\t__s16 coeff_c12;\n+\t__s16 coeff_c13;\n+\t__s16 coeff_b1;\n+\t__s16 coeff_c21;\n+\t__s16 coeff_c22;\n+\t__s16 coeff_c23;\n+\t__s16 coeff_b2;\n+\t__s16 coeff_c31;\n+\t__s16 coeff_c32;\n+\t__s16 coeff_c33;\n+\t__s16 coeff_b3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_cds_params - Chroma down-scaling\n+ *\n+ * @ds_c00:\trange [0, 3]\n+ * @ds_c01:\trange [0, 3]\n+ * @ds_c02:\trange [0, 3]\n+ * @ds_c03:\trange [0, 3]\n+ * @ds_c10:\trange [0, 3]\n+ * @ds_c11:\trange [0, 3]\n+ * @ds_c12:\trange [0, 3]\n+ * @ds_c13:\trange [0, 3]\n+ *\n+ * In case user does not provide, above 4x2 filter will use following defaults:\n+ *\t1, 3, 3, 1,\n+ *\t1, 3, 3, 1,\n+ *\n+ * @ds_nf:\tNormalization factor for Chroma output downscaling filter,\n+ *\t\trange 0,4, default 2.\n+ * @reserved0:\treserved\n+ * @csc_en:\tColor space conversion enable\n+ * @uv_bin_output:\t0: output YUV 4.2.0, 1: output YUV 4.2.2(default).\n+ * @reserved1:\treserved\n+ */\n+struct ipu3_uapi_cds_params {\n+\t__u32 ds_c00:2;\n+\t__u32 ds_c01:2;\n+\t__u32 ds_c02:2;\n+\t__u32 ds_c03:2;\n+\t__u32 ds_c10:2;\n+\t__u32 ds_c11:2;\n+\t__u32 ds_c12:2;\n+\t__u32 ds_c13:2;\n+\t__u32 ds_nf:5;\n+\t__u32 reserved0:3;\n+\t__u32 csc_en:1;\n+\t__u32 uv_bin_output:1;\n+\t__u32 reserved1:6;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_shd_grid_config - Bayer shading(darkening) correction\n+ *\n+ * @width:\tGrid horizontal dimensions, u8, [8, 128], default 73\n+ * @height:\tGrid vertical dimensions, u8, [8, 128], default 56\n+ * @block_width_log2:\tLog2 of the width of the grid cell in pixel count\n+ *\t\t\tu4, [0, 15], default value 5.\n+ * @reserved0:\treserved\n+ * @block_height_log2:\tLog2 of the height of the grid cell in pixel count\n+ *\t\t\tu4, [0, 15], default value 6.\n+ * @reserved1:\treserved\n+ * @grid_height_per_slice:\tSHD_MAX_CELLS_PER_SET/width.\n+ *\t\t\t\t(with SHD_MAX_CELLS_PER_SET = 146).\n+ * @x_start:\tX value of top left corner of sensor relative to ROI\n+ *\t\ts13, [-4096, 0], default 0, only negative values.\n+ * @y_start:\tY value of top left corner of sensor relative to ROI\n+ *\t\ts13, [-4096, 0], default 0, only negative values.\n+ */\n+struct ipu3_uapi_shd_grid_config {\n+\t/* reg 0 */\n+\t__u8 width;\n+\t__u8 height;\n+\t__u8 block_width_log2:3;\n+\t__u8 reserved0:1;\n+\t__u8 block_height_log2:3;\n+\t__u8 reserved1:1;\n+\t__u8 grid_height_per_slice;\n+\t/* reg 1 */\n+\t__s16 x_start;\n+\t__s16 y_start;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_shd_general_config - Shading general config\n+ *\n+ * @init_set_vrt_offst_ul: set vertical offset,\n+ *\t\t\ty_start >> block_height_log2 % grid_height_per_slice.\n+ * @shd_enable: shading enable.\n+ * @gain_factor: Gain factor. Shift calculated anti shading value. Precision u2.\n+ *\t\t0x0 - gain factor [1, 5], means no shift interpolated value.\n+ *\t\t0x1 - gain factor [1, 9], means shift interpolated by 1.\n+ *\t\t0x2 - gain factor [1, 17], means shift interpolated by 2.\n+ * @reserved: reserved\n+ *\n+ * Correction is performed by multiplying a gain factor for each of the 4 Bayer\n+ * channels as a function of the pixel location in the sensor.\n+ */\n+struct ipu3_uapi_shd_general_config {\n+\t__u32 init_set_vrt_offst_ul:8;\n+\t__u32 shd_enable:1;\n+\t__u32 gain_factor:2;\n+\t__u32 reserved:21;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_shd_black_level_config - Black level correction\n+ *\n+ * @bl_r:\tBios values for green red. s11 range [-2048, 2047].\n+ * @bl_gr:\tBios values for green blue. s11 range [-2048, 2047].\n+ * @bl_gb:\tBios values for red. s11 range [-2048, 2047].\n+ * @bl_b:\tBios values for blue. s11 range [-2048, 2047].\n+ */\n+struct ipu3_uapi_shd_black_level_config {\n+\t__s16 bl_r;\n+\t__s16 bl_gr;\n+\t__s16 bl_gb;\n+\t__s16 bl_b;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_shd_config_static - Shading config static\n+ *\n+ * @grid:\tshading grid config &ipu3_uapi_shd_grid_config\n+ * @general:\tshading general config &ipu3_uapi_shd_general_config\n+ * @black_level:\tblack level config for shading correction as defined by\n+ *\t\t\t&ipu3_uapi_shd_black_level_config\n+ */\n+struct ipu3_uapi_shd_config_static {\n+\tstruct ipu3_uapi_shd_grid_config grid;\n+\tstruct ipu3_uapi_shd_general_config general;\n+\tstruct ipu3_uapi_shd_black_level_config black_level;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_shd_lut - Shading gain factor lookup table.\n+ *\n+ * @sets: array\n+ * @sets.r_and_gr: Red and GreenR Lookup table.\n+ * @sets.r_and_gr.r: Red shading factor.\n+ * @sets.r_and_gr.gr: GreenR shading factor.\n+ * @sets.reserved1: reserved\n+ * @sets.gb_and_b: GreenB and Blue Lookup table.\n+ * @sets.gb_and_b.gb: GreenB shading factor.\n+ * @sets.gb_and_b.b: Blue shading factor.\n+ * @sets.reserved2: reserved\n+ *\n+ * Map to shading correction LUT register set.\n+ */\n+struct ipu3_uapi_shd_lut {\n+\tstruct {\n+\t\tstruct {\n+\t\t\t__u16 r;\n+\t\t\t__u16 gr;\n+\t\t} r_and_gr[IPU3_UAPI_SHD_MAX_CELLS_PER_SET];\n+\t\t__u8 reserved1[24];\n+\t\tstruct {\n+\t\t\t__u16 gb;\n+\t\t\t__u16 b;\n+\t\t} gb_and_b[IPU3_UAPI_SHD_MAX_CELLS_PER_SET];\n+\t\t__u8 reserved2[24];\n+\t} sets[IPU3_UAPI_SHD_MAX_CFG_SETS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_shd_config - Shading config\n+ *\n+ * @shd:\tshading static config, see &ipu3_uapi_shd_config_static\n+ * @shd_lut:\tshading lookup table &ipu3_uapi_shd_lut\n+ */\n+struct ipu3_uapi_shd_config {\n+\tstruct ipu3_uapi_shd_config_static shd __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_shd_lut shd_lut __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/* Image Enhancement Filter directed */\n+\n+/**\n+ * struct ipu3_uapi_iefd_cux2 - IEFd Config Unit 2 parameters\n+ *\n+ * @x0:\t\tX0 point of Config Unit, u9.0, default 0.\n+ * @x1:\t\tX1 point of Config Unit, u9.0, default 0.\n+ * @a01:\tSlope A of Config Unit, s4.4, default 0.\n+ * @b01:\tSlope B, always 0.\n+ *\n+ * Calculate weight for blending directed and non-directed denoise elements\n+ *\n+ * Note:\n+ * Each instance of Config Unit needs X coordinate of n points and\n+ * slope A factor between points calculated by driver based on calibration\n+ * parameters.\n+ *\n+ * All CU inputs are unsigned, they will be converted to signed when written\n+ * to register, i.e. a01 will be written to 9 bit register in s4.4 format.\n+ * This applies to &ipu3_uapi_iefd_cux6_ed, &ipu3_uapi_iefd_cux2_1,\n+ * &ipu3_uapi_iefd_cux2_1, &ipu3_uapi_iefd_cux4 and &ipu3_uapi_iefd_cux6_rad.\n+ */\n+struct ipu3_uapi_iefd_cux2 {\n+\t__u32 x0:9;\n+\t__u32 x1:9;\n+\t__u32 a01:9;\n+\t__u32 b01:5;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_iefd_cux6_ed - Calculate power of non-directed sharpening\n+ *\t\t\t\t   element, Config Unit 6 for edge detail (ED).\n+ *\n+ * @x0:\tX coordinate of point 0, u9.0, default 0.\n+ * @x1:\tX coordinate of point 1, u9.0, default 0.\n+ * @x2:\tX coordinate of point 2, u9.0, default 0.\n+ * @reserved0:\treserved\n+ * @x3:\tX coordinate of point 3, u9.0, default 0.\n+ * @x4:\tX coordinate of point 4, u9.0, default 0.\n+ * @x5:\tX coordinate of point 5, u9.0, default 0.\n+ * @reserved1:\treserved\n+ * @a01:\tslope A points 01, s4.4, default 0.\n+ * @a12:\tslope A points 12, s4.4, default 0.\n+ * @a23:\tslope A points 23, s4.4, default 0.\n+ * @reserved2:\treserved\n+ * @a34:\tslope A points 34, s4.4, default 0.\n+ * @a45:\tslope A points 45, s4.4, default 0.\n+ * @reserved3:\treserved\n+ * @b01:\tslope B points 01, s4.4, default 0.\n+ * @b12:\tslope B points 12, s4.4, default 0.\n+ * @b23:\tslope B points 23, s4.4, default 0.\n+ * @reserved4:\treserved\n+ * @b34:\tslope B points 34, s4.4, default 0.\n+ * @b45:\tslope B points 45, s4.4, default 0.\n+ * @reserved5:\treserved.\n+ */\n+struct ipu3_uapi_iefd_cux6_ed {\n+\t__u32 x0:9;\n+\t__u32 x1:9;\n+\t__u32 x2:9;\n+\t__u32 reserved0:5;\n+\n+\t__u32 x3:9;\n+\t__u32 x4:9;\n+\t__u32 x5:9;\n+\t__u32 reserved1:5;\n+\n+\t__u32 a01:9;\n+\t__u32 a12:9;\n+\t__u32 a23:9;\n+\t__u32 reserved2:5;\n+\n+\t__u32 a34:9;\n+\t__u32 a45:9;\n+\t__u32 reserved3:14;\n+\n+\t__u32 b01:9;\n+\t__u32 b12:9;\n+\t__u32 b23:9;\n+\t__u32 reserved4:5;\n+\n+\t__u32 b34:9;\n+\t__u32 b45:9;\n+\t__u32 reserved5:14;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_iefd_cux2_1 - Calculate power of non-directed denoise\n+ *\t\t\t\t  element apply.\n+ * @x0: X0 point of Config Unit, u9.0, default 0.\n+ * @x1: X1 point of Config Unit, u9.0, default 0.\n+ * @a01: Slope A of Config Unit, s4.4, default 0.\n+ * @reserved1: reserved\n+ * @b01: offset B0 of Config Unit, u7.0, default 0.\n+ * @reserved2: reserved\n+ */\n+struct ipu3_uapi_iefd_cux2_1 {\n+\t__u32 x0:9;\n+\t__u32 x1:9;\n+\t__u32 a01:9;\n+\t__u32 reserved1:5;\n+\n+\t__u32 b01:8;\n+\t__u32 reserved2:24;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_iefd_cux4 - Calculate power of non-directed sharpening\n+ *\t\t\t\telement.\n+ *\n+ * @x0:\tX0 point of Config Unit, u9.0, default 0.\n+ * @x1:\tX1 point of Config Unit, u9.0, default 0.\n+ * @x2:\tX2 point of Config Unit, u9.0, default 0.\n+ * @reserved0:\treserved\n+ * @x3:\tX3 point of Config Unit, u9.0, default 0.\n+ * @a01:\tSlope A0 of Config Unit, s4.4, default 0.\n+ * @a12:\tSlope A1 of Config Unit, s4.4, default 0.\n+ * @reserved1:\treserved\n+ * @a23:\tSlope A2 of Config Unit, s4.4, default 0.\n+ * @b01:\tOffset B0 of Config Unit, s7.0, default 0.\n+ * @b12:\tOffset B1 of Config Unit, s7.0, default 0.\n+ * @reserved2:\treserved\n+ * @b23:\tOffset B2 of Config Unit, s7.0, default 0.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_iefd_cux4 {\n+\t__u32 x0:9;\n+\t__u32 x1:9;\n+\t__u32 x2:9;\n+\t__u32 reserved0:5;\n+\n+\t__u32 x3:9;\n+\t__u32 a01:9;\n+\t__u32 a12:9;\n+\t__u32 reserved1:5;\n+\n+\t__u32 a23:9;\n+\t__u32 b01:8;\n+\t__u32 b12:8;\n+\t__u32 reserved2:7;\n+\n+\t__u32 b23:8;\n+\t__u32 reserved3:24;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_iefd_cux6_rad - Radial Config Unit (CU)\n+ *\n+ * @x0:\tx0 points of Config Unit radial, u8.0\n+ * @x1:\tx1 points of Config Unit radial, u8.0\n+ * @x2:\tx2 points of Config Unit radial, u8.0\n+ * @x3:\tx3 points of Config Unit radial, u8.0\n+ * @x4:\tx4 points of Config Unit radial, u8.0\n+ * @x5:\tx5 points of Config Unit radial, u8.0\n+ * @reserved1: reserved\n+ * @a01:\tSlope A of Config Unit radial, s7.8\n+ * @a12:\tSlope A of Config Unit radial, s7.8\n+ * @a23:\tSlope A of Config Unit radial, s7.8\n+ * @a34:\tSlope A of Config Unit radial, s7.8\n+ * @a45:\tSlope A of Config Unit radial, s7.8\n+ * @reserved2: reserved\n+ * @b01:\tSlope B of Config Unit radial, s9.0\n+ * @b12:\tSlope B of Config Unit radial, s9.0\n+ * @b23:\tSlope B of Config Unit radial, s9.0\n+ * @reserved4: reserved\n+ * @b34:\tSlope B of Config Unit radial, s9.0\n+ * @b45:\tSlope B of Config Unit radial, s9.0\n+ * @reserved5: reserved\n+ */\n+struct ipu3_uapi_iefd_cux6_rad {\n+\t__u32 x0:8;\n+\t__u32 x1:8;\n+\t__u32 x2:8;\n+\t__u32 x3:8;\n+\n+\t__u32 x4:8;\n+\t__u32 x5:8;\n+\t__u32 reserved1:16;\n+\n+\t__u32 a01:16;\n+\t__u32 a12:16;\n+\n+\t__u32 a23:16;\n+\t__u32 a34:16;\n+\n+\t__u32 a45:16;\n+\t__u32 reserved2:16;\n+\n+\t__u32 b01:10;\n+\t__u32 b12:10;\n+\t__u32 b23:10;\n+\t__u32 reserved4:2;\n+\n+\t__u32 b34:10;\n+\t__u32 b45:10;\n+\t__u32 reserved5:12;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_cfg_units - IEFd Config Units parameters\n+ *\n+ * @cu_1: calculate weight for blending directed and\n+ *\t  non-directed denoise elements. See &ipu3_uapi_iefd_cux2\n+ * @cu_ed: calculate power of non-directed sharpening element, see\n+ *\t   &ipu3_uapi_iefd_cux6_ed\n+ * @cu_3: calculate weight for blending directed and\n+ *\t  non-directed denoise elements. A &ipu3_uapi_iefd_cux2\n+ * @cu_5: calculate power of non-directed denoise element apply, use\n+ *\t  &ipu3_uapi_iefd_cux2_1\n+ * @cu_6: calculate power of non-directed sharpening element. See\n+ *\t  &ipu3_uapi_iefd_cux4\n+ * @cu_7: calculate weight for blending directed and\n+ *\t  non-directed denoise elements. Use &ipu3_uapi_iefd_cux2\n+ * @cu_unsharp: Config Unit of unsharp &ipu3_uapi_iefd_cux4\n+ * @cu_radial: Config Unit of radial &ipu3_uapi_iefd_cux6_rad\n+ * @cu_vssnlm: Config Unit of vssnlm &ipu3_uapi_iefd_cux2\n+ */\n+struct ipu3_uapi_yuvp1_iefd_cfg_units {\n+\tstruct ipu3_uapi_iefd_cux2 cu_1;\n+\tstruct ipu3_uapi_iefd_cux6_ed cu_ed;\n+\tstruct ipu3_uapi_iefd_cux2 cu_3;\n+\tstruct ipu3_uapi_iefd_cux2_1 cu_5;\n+\tstruct ipu3_uapi_iefd_cux4 cu_6;\n+\tstruct ipu3_uapi_iefd_cux2 cu_7;\n+\tstruct ipu3_uapi_iefd_cux4 cu_unsharp;\n+\tstruct ipu3_uapi_iefd_cux6_rad cu_radial;\n+\tstruct ipu3_uapi_iefd_cux2 cu_vssnlm;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_config_s - IEFd config\n+ *\n+ * @horver_diag_coeff: Gradient compensation. Compared with vertical /\n+ *\t\t       horizontal (0 / 90 degree), coefficient of diagonal (45 /\n+ *\t\t       135 degree) direction should be corrected by approx.\n+ *\t\t       1/sqrt(2).\n+ * @reserved0: reserved\n+ * @clamp_stitch: Slope to stitch between clamped and unclamped edge values\n+ * @reserved1: reserved\n+ * @direct_metric_update: Update coeff for direction metric\n+ * @reserved2: reserved\n+ * @ed_horver_diag_coeff: Radial Coefficient that compensates for\n+ *\t\t\t  different distance for vertical/horizontal and\n+ *\t\t\t  diagonal gradient calculation (approx. 1/sqrt(2))\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_yuvp1_iefd_config_s {\n+\t__u32 horver_diag_coeff:7;\n+\t__u32 reserved0:1;\n+\t__u32 clamp_stitch:6;\n+\t__u32 reserved1:2;\n+\t__u32 direct_metric_update:5;\n+\t__u32 reserved2:3;\n+\t__u32 ed_horver_diag_coeff:7;\n+\t__u32 reserved3:1;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_control - IEFd control\n+ *\n+ * @iefd_en:\tEnable IEFd\n+ * @denoise_en:\tEnable denoise\n+ * @direct_smooth_en:\tEnable directional smooth\n+ * @rad_en:\tEnable radial update\n+ * @vssnlm_en:\tEnable VSSNLM output filter\n+ * @reserved:\treserved\n+ */\n+struct ipu3_uapi_yuvp1_iefd_control {\n+\t__u32 iefd_en:1;\n+\t__u32 denoise_en:1;\n+\t__u32 direct_smooth_en:1;\n+\t__u32 rad_en:1;\n+\t__u32 vssnlm_en:1;\n+\t__u32 reserved:27;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_sharp_cfg - Sharpening config\n+ *\n+ * @nega_lmt_txt: Sharpening limit for negative overshoots for texture.\n+ * @reserved0: reserved\n+ * @posi_lmt_txt: Sharpening limit for positive overshoots for texture.\n+ * @reserved1: reserved\n+ * @nega_lmt_dir: Sharpening limit for negative overshoots for direction (edge).\n+ * @reserved2: reserved\n+ * @posi_lmt_dir: Sharpening limit for positive overshoots for direction (edge).\n+ * @reserved3: reserved\n+ *\n+ * Fixed point type u13.0, range [0, 8191].\n+ */\n+struct ipu3_uapi_sharp_cfg {\n+\t__u32 nega_lmt_txt:13;\n+\t__u32 reserved0:19;\n+\t__u32 posi_lmt_txt:13;\n+\t__u32 reserved1:19;\n+\t__u32 nega_lmt_dir:13;\n+\t__u32 reserved2:19;\n+\t__u32 posi_lmt_dir:13;\n+\t__u32 reserved3:19;\n+} __attribute__((packed));\n+\n+/**\n+ * struct struct ipu3_uapi_far_w - Sharpening config for far sub-group\n+ *\n+ * @dir_shrp:\tWeight of wide direct sharpening, u1.6, range [0, 64], default 64.\n+ * @reserved0:\treserved\n+ * @dir_dns:\tWeight of wide direct denoising, u1.6, range [0, 64], default 0.\n+ * @reserved1:\treserved\n+ * @ndir_dns_powr:\tPower of non-direct denoising,\n+ *\t\t\tPrecision u1.6, range [0, 64], default 64.\n+ * @reserved2:\treserved\n+ */\n+struct ipu3_uapi_far_w {\n+\t__u32 dir_shrp:7;\n+\t__u32 reserved0:1;\n+\t__u32 dir_dns:7;\n+\t__u32 reserved1:1;\n+\t__u32 ndir_dns_powr:7;\n+\t__u32 reserved2:9;\n+} __attribute__((packed));\n+\n+/**\n+ * struct struct ipu3_uapi_unsharp_cfg - Unsharp config\n+ *\n+ * @unsharp_weight: Unsharp mask blending weight.\n+ *\t\t    u1.6, range [0, 64], default 16.\n+ *\t\t    0 - disabled, 64 - use only unsharp.\n+ * @reserved0: reserved\n+ * @unsharp_amount: Unsharp mask amount, u4.5, range [0, 511], default 0.\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_unsharp_cfg {\n+\t__u32 unsharp_weight:7;\n+\t__u32 reserved0:1;\n+\t__u32 unsharp_amount:9;\n+\t__u32 reserved1:15;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_shrp_cfg - IEFd sharpness config\n+ *\n+ * @cfg: sharpness config &ipu3_uapi_sharp_cfg\n+ * @far_w: wide range config, value as specified by &ipu3_uapi_far_w:\n+ *\tThe 5x5 environment is separated into 2 sub-groups, the 3x3 nearest\n+ *\tneighbors (8 pixels called Near), and the second order neighborhood\n+ *\taround them (16 pixels called Far).\n+ * @unshrp_cfg: unsharpness config. &ipu3_uapi_unsharp_cfg\n+ */\n+struct ipu3_uapi_yuvp1_iefd_shrp_cfg {\n+\tstruct ipu3_uapi_sharp_cfg cfg;\n+\tstruct ipu3_uapi_far_w far_w;\n+\tstruct ipu3_uapi_unsharp_cfg unshrp_cfg;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_unsharp_coef0 - Unsharp mask coefficients\n+ *\n+ * @c00: Coeff11, s0.8, range [-255, 255], default 1.\n+ * @c01: Coeff12, s0.8, range [-255, 255], default 5.\n+ * @c02: Coeff13, s0.8, range [-255, 255], default 9.\n+ * @reserved: reserved\n+ *\n+ * Configurable registers for common sharpening support.\n+ */\n+struct ipu3_uapi_unsharp_coef0 {\n+\t__u32 c00:9;\n+\t__u32 c01:9;\n+\t__u32 c02:9;\n+\t__u32 reserved:5;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_unsharp_coef1 - Unsharp mask coefficients\n+ *\n+ * @c11: Coeff22, s0.8, range [-255, 255], default 29.\n+ * @c12: Coeff23, s0.8, range [-255, 255], default 55.\n+ * @c22: Coeff33, s0.8, range [-255, 255], default 96.\n+ * @reserved: reserved\n+ */\n+struct ipu3_uapi_unsharp_coef1 {\n+\t__u32 c11:9;\n+\t__u32 c12:9;\n+\t__u32 c22:9;\n+\t__u32 reserved:5;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_unshrp_cfg - Unsharp mask config\n+ *\n+ * @unsharp_coef0: unsharp coefficient 0 config. See &ipu3_uapi_unsharp_coef0\n+ * @unsharp_coef1: unsharp coefficient 1 config. See &ipu3_uapi_unsharp_coef1\n+ */\n+struct ipu3_uapi_yuvp1_iefd_unshrp_cfg {\n+\tstruct ipu3_uapi_unsharp_coef0 unsharp_coef0;\n+\tstruct ipu3_uapi_unsharp_coef1 unsharp_coef1;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_radial_reset_xy - Radial coordinate reset\n+ *\n+ * @x:\tRadial reset of x coordinate. Precision s12, [-4095, 4095], default 0.\n+ * @reserved0:\treserved\n+ * @y:\tRadial center y coordinate. Precision s12, [-4095, 4095], default 0.\n+ * @reserved1:\treserved\n+ */\n+struct ipu3_uapi_radial_reset_xy {\n+\t__s32 x:13;\n+\t__u32 reserved0:3;\n+\t__s32 y:13;\n+\t__u32 reserved1:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_radial_reset_x2 - Radial X^2 reset\n+ *\n+ * @x2:\tRadial reset of x^2 coordinate. Precision u24, default 0.\n+ * @reserved:\treserved\n+ */\n+struct ipu3_uapi_radial_reset_x2 {\n+\t__u32 x2:24;\n+\t__u32 reserved:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_radial_reset_y2 - Radial Y^2 reset\n+ *\n+ * @y2:\tRadial reset of y^2 coordinate. Precision u24, default 0.\n+ * @reserved:\treserved\n+ */\n+struct ipu3_uapi_radial_reset_y2 {\n+\t__u32 y2:24;\n+\t__u32 reserved:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_radial_cfg - Radial config\n+ *\n+ * @rad_nf: Radial. R^2 normalization factor is scale down by 2^ - (15 + scale)\n+ * @reserved0: reserved\n+ * @rad_inv_r2: Radial R^-2 normelized to (0.5..1).\n+ *\t\tPrecision u7, range [0, 127].\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_radial_cfg {\n+\t__u32 rad_nf:4;\n+\t__u32 reserved0:4;\n+\t__u32 rad_inv_r2:7;\n+\t__u32 reserved1:17;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_rad_far_w - Radial FAR sub-group\n+ *\n+ * @rad_dir_far_sharp_w: Weight of wide direct sharpening, u1.6, range [0, 64],\n+ *\t\t\t default 64.\n+ * @rad_dir_far_dns_w: Weight of wide direct denoising, u1.6, range [0, 64],\n+ *\t\t\t default 0.\n+ * @rad_ndir_far_dns_power: power of non-direct sharpening, u1.6, range [0, 64],\n+ *\t\t\t default 0.\n+ * @reserved: reserved\n+ */\n+struct ipu3_uapi_rad_far_w {\n+\t__u32 rad_dir_far_sharp_w:8;\n+\t__u32 rad_dir_far_dns_w:8;\n+\t__u32 rad_ndir_far_dns_power:8;\n+\t__u32 reserved:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_cu_cfg0 - Radius Config Unit cfg0 register\n+ *\n+ * @cu6_pow: Power of CU6. Power of non-direct sharpening, u3.4.\n+ * @reserved0: reserved\n+ * @cu_unsharp_pow: Power of unsharp mask, u2.4.\n+ * @reserved1: reserved\n+ * @rad_cu6_pow: Radial/corner CU6. Directed sharpening power, u3.4.\n+ * @reserved2: reserved\n+ * @rad_cu_unsharp_pow: Radial power of unsharp mask, u2.4.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_cu_cfg0 {\n+\t__u32 cu6_pow:7;\n+\t__u32 reserved0:1;\n+\t__u32 cu_unsharp_pow:7;\n+\t__u32 reserved1:1;\n+\t__u32 rad_cu6_pow:7;\n+\t__u32 reserved2:1;\n+\t__u32 rad_cu_unsharp_pow:6;\n+\t__u32 reserved3:2;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_cu_cfg1 - Radius Config Unit cfg1 register\n+ *\n+ * @rad_cu6_x1: X1 point of Config Unit 6, precision u9.0.\n+ * @reserved0: reserved\n+ * @rad_cu_unsharp_x1: X1 point for Config Unit unsharp for radial/corner point\n+ *\t\t\tprecision u9.0.\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_cu_cfg1 {\n+\t__u32 rad_cu6_x1:9;\n+\t__u32 reserved0:1;\n+\t__u32 rad_cu_unsharp_x1:9;\n+\t__u32 reserved1:13;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_rad_cfg - IEFd parameters changed radially over\n+ *\t\t\t\t\t the picture plane.\n+ *\n+ * @reset_xy: reset xy value in radial calculation. &ipu3_uapi_radial_reset_xy\n+ * @reset_x2: reset x square value in radial calculation. See struct\n+ *\t      &ipu3_uapi_radial_reset_x2\n+ * @reset_y2: reset y square value in radial calculation. See struct\n+ *\t      &ipu3_uapi_radial_reset_y2\n+ * @cfg: radial config defined in &ipu3_uapi_radial_cfg\n+ * @rad_far_w: weight for wide range radial. &ipu3_uapi_rad_far_w\n+ * @cu_cfg0: configuration unit 0. See &ipu3_uapi_cu_cfg0\n+ * @cu_cfg1: configuration unit 1. See &ipu3_uapi_cu_cfg1\n+ */\n+struct ipu3_uapi_yuvp1_iefd_rad_cfg {\n+\tstruct ipu3_uapi_radial_reset_xy reset_xy;\n+\tstruct ipu3_uapi_radial_reset_x2 reset_x2;\n+\tstruct ipu3_uapi_radial_reset_y2 reset_y2;\n+\tstruct ipu3_uapi_radial_cfg cfg;\n+\tstruct ipu3_uapi_rad_far_w rad_far_w;\n+\tstruct ipu3_uapi_cu_cfg0 cu_cfg0;\n+\tstruct ipu3_uapi_cu_cfg1 cu_cfg1;\n+} __attribute__((packed));\n+\n+/* Vssnlm - Very small scale non-local mean algorithm */\n+\n+/**\n+ * struct ipu3_uapi_vss_lut_x - Vssnlm LUT x0/x1/x2\n+ *\n+ * @vs_x0: Vssnlm LUT x0, precision u8, range [0, 255], default 16.\n+ * @vs_x1: Vssnlm LUT x1, precision u8, range [0, 255], default 32.\n+ * @vs_x2: Vssnlm LUT x2, precision u8, range [0, 255], default 64.\n+ * @reserved2: reserved\n+ */\n+struct ipu3_uapi_vss_lut_x {\n+\t__u32 vs_x0:8;\n+\t__u32 vs_x1:8;\n+\t__u32 vs_x2:8;\n+\t__u32 reserved2:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_vss_lut_y - Vssnlm LUT y0/y1/y2\n+ *\n+ * @vs_y1: Vssnlm LUT y1, precision u4, range [0, 8], default 1.\n+ * @reserved0: reserved\n+ * @vs_y2: Vssnlm LUT y2, precision u4, range [0, 8], default 3.\n+ * @reserved1: reserved\n+ * @vs_y3: Vssnlm LUT y3, precision u4, range [0, 8], default 8.\n+ * @reserved2: reserved\n+ */\n+struct ipu3_uapi_vss_lut_y {\n+\t__u32 vs_y1:4;\n+\t__u32 reserved0:4;\n+\t__u32 vs_y2:4;\n+\t__u32 reserved1:4;\n+\t__u32 vs_y3:4;\n+\t__u32 reserved2:12;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_vssnlm_cf - IEFd Vssnlm Lookup table\n+ *\n+ * @vss_lut_x: vss lookup table. See &ipu3_uapi_vss_lut_x description\n+ * @vss_lut_y: vss lookup table. See &ipu3_uapi_vss_lut_y description\n+ */\n+struct ipu3_uapi_yuvp1_iefd_vssnlm_cfg {\n+\tstruct ipu3_uapi_vss_lut_x vss_lut_x;\n+\tstruct ipu3_uapi_vss_lut_y vss_lut_y;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_iefd_config - IEFd config\n+ *\n+ * @units: configuration unit setting, &ipu3_uapi_yuvp1_iefd_cfg_units\n+ * @config: configuration, as defined by &ipu3_uapi_yuvp1_iefd_config_s\n+ * @control: control setting, as defined by &ipu3_uapi_yuvp1_iefd_control\n+ * @sharp: sharpness setting, as defined by &ipu3_uapi_yuvp1_iefd_shrp_cfg\n+ * @unsharp: unsharpness setting, as defined by &ipu3_uapi_yuvp1_iefd_unshrp_cfg\n+ * @rad: radial setting, as defined by &ipu3_uapi_yuvp1_iefd_rad_cfg\n+ * @vsslnm: vsslnm setting, as defined by &ipu3_uapi_yuvp1_iefd_vssnlm_cfg\n+ */\n+struct ipu3_uapi_yuvp1_iefd_config {\n+\tstruct ipu3_uapi_yuvp1_iefd_cfg_units units;\n+\tstruct ipu3_uapi_yuvp1_iefd_config_s config;\n+\tstruct ipu3_uapi_yuvp1_iefd_control control;\n+\tstruct ipu3_uapi_yuvp1_iefd_shrp_cfg sharp;\n+\tstruct ipu3_uapi_yuvp1_iefd_unshrp_cfg unsharp;\n+\tstruct ipu3_uapi_yuvp1_iefd_rad_cfg rad;\n+\tstruct ipu3_uapi_yuvp1_iefd_vssnlm_cfg vsslnm;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_yds_config - Y Down-Sampling config\n+ *\n+ * @c00: range [0, 3], default 0x0\n+ * @c01: range [0, 3], default 0x1\n+ * @c02: range [0, 3], default 0x1\n+ * @c03: range [0, 3], default 0x0\n+ * @c10: range [0, 3], default 0x0\n+ * @c11: range [0, 3], default 0x1\n+ * @c12: range [0, 3], default 0x1\n+ * @c13: range [0, 3], default 0x0\n+ *\n+ * Above are 4x2 filter coefficients for chroma output downscaling.\n+ *\n+ * @norm_factor: Normalization factor, range [0, 4], default 2\n+ *\t\t0 - divide by 1\n+ *\t\t1 - divide by 2\n+ *\t\t2 - divide by 4\n+ *\t\t3 - divide by 8\n+ *\t\t4 - divide by 16\n+ * @reserved0: reserved\n+ * @bin_output: Down sampling on Luma channel in two optional modes\n+ *\t\t0 - Bin output 4.2.0 (default), 1 output 4.2.2.\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_yuvp1_yds_config {\n+\t__u32 c00:2;\n+\t__u32 c01:2;\n+\t__u32 c02:2;\n+\t__u32 c03:2;\n+\t__u32 c10:2;\n+\t__u32 c11:2;\n+\t__u32 c12:2;\n+\t__u32 c13:2;\n+\t__u32 norm_factor:5;\n+\t__u32 reserved0:4;\n+\t__u32 bin_output:1;\n+\t__u32 reserved1:6;\n+} __attribute__((packed));\n+\n+/* Chroma Noise Reduction */\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_chnr_enable_config - Chroma noise reduction enable\n+ *\n+ * @enable: enable/disable chroma noise reduction\n+ * @yuv_mode: 0 - YUV420, 1 - YUV422\n+ * @reserved0: reserved\n+ * @col_size: number of columns in the frame, max width is 2560\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_yuvp1_chnr_enable_config {\n+\t__u32 enable:1;\n+\t__u32 yuv_mode:1;\n+\t__u32 reserved0:14;\n+\t__u32 col_size:12;\n+\t__u32 reserved1:4;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_chnr_coring_config - Coring thresholds for UV\n+ *\n+ * @u: U coring level, u0.13, range [0.0, 1.0], default 0.0\n+ * @reserved0: reserved\n+ * @v: V coring level, u0.13, range [0.0, 1.0], default 0.0\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_yuvp1_chnr_coring_config {\n+\t__u32 u:13;\n+\t__u32 reserved0:3;\n+\t__u32 v:13;\n+\t__u32 reserved1:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_chnr_sense_gain_config - Chroma noise reduction gains\n+ *\n+ * All sensitivity gain parameters have precision u13.0, range [0, 8191].\n+ *\n+ * @vy: Sensitivity of horizontal edge of Y, default 100\n+ * @vu: Sensitivity of horizontal edge of U, default 100\n+ * @vv: Sensitivity of horizontal edge of V, default 100\n+ * @reserved0: reserved\n+ * @hy: Sensitivity of vertical edge of Y, default 50\n+ * @hu: Sensitivity of vertical edge of U, default 50\n+ * @hv: Sensitivity of vertical edge of V, default 50\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_yuvp1_chnr_sense_gain_config {\n+\t__u32 vy:8;\n+\t__u32 vu:8;\n+\t__u32 vv:8;\n+\t__u32 reserved0:8;\n+\n+\t__u32 hy:8;\n+\t__u32 hu:8;\n+\t__u32 hv:8;\n+\t__u32 reserved1:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_chnr_iir_fir_config - Chroma IIR/FIR filter config\n+ *\n+ * @fir_0h: Value of center tap in horizontal FIR, range [0, 32], default 8.\n+ * @reserved0: reserved\n+ * @fir_1h: Value of distance 1 in horizontal FIR, range [0, 32], default 12.\n+ * @reserved1: reserved\n+ * @fir_2h: Value of distance 2 tap in horizontal FIR, range [0, 32], default 0.\n+ * @dalpha_clip_val: weight for previous row in IIR, range [1, 256], default 0.\n+ * @reserved2: reserved\n+ */\n+struct ipu3_uapi_yuvp1_chnr_iir_fir_config {\n+\t__u32 fir_0h:6;\n+\t__u32 reserved0:2;\n+\t__u32 fir_1h:6;\n+\t__u32 reserved1:2;\n+\t__u32 fir_2h:6;\n+\t__u32 dalpha_clip_val:9;\n+\t__u32 reserved2:1;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_chnr_config - Chroma noise reduction config\n+ *\n+ * @enable: chroma noise reduction enable, see\n+ *\t    &ipu3_uapi_yuvp1_chnr_enable_config\n+ * @coring: coring config for chroma noise reduction, see\n+ *\t    &ipu3_uapi_yuvp1_chnr_coring_config\n+ * @sense_gain: sensitivity config for chroma noise reduction, see\n+ *\t\tipu3_uapi_yuvp1_chnr_sense_gain_config\n+ * @iir_fir: iir and fir config for chroma noise reduction, see\n+ *\t     ipu3_uapi_yuvp1_chnr_iir_fir_config\n+ */\n+struct ipu3_uapi_yuvp1_chnr_config {\n+\tstruct ipu3_uapi_yuvp1_chnr_enable_config enable;\n+\tstruct ipu3_uapi_yuvp1_chnr_coring_config coring;\n+\tstruct ipu3_uapi_yuvp1_chnr_sense_gain_config sense_gain;\n+\tstruct ipu3_uapi_yuvp1_chnr_iir_fir_config iir_fir;\n+} __attribute__((packed));\n+\n+/* Edge Enhancement and Noise Reduction */\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_lpf_config - Luma(Y) edge enhancement low-pass\n+ *\t\t\t\t\t       filter coefficients\n+ *\n+ * @a_diag: Smoothing diagonal coefficient, u5.0.\n+ * @reserved0: reserved\n+ * @a_periph: Image smoothing perpherial, u5.0.\n+ * @reserved1: reserved\n+ * @a_cent: Image Smoothing center coefficient, u5.0.\n+ * @reserved2: reserved\n+ * @enable: 0: Y_EE_NR disabled, output = input; 1: Y_EE_NR enabled.\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_lpf_config {\n+\t__u32 a_diag:5;\n+\t__u32 reserved0:3;\n+\t__u32 a_periph:5;\n+\t__u32 reserved1:3;\n+\t__u32 a_cent:5;\n+\t__u32 reserved2:9;\n+\t__u32 enable:1;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_sense_config - Luma(Y) edge enhancement\n+ *\t\t\t\t\tnoise reduction sensitivity gains\n+ *\n+ * @edge_sense_0: Sensitivity of edge in dark area. u13.0, default 8191.\n+ * @reserved0: reserved\n+ * @delta_edge_sense: Difference in the sensitivity of edges between\n+ *\t\t      the bright and dark areas. u13.0, default 0.\n+ * @reserved1: reserved\n+ * @corner_sense_0: Sensitivity of corner in dark area. u13.0, default 0.\n+ * @reserved2: reserved\n+ * @delta_corner_sense: Difference in the sensitivity of corners between\n+ *\t\t\tthe bright and dark areas. u13.0, default 8191.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_sense_config {\n+\t__u32 edge_sense_0:13;\n+\t__u32 reserved0:3;\n+\t__u32 delta_edge_sense:13;\n+\t__u32 reserved1:3;\n+\t__u32 corner_sense_0:13;\n+\t__u32 reserved2:3;\n+\t__u32 delta_corner_sense:13;\n+\t__u32 reserved3:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_gain_config - Luma(Y) edge enhancement\n+ *\t\t\t\t\t\tnoise reduction gain config\n+ *\n+ * @gain_pos_0: Gain for positive edge in dark area. u5.0, [0, 16], default 2.\n+ * @reserved0: reserved\n+ * @delta_gain_posi: Difference in the gain of edges between the bright and\n+ *\t\t     dark areas for positive edges. u5.0, [0, 16], default 0.\n+ * @reserved1: reserved\n+ * @gain_neg_0: Gain for negative edge in dark area. u5.0, [0, 16], default 8.\n+ * @reserved2: reserved\n+ * @delta_gain_neg: Difference in the gain of edges between the bright and\n+ *\t\t    dark areas for negative edges. u5.0, [0, 16], default 0.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_gain_config {\n+\t__u32 gain_pos_0:5;\n+\t__u32 reserved0:3;\n+\t__u32 delta_gain_posi:5;\n+\t__u32 reserved1:3;\n+\t__u32 gain_neg_0:5;\n+\t__u32 reserved2:3;\n+\t__u32 delta_gain_neg:5;\n+\t__u32 reserved3:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_clip_config - Luma(Y) edge enhancement\n+ *\t\t\t\t\tnoise reduction clipping config\n+ *\n+ * @clip_pos_0: Limit of positive edge in dark area\n+ *\t\tu5, value [0, 16], default 8.\n+ * @reserved0: reserved\n+ * @delta_clip_posi: Difference in the limit of edges between the bright\n+ *\t\t     and dark areas for positive edges.\n+ *\t\t     u5, value [0, 16], default 8.\n+ * @reserved1: reserved\n+ * @clip_neg_0: Limit of negative edge in dark area\n+ *\t\tu5, value [0, 16], default 8.\n+ * @reserved2: reserved\n+ * @delta_clip_neg: Difference in the limit of edges between the bright\n+ *\t\t    and dark areas for negative edges.\n+ *\t\t    u5, value [0, 16], default 8.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_clip_config {\n+\t__u32 clip_pos_0:5;\n+\t__u32 reserved0:3;\n+\t__u32 delta_clip_posi:5;\n+\t__u32 reserved1:3;\n+\t__u32 clip_neg_0:5;\n+\t__u32 reserved2:3;\n+\t__u32 delta_clip_neg:5;\n+\t__u32 reserved3:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_frng_config - Luma(Y) edge enhancement\n+ *\t\t\t\t\t\tnoise reduction fringe config\n+ *\n+ * @gain_exp: Common exponent of gains, u4, [0, 8], default 2.\n+ * @reserved0: reserved\n+ * @min_edge: Threshold for edge and smooth stitching, u13.\n+ * @reserved1: reserved\n+ * @lin_seg_param: Power of LinSeg, u4.\n+ * @reserved2: reserved\n+ * @t1: Parameter for enabling/disabling the edge enhancement, u1.0, [0, 1],\n+ *\tdefault 1.\n+ * @t2: Parameter for enabling/disabling the smoothing, u1.0, [0, 1],\n+ *\tdefault 1.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_frng_config {\n+\t__u32 gain_exp:4;\n+\t__u32 reserved0:28;\n+\t__u32 min_edge:13;\n+\t__u32 reserved1:3;\n+\t__u32 lin_seg_param:4;\n+\t__u32 reserved2:4;\n+\t__u32 t1:1;\n+\t__u32 t2:1;\n+\t__u32 reserved3:6;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_diag_config - Luma(Y) edge enhancement\n+ *\t\t\t\t\tnoise reduction diagonal config\n+ *\n+ * @diag_disc_g: Coefficient that prioritize diagonal edge direction on\n+ *\t\t horizontal or vertical for final enhancement.\n+ *\t\t u4.0, [1, 15], default 1.\n+ * @reserved0: reserved\n+ * @hvw_hor: Weight of horizontal/vertical edge enhancement for hv edge.\n+ *\t\tu2.2, [1, 15], default 4.\n+ * @dw_hor: Weight of diagonal edge enhancement for hv edge.\n+ *\t\tu2.2, [1, 15], default 1.\n+ * @hvw_diag: Weight of horizontal/vertical edge enhancement for diagonal edge.\n+ *\t\tu2.2, [1, 15], default 1.\n+ * @dw_diag: Weight of diagonal edge enhancement for diagonal edge.\n+ *\t\tu2.2, [1, 15], default 4.\n+ * @reserved1: reserved\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_diag_config {\n+\t__u32 diag_disc_g:4;\n+\t__u32 reserved0:4;\n+\t__u32 hvw_hor:4;\n+\t__u32 dw_hor:4;\n+\t__u32 hvw_diag:4;\n+\t__u32 dw_diag:4;\n+\t__u32 reserved1:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config - Luma(Y) edge enhancement\n+ *\t\tnoise reduction false color correction (FCC) coring config\n+ *\n+ * @pos_0: Gain for positive edge in dark, u13.0, [0, 16], default 0.\n+ * @reserved0: reserved\n+ * @pos_delta: Gain for positive edge in bright, value: pos_0 + pos_delta <=16\n+ *\t\tu13.0, default 0.\n+ * @reserved1: reserved\n+ * @neg_0: Gain for negative edge in dark area, u13.0, range [0, 16], default 0.\n+ * @reserved2: reserved\n+ * @neg_delta: Gain for negative edge in bright area. neg_0 + neg_delta <=16\n+ *\t\tu13.0, default 0.\n+ * @reserved3: reserved\n+ *\n+ * Coring is a simple soft thresholding technique.\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config {\n+\t__u32 pos_0:13;\n+\t__u32 reserved0:3;\n+\t__u32 pos_delta:13;\n+\t__u32 reserved1:3;\n+\t__u32 neg_0:13;\n+\t__u32 reserved2:3;\n+\t__u32 neg_delta:13;\n+\t__u32 reserved3:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp1_y_ee_nr_config - Edge enhancement and noise reduction\n+ *\n+ * @lpf: low-pass filter config. See &ipu3_uapi_yuvp1_y_ee_nr_lpf_config\n+ * @sense: sensitivity config. See &ipu3_uapi_yuvp1_y_ee_nr_sense_config\n+ * @gain: gain config as defined in &ipu3_uapi_yuvp1_y_ee_nr_gain_config\n+ * @clip: clip config as defined in &ipu3_uapi_yuvp1_y_ee_nr_clip_config\n+ * @frng: fringe config as defined in &ipu3_uapi_yuvp1_y_ee_nr_frng_config\n+ * @diag: diagonal edge config. See &ipu3_uapi_yuvp1_y_ee_nr_diag_config\n+ * @fc_coring: coring config for fringe control. See\n+ *\t       &ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config\n+ */\n+struct ipu3_uapi_yuvp1_y_ee_nr_config {\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_lpf_config lpf;\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_sense_config sense;\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_gain_config gain;\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_clip_config clip;\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_frng_config frng;\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_diag_config diag;\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_fc_coring_config fc_coring;\n+} __attribute__((packed));\n+\n+/* Total Color Correction */\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_gen_control_static_config - Total color correction\n+ *\t\t\t\tgeneral control config\n+ *\n+ * @en:\t0 - TCC disabled. Output = input 1 - TCC enabled.\n+ * @blend_shift:\tblend shift, Range[3, 4], default NA.\n+ * @gain_according_to_y_only:\t0: Gain is calculated according to YUV,\n+ *\t\t\t\t1: Gain is calculated according to Y only\n+ * @reserved0: reserved\n+ * @gamma:\tFinal blending coefficients. Values[-16, 16], default NA.\n+ * @reserved1: reserved\n+ * @delta:\tFinal blending coefficients. Values[-16, 16], default NA.\n+ * @reserved2: reserved\n+ */\n+struct ipu3_uapi_yuvp2_tcc_gen_control_static_config {\n+\t__u32 en:1;\n+\t__u32 blend_shift:3;\n+\t__u32 gain_according_to_y_only:1;\n+\t__u32 reserved0:11;\n+\t__s32 gamma:5;\n+\t__u32 reserved1:3;\n+\t__s32 delta:5;\n+\t__u32 reserved2:3;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_macc_elem_static_config - Total color correction\n+ *\t\t\t\tmulti-axis color control (MACC) config\n+ *\n+ * @a: a coefficient for 2x2 MACC conversion matrix.\n+ * @reserved0: reserved\n+ * @b: b coefficient  2x2 MACC conversion matrix.\n+ * @reserved1: reserved\n+ * @c: c coefficient for 2x2 MACC conversion matrix.\n+ * @reserved2: reserved\n+ * @d: d coefficient for 2x2 MACC conversion matrix.\n+ * @reserved3: reserved\n+ */\n+struct ipu3_uapi_yuvp2_tcc_macc_elem_static_config {\n+\t__s32 a:12;\n+\t__u32 reserved0:4;\n+\t__s32 b:12;\n+\t__u32 reserved1:4;\n+\t__s32 c:12;\n+\t__u32 reserved2:4;\n+\t__s32 d:12;\n+\t__u32 reserved3:4;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_macc_table_static_config - Total color correction\n+ *\t\t\t\tmulti-axis color control (MACC) table array\n+ *\n+ * @entries: config for multi axis color correction, as specified by\n+ *\t     &ipu3_uapi_yuvp2_tcc_macc_elem_static_config\n+ */\n+struct ipu3_uapi_yuvp2_tcc_macc_table_static_config {\n+\tstruct ipu3_uapi_yuvp2_tcc_macc_elem_static_config\n+\t\tentries[IPU3_UAPI_YUVP2_TCC_MACC_TABLE_ELEMENTS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_inv_y_lut_static_config - Total color correction\n+ *\t\t\t\tinverse y lookup table\n+ *\n+ * @entries: lookup table for inverse y estimation, and use it to estimate the\n+ *\t     ratio between luma and chroma. Chroma by approximate the absolute\n+ *\t     value of the radius on the chroma plane (R = sqrt(u^2+v^2) ) and\n+ *\t     luma by approximate by 1/Y.\n+ */\n+struct ipu3_uapi_yuvp2_tcc_inv_y_lut_static_config {\n+\t__u16 entries[IPU3_UAPI_YUVP2_TCC_INV_Y_LUT_ELEMENTS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config - Total color\n+ *\t\t\t\t\tcorrection lookup table for PCWL\n+ *\n+ * @entries: lookup table for gain piece wise linear transformation (PCWL)\n+ */\n+struct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config {\n+\t__u16 entries[IPU3_UAPI_YUVP2_TCC_GAIN_PCWL_LUT_ELEMENTS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config - Total color correction\n+ *\t\t\t\tlookup table for r square root\n+ *\n+ * @entries: lookup table for r square root estimation\n+ */\n+struct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config {\n+\t__s16 entries[IPU3_UAPI_YUVP2_TCC_R_SQR_LUT_ELEMENTS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_yuvp2_tcc_static_config- Total color correction static\n+ *\n+ * @gen_control: general config for Total Color Correction\n+ * @macc_table: config for multi axis color correction\n+ * @inv_y_lut: lookup table for inverse y estimation\n+ * @gain_pcwl: lookup table for gain PCWL\n+ * @r_sqr_lut: lookup table for r square root estimation.\n+ */\n+struct ipu3_uapi_yuvp2_tcc_static_config {\n+\tstruct ipu3_uapi_yuvp2_tcc_gen_control_static_config gen_control;\n+\tstruct ipu3_uapi_yuvp2_tcc_macc_table_static_config macc_table;\n+\tstruct ipu3_uapi_yuvp2_tcc_inv_y_lut_static_config inv_y_lut;\n+\tstruct ipu3_uapi_yuvp2_tcc_gain_pcwl_lut_static_config gain_pcwl;\n+\tstruct ipu3_uapi_yuvp2_tcc_r_sqr_lut_static_config r_sqr_lut;\n+} __attribute__((packed));\n+\n+/* Advanced Noise Reduction related structs */\n+\n+/*\n+ * struct ipu3_uapi_anr_alpha - Advanced noise reduction alpha\n+ *\n+ * Tunable parameters that are subject to modification according to the\n+ * total gain used.\n+ */\n+struct ipu3_uapi_anr_alpha {\n+\t__u16 gr;\n+\t__u16 r;\n+\t__u16 b;\n+\t__u16 gb;\n+\t__u16 dc_gr;\n+\t__u16 dc_r;\n+\t__u16 dc_b;\n+\t__u16 dc_gb;\n+} __attribute__((packed));\n+\n+/*\n+ * struct ipu3_uapi_anr_beta - Advanced noise reduction beta\n+ *\n+ * Tunable parameters that are subject to modification according to the\n+ * total gain used.\n+ */\n+struct ipu3_uapi_anr_beta {\n+\t__u16 beta_gr;\n+\t__u16 beta_r;\n+\t__u16 beta_b;\n+\t__u16 beta_gb;\n+} __attribute__((packed));\n+\n+/*\n+ * struct ipu3_uapi_anr_plane_color - Advanced noise reduction per plane R, Gr,\n+ *\t\t\t\t      Gb and B register settings\n+ *\n+ * Tunable parameters that are subject to modification according to the\n+ * total gain used.\n+ */\n+struct ipu3_uapi_anr_plane_color {\n+\t__u16 reg_w_gr[16];\n+\t__u16 reg_w_r[16];\n+\t__u16 reg_w_b[16];\n+\t__u16 reg_w_gb[16];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_anr_transform_config - Advanced noise reduction transform\n+ *\n+ * @enable: advanced noise reduction enabled.\n+ * @adaptive_treshhold_en: On IPU3, adaptive threshold is always enabled.\n+ * @reserved1: reserved\n+ * @reserved2: reserved\n+ * @alpha: using following defaults:\n+ *\t\t13, 13, 13, 13, 0, 0, 0, 0\n+ *\t\t11, 11, 11, 11, 0, 0, 0, 0\n+ *\t\t14,  14, 14, 14, 0, 0, 0, 0\n+ * @beta: use following defaults:\n+ *\t\t24, 24, 24, 24\n+ *\t\t21, 20, 20, 21\n+ *\t\t25, 25, 25, 25\n+ * @color: use defaults defined in driver/media/pci/intel/ipu3-tables.c\n+ * @sqrt_lut: 11 bits per element, values =\n+ *\t\t\t\t\t[724 768 810 849 887\n+ *\t\t\t\t\t923 958 991 1024 1056\n+ *\t\t\t\t\t1116 1145 1173 1201 1086\n+ *\t\t\t\t\t1228 1254 1280 1305 1330\n+ *\t\t\t\t\t1355 1379 1402 1425 1448]\n+ * @xreset: Reset value of X for r^2 calculation Value: col_start-X_center\n+ *\tConstraint: Xreset + FrameWdith=4095 Xreset= -4095, default -1632.\n+ * @reserved3: reserved\n+ * @yreset: Reset value of Y for r^2 calculation Value: row_start-Y_center\n+ *\t Constraint: Yreset + FrameHeight=4095 Yreset= -4095, default -1224.\n+ * @reserved4: reserved\n+ * @x_sqr_reset: Reset value of X^2 for r^2 calculation Value = (Xreset)^2\n+ * @r_normfactor: Normalization factor for R. Default 14.\n+ * @reserved5: reserved\n+ * @y_sqr_reset: Reset value of Y^2 for r^2 calculation Value = (Yreset)^2\n+ * @gain_scale: Parameter describing shading gain as a function of distance\n+ *\t\tfrom the image center.\n+ *\t\tA single value per frame, loaded by the driver. Default 115.\n+ */\n+struct ipu3_uapi_anr_transform_config {\n+\t__u32 enable:1;\t\t\t/* 0 or 1, disabled or enabled */\n+\t__u32 adaptive_treshhold_en:1;\t/* On IPU3, always enabled */\n+\n+\t__u32 reserved1:30;\n+\t__u8 reserved2[44];\n+\n+\tstruct ipu3_uapi_anr_alpha alpha[3];\n+\tstruct ipu3_uapi_anr_beta beta[3];\n+\tstruct ipu3_uapi_anr_plane_color color[3];\n+\n+\t__u16 sqrt_lut[IPU3_UAPI_ANR_LUT_SIZE];\t/* 11 bits per element */\n+\n+\t__s16 xreset:13;\n+\t__u16 reserved3:3;\n+\t__s16 yreset:13;\n+\t__u16 reserved4:3;\n+\n+\t__u32 x_sqr_reset:24;\n+\t__u32 r_normfactor:5;\n+\t__u32 reserved5:3;\n+\n+\t__u32 y_sqr_reset:24;\n+\t__u32 gain_scale:8;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_anr_stitch_pyramid - ANR stitch pyramid\n+ *\n+ * @entry0: pyramid LUT entry0, range [0x0, 0x3f]\n+ * @entry1: pyramid LUT entry1, range [0x0, 0x3f]\n+ * @entry2: pyramid LUT entry2, range [0x0, 0x3f]\n+ * @reserved: reserved\n+ */\n+struct ipu3_uapi_anr_stitch_pyramid {\n+\t__u32 entry0:6;\n+\t__u32 entry1:6;\n+\t__u32 entry2:6;\n+\t__u32 reserved:14;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_anr_stitch_config - ANR stitch config\n+ *\n+ * @anr_stitch_en: enable stitch. Enabled with 1.\n+ * @reserved: reserved\n+ * @pyramid: pyramid table as defined by &ipu3_uapi_anr_stitch_pyramid\n+ *\t\tdefault values:\n+ *\t\t{ 1, 3, 5 }, { 7, 7, 5 }, { 3, 1, 3 },\n+ *\t\t{ 9, 15, 21 }, { 21, 15, 9 }, { 3, 5, 15 },\n+ *\t\t{ 25, 35, 35 }, { 25, 15, 5 }, { 7, 21, 35 },\n+ *\t\t{ 49, 49, 35 }, { 21, 7, 7 }, { 21, 35, 49 },\n+ *\t\t{ 49, 35, 21 }, { 7, 5, 15 }, { 25, 35, 35 },\n+ *\t\t{ 25, 15, 5 }, { 3, 9, 15 }, { 21, 21, 15 },\n+ *\t\t{ 9, 3, 1 }, { 3, 5, 7 }, { 7, 5, 3}, { 1 }\n+ */\n+struct ipu3_uapi_anr_stitch_config {\n+\t__u32 anr_stitch_en;\n+\t__u8 reserved[44];\n+\tstruct ipu3_uapi_anr_stitch_pyramid pyramid[IPU3_UAPI_ANR_PYRAMID_SIZE];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_anr_config - ANR config\n+ *\n+ * @transform:\tadvanced noise reduction transform config as specified by\n+ *\t\t&ipu3_uapi_anr_transform_config\n+ * @stitch: create 4x4 patch from 4 surrounding 8x8 patches.\n+ */\n+struct ipu3_uapi_anr_config {\n+\tstruct ipu3_uapi_anr_transform_config transform __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_anr_stitch_config stitch __attribute__((aligned(32)));\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_acc_param - Accelerator cluster parameters\n+ *\n+ * ACC refers to the HW cluster containing all Fixed Functions (FFs). Each FF\n+ * implements a specific algorithm.\n+ *\n+ * @bnr:\tparameters for bayer noise reduction static config. See\n+ *\t\t&ipu3_uapi_bnr_static_config\n+ * @green_disparity:\tdisparity static config between gr and gb channel.\n+ *\t\t\tSee &ipu3_uapi_bnr_static_config_green_disparity\n+ * @dm:\tde-mosaic config. See &ipu3_uapi_dm_config\n+ * @ccm:\tcolor correction matrix. See &ipu3_uapi_ccm_mat_config\n+ * @gamma:\tgamma correction config. See &ipu3_uapi_gamma_config\n+ * @csc:\tcolor space conversion matrix. See &ipu3_uapi_csc_mat_config\n+ * @cds:\tcolor down sample config. See &ipu3_uapi_cds_params\n+ * @shd:\tlens shading correction config. See &ipu3_uapi_shd_config\n+ * @iefd:\tImage enhancement filter and denoise config.\n+ *\t\t&ipu3_uapi_yuvp1_iefd_config\n+ * @yds_c0:\ty down scaler config. &ipu3_uapi_yuvp1_yds_config\n+ * @chnr_c0:\tchroma noise reduction config. &ipu3_uapi_yuvp1_chnr_config\n+ * @y_ee_nr:\ty edge enhancement and noise reduction config.\n+ *\t\t&ipu3_uapi_yuvp1_y_ee_nr_config\n+ * @yds:\ty down scaler config. See &ipu3_uapi_yuvp1_yds_config\n+ * @chnr:\tchroma noise reduction config. See &ipu3_uapi_yuvp1_chnr_config\n+ * @reserved1: reserved\n+ * @yds2:\ty channel down scaler config. See &ipu3_uapi_yuvp1_yds_config\n+ * @tcc:\ttotal color correction config as defined in struct\n+ *\t\t&ipu3_uapi_yuvp2_tcc_static_config\n+ * @reserved2: reserved\n+ * @anr:\tadvanced noise reduction config.See &ipu3_uapi_anr_config\n+ * @awb_fr:\tAWB filter response config. See ipu3_uapi_awb_fr_config\n+ * @ae:\tauto exposure config  As specified by &ipu3_uapi_ae_config\n+ * @af:\tauto focus config. As specified by &ipu3_uapi_af_config\n+ * @awb:\tauto white balance config. As specified by &ipu3_uapi_awb_config\n+ */\n+struct ipu3_uapi_acc_param {\n+\tstruct ipu3_uapi_bnr_static_config bnr;\n+\tstruct ipu3_uapi_bnr_static_config_green_disparity\n+\t\t\t\tgreen_disparity __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_dm_config dm __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_ccm_mat_config ccm __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_gamma_config gamma __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_csc_mat_config csc __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_cds_params cds __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_shd_config shd __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_iefd_config iefd __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_yds_config yds_c0 __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_chnr_config chnr_c0 __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_y_ee_nr_config y_ee_nr __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_yds_config yds __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_chnr_config chnr __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp1_yds_config yds2 __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_yuvp2_tcc_static_config tcc __attribute__((aligned(32)));\n+\tstruct ipu3_uapi_anr_config anr;\n+\tstruct ipu3_uapi_awb_fr_config_s awb_fr;\n+\tstruct ipu3_uapi_ae_config ae;\n+\tstruct ipu3_uapi_af_config_s af;\n+\tstruct ipu3_uapi_awb_config awb;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_isp_lin_vmem_params - Linearization parameters\n+ *\n+ * @lin_lutlow_gr: linearization look-up table for GR channel interpolation.\n+ * @lin_lutlow_r: linearization look-up table for R channel interpolation.\n+ * @lin_lutlow_b: linearization look-up table for B channel interpolation.\n+ * @lin_lutlow_gb: linearization look-up table for GB channel interpolation.\n+ *\t\t\tlin_lutlow_gr / lin_lutlow_r / lin_lutlow_b /\n+ *\t\t\tlin_lutlow_gb <= LIN_MAX_VALUE - 1.\n+ * @lin_lutdif_gr:\tlin_lutlow_gr[i+1] - lin_lutlow_gr[i].\n+ * @lin_lutdif_r:\tlin_lutlow_r[i+1] - lin_lutlow_r[i].\n+ * @lin_lutdif_b:\tlin_lutlow_b[i+1] - lin_lutlow_b[i].\n+ * @lin_lutdif_gb:\tlin_lutlow_gb[i+1] - lin_lutlow_gb[i].\n+ */\n+struct ipu3_uapi_isp_lin_vmem_params {\n+\t__s16 lin_lutlow_gr[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutlow_r[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutlow_b[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutlow_gb[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutdif_gr[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutdif_r[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutdif_b[IPU3_UAPI_LIN_LUT_SIZE];\n+\t__s16 lin_lutdif_gb[IPU3_UAPI_LIN_LUT_SIZE];\n+} __attribute__((packed));\n+\n+/* Temporal Noise Reduction */\n+\n+/**\n+ * struct ipu3_uapi_isp_tnr3_vmem_params - Temporal noise reduction vector\n+ *\t\t\t\t\t   memory parameters\n+ *\n+ * @slope: slope setting in interpolation curve for temporal noise reduction.\n+ * @reserved1: reserved\n+ * @sigma: knee point setting in interpolation curve for temporal\n+ *\t   noise reduction.\n+ * @reserved2: reserved\n+ */\n+struct ipu3_uapi_isp_tnr3_vmem_params {\n+\t__u16 slope[IPU3_UAPI_ISP_TNR3_VMEM_LEN];\n+\t__u16 reserved1[IPU3_UAPI_ISP_VEC_ELEMS\n+\t\t\t\t\t\t- IPU3_UAPI_ISP_TNR3_VMEM_LEN];\n+\t__u16 sigma[IPU3_UAPI_ISP_TNR3_VMEM_LEN];\n+\t__u16 reserved2[IPU3_UAPI_ISP_VEC_ELEMS\n+\t\t\t\t\t\t- IPU3_UAPI_ISP_TNR3_VMEM_LEN];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_isp_tnr3_params - Temporal noise reduction v3 parameters\n+ *\n+ * @knee_y1: Knee point TNR3 assumes standard deviation of Y,U and\n+ *\tV at Y1 are TnrY1_Sigma_Y, U and V.\n+ * @knee_y2: Knee point TNR3 assumes standard deviation of Y,U and\n+ *\t\tV at Y2 are TnrY2_Sigma_Y, U and V.\n+ * @maxfb_y: Max feedback gain for Y\n+ * @maxfb_u: Max feedback gain for U\n+ * @maxfb_v: Max feedback gain for V\n+ * @round_adj_y: rounding Adjust for Y\n+ * @round_adj_u: rounding Adjust for U\n+ * @round_adj_v: rounding Adjust for V\n+ * @ref_buf_select: selection of the reference frame buffer to be used.\n+ */\n+struct ipu3_uapi_isp_tnr3_params {\n+\t__u32 knee_y1;\n+\t__u32 knee_y2;\n+\t__u32 maxfb_y;\n+\t__u32 maxfb_u;\n+\t__u32 maxfb_v;\n+\t__u32 round_adj_y;\n+\t__u32 round_adj_u;\n+\t__u32 round_adj_v;\n+\t__u32 ref_buf_select;\n+} __attribute__((packed));\n+\n+/* Extreme Noise Reduction version 3 */\n+\n+/**\n+ * struct ipu3_uapi_isp_xnr3_vmem_params - Extreme noise reduction v3\n+ *\t\t\t\t\t   vector memory parameters\n+ *\n+ * @x: xnr3 parameters.\n+ * @a: xnr3 parameters.\n+ * @b: xnr3 parameters.\n+ * @c: xnr3 parameters.\n+ */\n+struct ipu3_uapi_isp_xnr3_vmem_params {\n+\t__u16 x[IPU3_UAPI_ISP_VEC_ELEMS];\n+\t__u16 a[IPU3_UAPI_ISP_VEC_ELEMS];\n+\t__u16 b[IPU3_UAPI_ISP_VEC_ELEMS];\n+\t__u16 c[IPU3_UAPI_ISP_VEC_ELEMS];\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_xnr3_alpha_params - Extreme noise reduction v3\n+ *\t\t\t\t\talpha tuning parameters\n+ *\n+ * @y0: Sigma for Y range similarity in dark area.\n+ * @u0: Sigma for U range similarity in dark area.\n+ * @v0: Sigma for V range similarity in dark area.\n+ * @ydiff: Sigma difference for Y between bright area and dark area.\n+ * @udiff: Sigma difference for U between bright area and dark area.\n+ * @vdiff: Sigma difference for V between bright area and dark area.\n+ */\n+struct ipu3_uapi_xnr3_alpha_params {\n+\t__u32 y0;\n+\t__u32 u0;\n+\t__u32 v0;\n+\t__u32 ydiff;\n+\t__u32 udiff;\n+\t__u32 vdiff;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_xnr3_coring_params - Extreme noise reduction v3\n+ *\t\t\t\t\t coring parameters\n+ *\n+ * @u0: Coring Threshold of U channel in dark area.\n+ * @v0: Coring Threshold of V channel in dark area.\n+ * @udiff: Threshold difference of U channel between bright and dark area.\n+ * @vdiff: Threshold difference of V channel between bright and dark area.\n+ */\n+struct ipu3_uapi_xnr3_coring_params {\n+\t__u32 u0;\n+\t__u32 v0;\n+\t__u32 udiff;\n+\t__u32 vdiff;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_xnr3_blending_params - Blending factor\n+ *\n+ * @strength: The factor for blending output with input. This is tuning\n+ *\t      parameterHigher values lead to more aggressive XNR operation.\n+ */\n+struct ipu3_uapi_xnr3_blending_params {\n+\t__u32 strength;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_isp_xnr3_params - Extreme noise reduction v3 parameters\n+ *\n+ * @alpha: parameters for xnr3 alpha. See &ipu3_uapi_xnr3_alpha_params\n+ * @coring: parameters for xnr3 coring. See &ipu3_uapi_xnr3_coring_params\n+ * @blending: parameters for xnr3 blending. See &ipu3_uapi_xnr3_blending_params\n+ */\n+struct ipu3_uapi_isp_xnr3_params {\n+\tstruct ipu3_uapi_xnr3_alpha_params alpha;\n+\tstruct ipu3_uapi_xnr3_coring_params coring;\n+\tstruct ipu3_uapi_xnr3_blending_params blending;\n+} __attribute__((packed));\n+\n+/***** Obgrid (optical black level compensation) table entry *****/\n+\n+/**\n+ * struct ipu3_uapi_obgrid_param - Optical black level compensation parameters\n+ *\n+ * @gr: Grid table values for color GR\n+ * @r: Grid table values for color R\n+ * @b: Grid table values for color B\n+ * @gb: Grid table values for color GB\n+ *\n+ * Black level is different for red, green, and blue channels. So black level\n+ * compensation is different per channel.\n+ */\n+struct ipu3_uapi_obgrid_param {\n+\t__u16 gr;\n+\t__u16 r;\n+\t__u16 b;\n+\t__u16 gb;\n+} __attribute__((packed));\n+\n+/******************* V4L2_META_FMT_IPU3_PARAMS *******************/\n+\n+/**\n+ * struct ipu3_uapi_flags - bits to indicate which pipeline needs update\n+ *\n+ * @gdc: 0 = no update, 1 = update.\n+ * @obgrid: 0 = no update, 1 = update.\n+ * @reserved1: Not used.\n+ * @acc_bnr: 0 = no update, 1 = update.\n+ * @acc_green_disparity: 0 = no update, 1 = update.\n+ * @acc_dm: 0 = no update, 1 = update.\n+ * @acc_ccm: 0 = no update, 1 = update.\n+ * @acc_gamma: 0 = no update, 1 = update.\n+ * @acc_csc: 0 = no update, 1 = update.\n+ * @acc_cds: 0 = no update, 1 = update.\n+ * @acc_shd: 0 = no update, 1 = update.\n+ * @reserved2: Not used.\n+ * @acc_iefd: 0 = no update, 1 = update.\n+ * @acc_yds_c0: 0 = no update, 1 = update.\n+ * @acc_chnr_c0: 0 = no update, 1 = update.\n+ * @acc_y_ee_nr: 0 = no update, 1 = update.\n+ * @acc_yds: 0 = no update, 1 = update.\n+ * @acc_chnr: 0 = no update, 1 = update.\n+ * @acc_ytm: 0 = no update, 1 = update.\n+ * @acc_yds2: 0 = no update, 1 = update.\n+ * @acc_tcc: 0 = no update, 1 = update.\n+ * @acc_dpc: 0 = no update, 1 = update.\n+ * @acc_bds: 0 = no update, 1 = update.\n+ * @acc_anr: 0 = no update, 1 = update.\n+ * @acc_awb_fr: 0 = no update, 1 = update.\n+ * @acc_ae: 0 = no update, 1 = update.\n+ * @acc_af: 0 = no update, 1 = update.\n+ * @acc_awb: 0 = no update, 1 = update.\n+ * @__acc_osys: 0 = no update, 1 = update.\n+ * @reserved3: Not used.\n+ * @lin_vmem_params: 0 = no update, 1 = update.\n+ * @tnr3_vmem_params: 0 = no update, 1 = update.\n+ * @xnr3_vmem_params: 0 = no update, 1 = update.\n+ * @tnr3_dmem_params: 0 = no update, 1 = update.\n+ * @xnr3_dmem_params: 0 = no update, 1 = update.\n+ * @reserved4: Not used.\n+ * @obgrid_param: 0 = no update, 1 = update.\n+ * @reserved5: Not used.\n+ */\n+struct ipu3_uapi_flags {\n+\t__u32 gdc:1;\n+\t__u32 obgrid:1;\n+\t__u32 reserved1:30;\n+\n+\t__u32 acc_bnr:1;\n+\t__u32 acc_green_disparity:1;\n+\t__u32 acc_dm:1;\n+\t__u32 acc_ccm:1;\n+\t__u32 acc_gamma:1;\n+\t__u32 acc_csc:1;\n+\t__u32 acc_cds:1;\n+\t__u32 acc_shd:1;\n+\t__u32 reserved2:2;\n+\t__u32 acc_iefd:1;\n+\t__u32 acc_yds_c0:1;\n+\t__u32 acc_chnr_c0:1;\n+\t__u32 acc_y_ee_nr:1;\n+\t__u32 acc_yds:1;\n+\t__u32 acc_chnr:1;\n+\t__u32 acc_ytm:1;\n+\t__u32 acc_yds2:1;\n+\t__u32 acc_tcc:1;\n+\t__u32 acc_dpc:1;\n+\t__u32 acc_bds:1;\n+\t__u32 acc_anr:1;\n+\t__u32 acc_awb_fr:1;\n+\t__u32 acc_ae:1;\n+\t__u32 acc_af:1;\n+\t__u32 acc_awb:1;\n+\t__u32 reserved3:4;\n+\n+\t__u32 lin_vmem_params:1;\n+\t__u32 tnr3_vmem_params:1;\n+\t__u32 xnr3_vmem_params:1;\n+\t__u32 tnr3_dmem_params:1;\n+\t__u32 xnr3_dmem_params:1;\n+\t__u32 reserved4:1;\n+\t__u32 obgrid_param:1;\n+\t__u32 reserved5:25;\n+} __attribute__((packed));\n+\n+/**\n+ * struct ipu3_uapi_params - V4L2_META_FMT_IPU3_PARAMS\n+ *\n+ * @use:\tselect which parameters to apply, see &ipu3_uapi_flags\n+ * @acc_param:\tACC parameters, as specified by &ipu3_uapi_acc_param\n+ * @lin_vmem_params:\tlinearization VMEM, as specified by\n+ *\t\t\t&ipu3_uapi_isp_lin_vmem_params\n+ * @tnr3_vmem_params:\ttnr3 VMEM as specified by\n+ *\t\t\t&ipu3_uapi_isp_tnr3_vmem_params\n+ * @xnr3_vmem_params:\txnr3 VMEM as specified by\n+ *\t\t\t&ipu3_uapi_isp_xnr3_vmem_params\n+ * @tnr3_dmem_params:\ttnr3 DMEM as specified by &ipu3_uapi_isp_tnr3_params\n+ * @xnr3_dmem_params:\txnr3 DMEM as specified by &ipu3_uapi_isp_xnr3_params\n+ * @obgrid_param:\tobgrid parameters as specified by\n+ *\t\t\t&ipu3_uapi_obgrid_param\n+ *\n+ * The video queue \"parameters\" is of format V4L2_META_FMT_IPU3_PARAMS.\n+ * This is a \"single plane\" v4l2_meta_format using V4L2_BUF_TYPE_META_OUTPUT.\n+ *\n+ * struct ipu3_uapi_params as defined below contains a lot of parameters and\n+ * ipu3_uapi_flags selects which parameters to apply.\n+ */\n+struct ipu3_uapi_params {\n+\t/* Flags which of the settings below are to be applied */\n+\tstruct ipu3_uapi_flags use __attribute__((aligned(32)));\n+\n+\t/* Accelerator cluster parameters */\n+\tstruct ipu3_uapi_acc_param acc_param;\n+\n+\t/* ISP vector address space parameters */\n+\tstruct ipu3_uapi_isp_lin_vmem_params lin_vmem_params;\n+\tstruct ipu3_uapi_isp_tnr3_vmem_params tnr3_vmem_params;\n+\tstruct ipu3_uapi_isp_xnr3_vmem_params xnr3_vmem_params;\n+\n+\t/* ISP data memory (DMEM) parameters */\n+\tstruct ipu3_uapi_isp_tnr3_params tnr3_dmem_params;\n+\tstruct ipu3_uapi_isp_xnr3_params xnr3_dmem_params;\n+\n+\t/* Optical black level compensation */\n+\tstruct ipu3_uapi_obgrid_param obgrid_param;\n+} __attribute__((packed));\n+\n+#endif /* __IPU3_UAPI_H */\n",
    "prefixes": [
        "libcamera-devel",
        "4/6"
    ]
}