Show a patch.

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

{
    "id": 9840,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/9840/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9840/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200928201311.3995725-3-niklas.soderlund@ragnatech.se>",
    "date": "2020-09-28T20:13:11",
    "name": "[libcamera-devel,2/2] include: linux: Update rkisp1 header",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "18b1e5f6e38feacfca1bd4e808e2b6b1513557a7",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9840/mbox/",
    "series": [
        {
            "id": 1330,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1330/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1330",
            "date": "2020-09-28T20:13:09",
            "name": "rkisp1: Refresh user-space header",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1330/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9840/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9840/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0DEA2C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Sep 2020 20:13:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DB16961F8E;\n\tMon, 28 Sep 2020 22:13:30 +0200 (CEST)",
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 274E560366\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Sep 2020 22:13:30 +0200 (CEST)",
            "from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de\n\t[84.172.82.168]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 11793452-01c7-11eb-9823-005056917f90;\n\tMon, 28 Sep 2020 22:13:27 +0200 (CEST)"
        ],
        "X-Halon-ID": "11793452-01c7-11eb-9823-005056917f90",
        "Authorized-sender": "niklas.soderlund@fsdn.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 28 Sep 2020 22:13:11 +0200",
        "Message-Id": "<20200928201311.3995725-3-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200928201311.3995725-1-niklas.soderlund@ragnatech.se>",
        "References": "<20200928201311.3995725-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 2/2] include: linux: Update rkisp1 header",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Refresh the RkISP1 user-space header to match the latest state in the\nmedia-tree [1]. This requires update of symbol names in the RkISP1 IPA\nbut there is no functional change.\n\nUnfortunately the upstream header has a few problems that needs to be\nfixed before it can be used.\n\n1. The SPDX header does not satisfy the Linux scripts/headers_install.sh\n   so the installation step have to be done manually (dropping _UAPI\n   prefix from header include guard). Issue is reported upstream.\n\n2. The BIT() macro is used in the header but unfortunately this macro\n   is not accessible in user-space headers. Fix this by reverting back\n   to open code setting the bit without macro. Fix submitted upstream\n   and acked by maintainer.\n\n1. d7a81a5b07313535 (\"media: staging: rkisp1: uapi: remove __packed\")\n2. [PATCH] staging: rkisp1: uapi: Do not use BIT() macro\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n include/linux/rkisp1-config.h | 720 +++++++++++++++++++---------------\n src/ipa/rkisp1/rkisp1.cpp     |  20 +-\n 2 files changed, 406 insertions(+), 334 deletions(-)",
    "diff": "diff --git a/include/linux/rkisp1-config.h b/include/linux/rkisp1-config.h\nindex f0d1bd82e857fd79..a795a2a4f6bd7ad4 100644\n--- a/include/linux/rkisp1-config.h\n+++ b/include/linux/rkisp1-config.h\n@@ -1,169 +1,195 @@\n /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */\n /*\n- * Rockchip isp1 driver\n+ * Rockchip ISP1 userspace API\n  * Copyright (C) 2017 Rockchip Electronics Co., Ltd.\n  */\n \n-/*\n- * TODO: Improve documentation, mostly regarding abbreviation and hardware\n- * specificities.\n- */\n-\n #ifndef _RKISP1_CONFIG_H\n #define _RKISP1_CONFIG_H\n \n #include <linux/types.h>\n-#include <linux/v4l2-controls.h>\n \n-#define CIFISP_MODULE_DPCC              (1 << 0)\n-#define CIFISP_MODULE_BLS               (1 << 1)\n-#define CIFISP_MODULE_SDG               (1 << 2)\n-#define CIFISP_MODULE_HST               (1 << 3)\n-#define CIFISP_MODULE_LSC               (1 << 4)\n-#define CIFISP_MODULE_AWB_GAIN          (1 << 5)\n-#define CIFISP_MODULE_FLT               (1 << 6)\n-#define CIFISP_MODULE_BDM               (1 << 7)\n-#define CIFISP_MODULE_CTK               (1 << 8)\n-#define CIFISP_MODULE_GOC               (1 << 9)\n-#define CIFISP_MODULE_CPROC             (1 << 10)\n-#define CIFISP_MODULE_AFC               (1 << 11)\n-#define CIFISP_MODULE_AWB               (1 << 12)\n-#define CIFISP_MODULE_IE                (1 << 13)\n-#define CIFISP_MODULE_AEC               (1 << 14)\n-#define CIFISP_MODULE_WDR               (1 << 15)\n-#define CIFISP_MODULE_DPF               (1 << 16)\n-#define CIFISP_MODULE_DPF_STRENGTH      (1 << 17)\n+/* Vendor specific - used for RK_ISP1 camera sub-system */\n+#define V4L2_META_FMT_RK_ISP1_PARAMS   v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 params */\n+#define V4L2_META_FMT_RK_ISP1_STAT_3A  v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A statistics */\n \n-#define CIFISP_CTK_COEFF_MAX            0x100\n-#define CIFISP_CTK_OFFSET_MAX           0x800\n+/* Defect Pixel Cluster Detection */\n+#define RKISP1_CIF_ISP_MODULE_DPCC\t\t(1 << 0)\n+/* Black Level Subtraction */\n+#define RKISP1_CIF_ISP_MODULE_BLS\t\t(1 << 1)\n+/* Sensor De-gamma */\n+#define RKISP1_CIF_ISP_MODULE_SDG\t\t(1 << 2)\n+/* Histogram */\n+#define RKISP1_CIF_ISP_MODULE_HST\t\t(1 << 3)\n+/* Lens Shade Control */\n+#define RKISP1_CIF_ISP_MODULE_LSC\t\t(1 << 4)\n+/* Auto White Balance Gain */\n+#define RKISP1_CIF_ISP_MODULE_AWB_GAIN\t\t(1 << 5)\n+/* Filter */\n+#define RKISP1_CIF_ISP_MODULE_FLT\t\t(1 << 6)\n+/* Bayer Demosaic */\n+#define RKISP1_CIF_ISP_MODULE_BDM\t\t(1 << 7)\n+/* Cross Talk */\n+#define RKISP1_CIF_ISP_MODULE_CTK\t\t(1 << 8)\n+/* Gamma Out Curve */\n+#define RKISP1_CIF_ISP_MODULE_GOC\t\t(1 << 9)\n+/* Color Processing */\n+#define RKISP1_CIF_ISP_MODULE_CPROC\t\t(1 << 10)\n+/* Auto Focus Control */\n+#define RKISP1_CIF_ISP_MODULE_AFC\t\t(1 << 11)\n+/* Auto White Balancing */\n+#define RKISP1_CIF_ISP_MODULE_AWB\t\t(1 << 12)\n+/* Image Effect */\n+#define RKISP1_CIF_ISP_MODULE_IE\t\t(1 << 13)\n+/* Auto Exposure Control */\n+#define RKISP1_CIF_ISP_MODULE_AEC\t\t(1 << 14)\n+/* Wide Dynamic Range */\n+#define RKISP1_CIF_ISP_MODULE_WDR\t\t(1 << 15)\n+/* Denoise Pre-Filter */\n+#define RKISP1_CIF_ISP_MODULE_DPF\t\t(1 << 16)\n+/* Denoise Pre-Filter Strength */\n+#define RKISP1_CIF_ISP_MODULE_DPF_STRENGTH\t(1 << 17)\n \n-#define CIFISP_AE_MEAN_MAX              25\n-#define CIFISP_HIST_BIN_N_MAX           16\n-#define CIFISP_AFM_MAX_WINDOWS          3\n-#define CIFISP_DEGAMMA_CURVE_SIZE       17\n+#define RKISP1_CIF_ISP_CTK_COEFF_MAX            0x100\n+#define RKISP1_CIF_ISP_CTK_OFFSET_MAX           0x800\n \n-#define CIFISP_BDM_MAX_TH               0xFF\n+#define RKISP1_CIF_ISP_AE_MEAN_MAX              25\n+#define RKISP1_CIF_ISP_HIST_BIN_N_MAX           16\n+#define RKISP1_CIF_ISP_AFM_MAX_WINDOWS          3\n+#define RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE       17\n+\n+#define RKISP1_CIF_ISP_BDM_MAX_TH               0xff\n \n /*\n  * Black level compensation\n  */\n /* maximum value for horizontal start address */\n-#define CIFISP_BLS_START_H_MAX             0x00000FFF\n+#define RKISP1_CIF_ISP_BLS_START_H_MAX             0x00000fff\n /* maximum value for horizontal stop address */\n-#define CIFISP_BLS_STOP_H_MAX              0x00000FFF\n+#define RKISP1_CIF_ISP_BLS_STOP_H_MAX              0x00000fff\n /* maximum value for vertical start address */\n-#define CIFISP_BLS_START_V_MAX             0x00000FFF\n+#define RKISP1_CIF_ISP_BLS_START_V_MAX             0x00000fff\n /* maximum value for vertical stop address */\n-#define CIFISP_BLS_STOP_V_MAX              0x00000FFF\n+#define RKISP1_CIF_ISP_BLS_STOP_V_MAX              0x00000fff\n /* maximum is 2^18 = 262144*/\n-#define CIFISP_BLS_SAMPLES_MAX             0x00000012\n+#define RKISP1_CIF_ISP_BLS_SAMPLES_MAX             0x00000012\n /* maximum value for fixed black level */\n-#define CIFISP_BLS_FIX_SUB_MAX             0x00000FFF\n+#define RKISP1_CIF_ISP_BLS_FIX_SUB_MAX             0x00000fff\n /* minimum value for fixed black level */\n-#define CIFISP_BLS_FIX_SUB_MIN             0xFFFFF000\n+#define RKISP1_CIF_ISP_BLS_FIX_SUB_MIN             0xfffff000\n /* 13 bit range (signed)*/\n-#define CIFISP_BLS_FIX_MASK                0x00001FFF\n+#define RKISP1_CIF_ISP_BLS_FIX_MASK                0x00001fff\n \n /*\n- * Automatic white balance measurments\n+ * Automatic white balance measurements\n  */\n-#define CIFISP_AWB_MAX_GRID                1\n-#define CIFISP_AWB_MAX_FRAMES              7\n+#define RKISP1_CIF_ISP_AWB_MAX_GRID                1\n+#define RKISP1_CIF_ISP_AWB_MAX_FRAMES              7\n \n /*\n  * Gamma out\n  */\n /* Maximum number of color samples supported */\n-#define CIFISP_GAMMA_OUT_MAX_SAMPLES       17\n+#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES       17\n \n /*\n  * Lens shade correction\n  */\n-#define CIFISP_LSC_GRAD_TBL_SIZE           8\n-#define CIFISP_LSC_SIZE_TBL_SIZE           8\n+#define RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE        8\n+\n /*\n  * The following matches the tuning process,\n  * not the max capabilities of the chip.\n- * Last value unused.\n  */\n-#define\tCIFISP_LSC_DATA_TBL_SIZE           290\n+#define RKISP1_CIF_ISP_LSC_SAMPLES_MAX             17\n \n /*\n  * Histogram calculation\n  */\n /* Last 3 values unused. */\n-#define CIFISP_HISTOGRAM_WEIGHT_GRIDS_SIZE 28\n+#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE 28\n \n /*\n  * Defect Pixel Cluster Correction\n  */\n-#define CIFISP_DPCC_METHODS_MAX       3\n+#define RKISP1_CIF_ISP_DPCC_METHODS_MAX       3\n \n /*\n  * Denoising pre filter\n  */\n-#define CIFISP_DPF_MAX_NLF_COEFFS      17\n-#define CIFISP_DPF_MAX_SPATIAL_COEFFS  6\n+#define RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS      17\n+#define RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS  6\n \n /*\n  * Measurement types\n  */\n-#define CIFISP_STAT_AWB           (1 << 0)\n-#define CIFISP_STAT_AUTOEXP       (1 << 1)\n-#define CIFISP_STAT_AFM_FIN       (1 << 2)\n-#define CIFISP_STAT_HIST          (1 << 3)\n+#define RKISP1_CIF_ISP_STAT_AWB           (1 << 0)\n+#define RKISP1_CIF_ISP_STAT_AUTOEXP       (1 << 1)\n+#define RKISP1_CIF_ISP_STAT_AFM           (1 << 2)\n+#define RKISP1_CIF_ISP_STAT_HIST          (1 << 3)\n \n-enum cifisp_histogram_mode {\n-\tCIFISP_HISTOGRAM_MODE_DISABLE,\n-\tCIFISP_HISTOGRAM_MODE_RGB_COMBINED,\n-\tCIFISP_HISTOGRAM_MODE_R_HISTOGRAM,\n-\tCIFISP_HISTOGRAM_MODE_G_HISTOGRAM,\n-\tCIFISP_HISTOGRAM_MODE_B_HISTOGRAM,\n-\tCIFISP_HISTOGRAM_MODE_Y_HISTOGRAM\n+enum rkisp1_cif_isp_histogram_mode {\n+\tRKISP1_CIF_ISP_HISTOGRAM_MODE_DISABLE,\n+\tRKISP1_CIF_ISP_HISTOGRAM_MODE_RGB_COMBINED,\n+\tRKISP1_CIF_ISP_HISTOGRAM_MODE_R_HISTOGRAM,\n+\tRKISP1_CIF_ISP_HISTOGRAM_MODE_G_HISTOGRAM,\n+\tRKISP1_CIF_ISP_HISTOGRAM_MODE_B_HISTOGRAM,\n+\tRKISP1_CIF_ISP_HISTOGRAM_MODE_Y_HISTOGRAM\n };\n \n-enum cifisp_awb_mode_type {\n-\tCIFISP_AWB_MODE_MANUAL,\n-\tCIFISP_AWB_MODE_RGB,\n-\tCIFISP_AWB_MODE_YCBCR\n+enum rkisp1_cif_isp_awb_mode_type {\n+\tRKISP1_CIF_ISP_AWB_MODE_MANUAL,\n+\tRKISP1_CIF_ISP_AWB_MODE_RGB,\n+\tRKISP1_CIF_ISP_AWB_MODE_YCBCR\n };\n \n-enum cifisp_flt_mode {\n-\tCIFISP_FLT_STATIC_MODE,\n-\tCIFISP_FLT_DYNAMIC_MODE\n+enum rkisp1_cif_isp_flt_mode {\n+\tRKISP1_CIF_ISP_FLT_STATIC_MODE,\n+\tRKISP1_CIF_ISP_FLT_DYNAMIC_MODE\n };\n \n /**\n- * enum cifisp_exp_ctrl_autostop - stop modes\n- * @CIFISP_EXP_CTRL_AUTOSTOP_0: continuous measurement\n- * @CIFISP_EXP_CTRL_AUTOSTOP_1: stop measuring after a complete frame\n+ * enum rkisp1_cif_isp_exp_ctrl_autostop - stop modes\n+ * @RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0: continuous measurement\n+ * @RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1: stop measuring after a complete frame\n  */\n-enum cifisp_exp_ctrl_autostop {\n-\tCIFISP_EXP_CTRL_AUTOSTOP_0 = 0,\n-\tCIFISP_EXP_CTRL_AUTOSTOP_1 = 1,\n+enum rkisp1_cif_isp_exp_ctrl_autostop {\n+\tRKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0 = 0,\n+\tRKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1 = 1,\n };\n \n /**\n- * enum cifisp_exp_meas_mode - Exposure measure mode\n- * @CIFISP_EXP_MEASURING_MODE_0: Y = 16 + 0.25R + 0.5G + 0.1094B\n- * @CIFISP_EXP_MEASURING_MODE_1: Y = (R + G + B) x (85/256)\n+ * enum rkisp1_cif_isp_exp_meas_mode - Exposure measure mode\n+ * @RKISP1_CIF_ISP_EXP_MEASURING_MODE_0: Y = 16 + 0.25R + 0.5G + 0.1094B\n+ * @RKISP1_CIF_ISP_EXP_MEASURING_MODE_1: Y = (R + G + B) x (85/256)\n  */\n-enum cifisp_exp_meas_mode {\n-\tCIFISP_EXP_MEASURING_MODE_0,\n-\tCIFISP_EXP_MEASURING_MODE_1,\n+enum rkisp1_cif_isp_exp_meas_mode {\n+\tRKISP1_CIF_ISP_EXP_MEASURING_MODE_0,\n+\tRKISP1_CIF_ISP_EXP_MEASURING_MODE_1,\n };\n \n /*---------- PART1: Input Parameters ------------*/\n \n-struct cifisp_window {\n+/**\n+ * struct rkisp1_cif_isp_window -  measurement window.\n+ *\n+ * Measurements are calculated per window inside the frame.\n+ * This struct represents a window for a measurement.\n+ *\n+ * @h_offs: the horizontal offset of the window from the left of the frame in pixels.\n+ * @v_offs: the vertical offset of the window from the top of the frame in pixels.\n+ * @h_size: the horizontal size of the window in pixels\n+ * @v_size: the vertical size of the window in pixels.\n+ */\n+struct rkisp1_cif_isp_window {\n \t__u16 h_offs;\n \t__u16 v_offs;\n \t__u16 h_size;\n \t__u16 v_size;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_bls_fixed_val - BLS fixed subtraction values\n+ * struct rkisp1_cif_isp_bls_fixed_val - BLS fixed subtraction values\n  *\n  * The values will be subtracted from the sensor\n  * values. Therefore a negative value means addition instead of subtraction!\n@@ -173,15 +199,15 @@ struct cifisp_window {\n  * @gb: Fixed (signed!) subtraction value for Bayer pattern Gb\n  * @b: Fixed (signed!) subtraction value for Bayer pattern B\n  */\n-struct cifisp_bls_fixed_val {\n+struct rkisp1_cif_isp_bls_fixed_val {\n \t__s16 r;\n \t__s16 gr;\n \t__s16 gb;\n \t__s16 b;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_bls_config - Configuration used by black level subtraction\n+ * struct rkisp1_cif_isp_bls_config - Configuration used by black level subtraction\n  *\n  * @enable_auto: Automatic mode activated means that the measured values\n  *\t\t are subtracted. Otherwise the fixed subtraction\n@@ -191,19 +217,19 @@ struct cifisp_bls_fixed_val {\n  * @bls_window2: Measurement window 2 size\n  * @bls_samples: Set amount of measured pixels for each Bayer position\n  *\t\t (A, B,C and D) to 2^bls_samples.\n- * @cifisp_bls_fixed_val: Fixed subtraction values\n+ * @fixed_val: Fixed subtraction values\n  */\n-struct cifisp_bls_config {\n+struct rkisp1_cif_isp_bls_config {\n \t__u8 enable_auto;\n \t__u8 en_windows;\n-\tstruct cifisp_window bls_window1;\n-\tstruct cifisp_window bls_window2;\n+\tstruct rkisp1_cif_isp_window bls_window1;\n+\tstruct rkisp1_cif_isp_window bls_window2;\n \t__u8 bls_samples;\n-\tstruct cifisp_bls_fixed_val fixed_val;\n-} __attribute__ ((packed));\n+\tstruct rkisp1_cif_isp_bls_fixed_val fixed_val;\n+};\n \n /**\n- * struct cifisp_dpcc_methods_config - Methods Configuration used by DPCC\n+ * struct rkisp1_cif_isp_dpcc_methods_config - Methods Configuration used by DPCC\n  *\n  * Methods Configuration used by Defect Pixel Cluster Correction\n  *\n@@ -214,17 +240,17 @@ struct cifisp_bls_config {\n  * @rnd_thresh: Rank Neighbor Difference threshold\n  * @rg_fac: Rank gradient factor\n  */\n-struct cifisp_dpcc_methods_config {\n+struct rkisp1_cif_isp_dpcc_methods_config {\n \t__u32 method;\n \t__u32 line_thresh;\n \t__u32 line_mad_fac;\n \t__u32 pg_fac;\n \t__u32 rnd_thresh;\n \t__u32 rg_fac;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_dpcc_methods_config - Configuration used by DPCC\n+ * struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC\n  *\n  * Configuration used by Defect Pixel Cluster Correction\n  *\n@@ -235,60 +261,95 @@ struct cifisp_dpcc_methods_config {\n  * @ro_limits: rank order limits\n  * @rnd_offs: differential rank offsets for rank neighbor difference\n  */\n-struct cifisp_dpcc_config {\n+struct rkisp1_cif_isp_dpcc_config {\n \t__u32 mode;\n \t__u32 output_mode;\n \t__u32 set_use;\n-\tstruct cifisp_dpcc_methods_config methods[CIFISP_DPCC_METHODS_MAX];\n+\tstruct rkisp1_cif_isp_dpcc_methods_config methods[RKISP1_CIF_ISP_DPCC_METHODS_MAX];\n \t__u32 ro_limits;\n \t__u32 rnd_offs;\n-} __attribute__ ((packed));\n+};\n \n-struct cifisp_gamma_corr_curve {\n-\t__u16 gamma_y[CIFISP_DEGAMMA_CURVE_SIZE];\n-} __attribute__ ((packed));\n+/**\n+ * struct rkisp1_cif_isp_gamma_corr_curve - gamma curve point definition y-axis (output).\n+ *\n+ * The reset values define a linear curve which has the same effect as bypass. Reset values are:\n+ * gamma_y[0] = 0x0000, gamma_y[1] = 0x0100, ... gamma_y[15] = 0x0f00, gamma_y[16] = 0xfff\n+ *\n+ * @gamma_y: the values for the y-axis of gamma curve points. Each value is 12 bit.\n+ */\n+struct rkisp1_cif_isp_gamma_corr_curve {\n+\t__u16 gamma_y[RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE];\n+};\n \n-struct cifisp_gamma_curve_x_axis_pnts {\n+/**\n+ * struct rkisp1_cif_isp_gamma_curve_x_axis_pnts - De-Gamma Curve definition x increments\n+ *\t\t(sampling points). gamma_dx0 is for the lower samples (1-8), gamma_dx1 is for the\n+ *\t\thigher samples (9-16). The reset values for both fields is 0x44444444. This means\n+ *\t\tthat each sample is 4 units away from the previous one on the x-axis.\n+ *\n+ * @gamma_dx0: gamma curve sample points definitions. Bits 0:2 for sample 1. Bit 3 unused.\n+ *\t\tBits 4:6 for sample 2. bit 7 unused ... Bits 28:30 for sample 8. Bit 31 unused\n+ * @gamma_dx1: gamma curve sample points definitions. Bits 0:2 for sample 9. Bit 3 unused.\n+ *\t\tBits 4:6 for sample 10. bit 7 unused ... Bits 28:30 for sample 16. Bit 31 unused\n+ */\n+struct rkisp1_cif_isp_gamma_curve_x_axis_pnts {\n \t__u32 gamma_dx0;\n \t__u32 gamma_dx1;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_gamma_corr_curve - Configuration used by sensor degamma\n+ * struct rkisp1_cif_isp_sdg_config - Configuration used by sensor degamma\n  *\n- * @curve_x: gamma curve point definition axis for x\n- * @xa_pnts: x increments\n+ * @curve_r: gamma curve point definition axis for red\n+ * @curve_g: gamma curve point definition axis for green\n+ * @curve_b: gamma curve point definition axis for blue\n+ * @xa_pnts: x axis increments\n  */\n-struct cifisp_sdg_config {\n-\tstruct cifisp_gamma_corr_curve curve_r;\n-\tstruct cifisp_gamma_corr_curve curve_g;\n-\tstruct cifisp_gamma_corr_curve curve_b;\n-\tstruct cifisp_gamma_curve_x_axis_pnts xa_pnts;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_sdg_config {\n+\tstruct rkisp1_cif_isp_gamma_corr_curve curve_r;\n+\tstruct rkisp1_cif_isp_gamma_corr_curve curve_g;\n+\tstruct rkisp1_cif_isp_gamma_corr_curve curve_b;\n+\tstruct rkisp1_cif_isp_gamma_curve_x_axis_pnts xa_pnts;\n+};\n \n /**\n- * struct cifisp_lsc_config - Configuration used by Lens shading correction\n+ * struct rkisp1_cif_isp_lsc_config - Configuration used by Lens shading correction\n  *\n- * refer to REF_01 for details\n+ * @r_data_tbl: sample table red\n+ * @gr_data_tbl: sample table green (red)\n+ * @gb_data_tbl: sample table green (blue)\n+ * @b_data_tbl: sample table blue\n+ * @x_grad_tbl: gradient table x\n+ * @y_grad_tbl: gradient table y\n+ * @x_size_tbl: size table x\n+ * @y_size_tbl: size table y\n+ * @config_width: not used at the moment\n+ * @config_height: not used at the moment\n  */\n-struct cifisp_lsc_config {\n-\t__u32 r_data_tbl[CIFISP_LSC_DATA_TBL_SIZE];\n-\t__u32 gr_data_tbl[CIFISP_LSC_DATA_TBL_SIZE];\n-\t__u32 gb_data_tbl[CIFISP_LSC_DATA_TBL_SIZE];\n-\t__u32 b_data_tbl[CIFISP_LSC_DATA_TBL_SIZE];\n+struct rkisp1_cif_isp_lsc_config {\n+\t__u16 r_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];\n+\t__u16 gr_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];\n+\t__u16 gb_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];\n+\t__u16 b_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];\n \n-\t__u32 x_grad_tbl[CIFISP_LSC_GRAD_TBL_SIZE];\n-\t__u32 y_grad_tbl[CIFISP_LSC_GRAD_TBL_SIZE];\n+\t__u16 x_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n+\t__u16 y_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n \n-\t__u32 x_size_tbl[CIFISP_LSC_SIZE_TBL_SIZE];\n-\t__u32 y_size_tbl[CIFISP_LSC_SIZE_TBL_SIZE];\n+\t__u16 x_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n+\t__u16 y_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];\n \t__u16 config_width;\n \t__u16 config_height;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_ie_config - Configuration used by image effects\n+ * struct rkisp1_cif_isp_ie_config - Configuration used by image effects\n  *\n+ * @effect: values from 'enum v4l2_colorfx'. Possible values are: V4L2_COLORFX_SEPIA,\n+ *\t\tV4L2_COLORFX_SET_CBCR, V4L2_COLORFX_AQUA, V4L2_COLORFX_EMBOSS,\n+ *\t\tV4L2_COLORFX_SKETCH,   V4L2_COLORFX_BW,   V4L2_COLORFX_NEGATIVE\n+ * @color_sel: bits 0:2 - colors bitmask (001 - blue, 010 - green, 100 - red).\n+ *\t\tbits 8:15 - Threshold value of the RGB colors for the color selection effect.\n  * @eff_mat_1: 3x3 Matrix Coefficients for Emboss Effect 1\n  * @eff_mat_2: 3x3 Matrix Coefficients for Emboss Effect 2\n  * @eff_mat_3: 3x3 Matrix Coefficients for Emboss 3/Sketch 1\n@@ -296,7 +357,7 @@ struct cifisp_lsc_config {\n  * @eff_mat_5: 3x3 Matrix Coefficients for Sketch Effect 3\n  * @eff_tint: Chrominance increment values of tint (used for sepia effect)\n  */\n-struct cifisp_ie_config {\n+struct rkisp1_cif_isp_ie_config {\n \t__u16 effect;\n \t__u16 color_sel;\n \t__u16 eff_mat_1;\n@@ -305,10 +366,10 @@ struct cifisp_ie_config {\n \t__u16 eff_mat_4;\n \t__u16 eff_mat_5;\n \t__u16 eff_tint;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_cproc_config - Configuration used by Color Processing\n+ * struct rkisp1_cif_isp_cproc_config - Configuration used by Color Processing\n  *\n  * @c_out_range: Chrominance pixel clipping range at output.\n  *\t\t (0 for limit, 1 for full)\n@@ -319,7 +380,7 @@ struct cifisp_ie_config {\n  * @sat: saturation, 00~FF, 0.0~1.992\n  * @hue: 80~7F, -90~+87.188\n  */\n-struct cifisp_cproc_config {\n+struct rkisp1_cif_isp_cproc_config {\n \t__u8 c_out_range;\n \t__u8 y_in_range;\n \t__u8 y_out_range;\n@@ -327,13 +388,13 @@ struct cifisp_cproc_config {\n \t__u8 brightness;\n \t__u8 sat;\n \t__u8 hue;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_awb_meas_config - Configuration used by auto white balance\n+ * struct rkisp1_cif_isp_awb_meas_config - Configuration used by auto white balance\n  *\n+ * @awb_mode: the awb meas mode. From enum rkisp1_cif_isp_awb_mode_type.\n  * @awb_wnd: white balance measurement window (in pixels)\n- *\t     (from enum cifisp_awb_mode_type)\n  * @max_y: only pixels values < max_y contribute to awb measurement, set to 0\n  *\t   to disable this feature\n  * @min_y: only pixels values > min_y contribute to awb measurement\n@@ -345,12 +406,13 @@ struct cifisp_cproc_config {\n  *\t    (ucFrames=0 means 1 Frame)\n  * @awb_ref_cr: reference Cr value for AWB regulation, target for AWB\n  * @awb_ref_cb: reference Cb value for AWB regulation, target for AWB\n+ * @enable_ymax_cmp: enable Y_MAX compare (Not valid in RGB measurement mode.)\n  */\n-struct cifisp_awb_meas_config {\n+struct rkisp1_cif_isp_awb_meas_config {\n \t/*\n \t * Note: currently the h and v offsets are mapped to grid offsets\n \t */\n-\tstruct cifisp_window awb_wnd;\n+\tstruct rkisp1_cif_isp_window awb_wnd;\n \t__u32 awb_mode;\n \t__u8 max_y;\n \t__u8 min_y;\n@@ -360,32 +422,50 @@ struct cifisp_awb_meas_config {\n \t__u8 awb_ref_cr;\n \t__u8 awb_ref_cb;\n \t__u8 enable_ymax_cmp;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_awb_gain_config - Configuration used by auto white balance gain\n+ * struct rkisp1_cif_isp_awb_gain_config - Configuration used by auto white balance gain\n  *\n- * out_data_x = ( AWB_GEAIN_X * in_data + 128) >> 8\n+ * All fields in this struct are 10 bit, where:\n+ * 0x100h = 1, unsigned integer value, range 0 to 4 with 8 bit fractional part.\n+ *\n+ * out_data_x = ( AWB_GAIN_X * in_data + 128) >> 8\n+ *\n+ * @gain_red: gain value for red component.\n+ * @gain_green_r: gain value for green component in red line.\n+ * @gain_blue: gain value for blue component.\n+ * @gain_green_b: gain value for green component in blue line.\n  */\n-struct cifisp_awb_gain_config {\n+struct rkisp1_cif_isp_awb_gain_config {\n \t__u16 gain_red;\n \t__u16 gain_green_r;\n \t__u16 gain_blue;\n \t__u16 gain_green_b;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_flt_config - Configuration used by ISP filtering\n+ * struct rkisp1_cif_isp_flt_config - Configuration used by ISP filtering\n  *\n- * @mode: ISP_FILT_MODE register fields (from enum cifisp_flt_mode)\n- * @grn_stage1: ISP_FILT_MODE register fields\n- * @chr_h_mode: ISP_FILT_MODE register fields\n- * @chr_v_mode: ISP_FILT_MODE register fields\n+ * All 4 threshold fields (thresh_*) are 10 bits.\n+ * All 6 factor fields (fac_*) are 6 bits.\n  *\n- * refer to REF_01 for details.\n+ * @mode: ISP_FILT_MODE register fields (from enum rkisp1_cif_isp_flt_mode)\n+ * @grn_stage1: Green filter stage 1 select (range 0x0...0x8)\n+ * @chr_h_mode: Chroma filter horizontal mode\n+ * @chr_v_mode: Chroma filter vertical mode\n+ * @thresh_bl0: If thresh_bl1 < sum_grad < thresh_bl0 then fac_bl0 is selected (blurring th)\n+ * @thresh_bl1: If sum_grad < thresh_bl1 then fac_bl1 is selected (blurring th)\n+ * @thresh_sh0: If thresh_sh0 < sum_grad < thresh_sh1 then thresh_sh0 is selected (sharpening th)\n+ * @thresh_sh1: If thresh_sh1 < sum_grad then thresh_sh1 is selected (sharpening th)\n+ * @lum_weight: Parameters for luminance weight function.\n+ * @fac_sh1: filter factor for sharp1 level\n+ * @fac_sh0: filter factor for sharp0 level\n+ * @fac_mid: filter factor for mid level and for static filter mode\n+ * @fac_bl0: filter factor for blur 0 level\n+ * @fac_bl1: filter factor for blur 1 level (max blur)\n  */\n-\n-struct cifisp_flt_config {\n+struct rkisp1_cif_isp_flt_config {\n \t__u32 mode;\n \t__u8 grn_stage1;\n \t__u8 chr_h_mode;\n@@ -400,187 +480,179 @@ struct cifisp_flt_config {\n \t__u32 fac_mid;\n \t__u32 fac_bl0;\n \t__u32 fac_bl1;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_bdm_config - Configuration used by Bayer DeMosaic\n+ * struct rkisp1_cif_isp_bdm_config - Configuration used by Bayer DeMosaic\n  *\n- * @demosaic_th: threshod for bayer demosaicing texture detection\n+ * @demosaic_th: threshold for bayer demosaicing texture detection\n  */\n-struct cifisp_bdm_config {\n+struct rkisp1_cif_isp_bdm_config {\n \t__u8 demosaic_th;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_ctk_config - Configuration used by Cross Talk correction\n+ * struct rkisp1_cif_isp_ctk_config - Configuration used by Cross Talk correction\n  *\n- * @coeff: color correction matrix\n- * @ct_offset_b: offset for the crosstalk correction matrix\n+ * @coeff: color correction matrix. Values are 11-bit signed fixed-point numbers with 4 bit integer\n+ *\t\tand 7 bit fractional part, ranging from -8 (0x400) to +7.992 (0x3FF). 0 is\n+ *\t\trepresented by 0x000 and a coefficient value of 1 as 0x080.\n+ * @ct_offset: Red, Green, Blue offsets for the crosstalk correction matrix\n  */\n-struct cifisp_ctk_config {\n-\t__u16 coeff0;\n-\t__u16 coeff1;\n-\t__u16 coeff2;\n-\t__u16 coeff3;\n-\t__u16 coeff4;\n-\t__u16 coeff5;\n-\t__u16 coeff6;\n-\t__u16 coeff7;\n-\t__u16 coeff8;\n-\t__u16 ct_offset_r;\n-\t__u16 ct_offset_g;\n-\t__u16 ct_offset_b;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_ctk_config {\n+\t__u16 coeff[3][3];\n+\t__u16 ct_offset[3];\n+};\n \n-enum cifisp_goc_mode {\n-\tCIFISP_GOC_MODE_LOGARITHMIC,\n-\tCIFISP_GOC_MODE_EQUIDISTANT\n+enum rkisp1_cif_isp_goc_mode {\n+\tRKISP1_CIF_ISP_GOC_MODE_LOGARITHMIC,\n+\tRKISP1_CIF_ISP_GOC_MODE_EQUIDISTANT\n };\n \n /**\n- * struct cifisp_goc_config - Configuration used by Gamma Out correction\n+ * struct rkisp1_cif_isp_goc_config - Configuration used by Gamma Out correction\n  *\n- * @mode: goc mode (from enum cifisp_goc_mode)\n+ * @mode: goc mode (from enum rkisp1_cif_isp_goc_mode)\n  * @gamma_y: gamma out curve y-axis for all color components\n  */\n-struct cifisp_goc_config {\n+struct rkisp1_cif_isp_goc_config {\n \t__u32 mode;\n-\t__u16 gamma_y[CIFISP_GAMMA_OUT_MAX_SAMPLES];\n-} __attribute__ ((packed));\n+\t__u16 gamma_y[RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES];\n+};\n \n /**\n- * struct cifisp_hst_config - Configuration used by Histogram\n+ * struct rkisp1_cif_isp_hst_config - Configuration used by Histogram\n  *\n- * @mode: histogram mode (from enum cifisp_histogram_mode)\n+ * @mode: histogram mode (from enum rkisp1_cif_isp_histogram_mode)\n  * @histogram_predivider: process every stepsize pixel, all other pixels are\n  *\t\t\t  skipped\n  * @meas_window: coordinates of the measure window\n  * @hist_weight: weighting factor for sub-windows\n  */\n-struct cifisp_hst_config {\n+struct rkisp1_cif_isp_hst_config {\n \t__u32 mode;\n \t__u8 histogram_predivider;\n-\tstruct cifisp_window meas_window;\n-\t__u8 hist_weight[CIFISP_HISTOGRAM_WEIGHT_GRIDS_SIZE];\n-} __attribute__ ((packed));\n+\tstruct rkisp1_cif_isp_window meas_window;\n+\t__u8 hist_weight[RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE];\n+};\n \n /**\n- * struct cifisp_aec_config - Configuration used by Auto Exposure Control\n+ * struct rkisp1_cif_isp_aec_config - Configuration used by Auto Exposure Control\n  *\n- * @mode: Exposure measure mode (from enum cifisp_exp_meas_mode)\n- * @autostop: stop mode (from enum cifisp_exp_ctrl_autostop)\n+ * @mode: Exposure measure mode (from enum rkisp1_cif_isp_exp_meas_mode)\n+ * @autostop: stop mode (from enum rkisp1_cif_isp_exp_ctrl_autostop)\n  * @meas_window: coordinates of the measure window\n  */\n-struct cifisp_aec_config {\n+struct rkisp1_cif_isp_aec_config {\n \t__u32 mode;\n \t__u32 autostop;\n-\tstruct cifisp_window meas_window;\n-} __attribute__ ((packed));\n+\tstruct rkisp1_cif_isp_window meas_window;\n+};\n \n /**\n- * struct cifisp_afc_config - Configuration used by Auto Focus Control\n+ * struct rkisp1_cif_isp_afc_config - Configuration used by Auto Focus Control\n  *\n- * @num_afm_win: max CIFISP_AFM_MAX_WINDOWS\n+ * @num_afm_win: max RKISP1_CIF_ISP_AFM_MAX_WINDOWS\n  * @afm_win: coordinates of the meas window\n  * @thres: threshold used for minimizing the influence of noise\n  * @var_shift: the number of bits for the shift operation at the end of the\n  *\t       calculation chain.\n  */\n-struct cifisp_afc_config {\n+struct rkisp1_cif_isp_afc_config {\n \t__u8 num_afm_win;\n-\tstruct cifisp_window afm_win[CIFISP_AFM_MAX_WINDOWS];\n+\tstruct rkisp1_cif_isp_window afm_win[RKISP1_CIF_ISP_AFM_MAX_WINDOWS];\n \t__u32 thres;\n \t__u32 var_shift;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * enum cifisp_dpf_gain_usage - dpf gain usage\n- * @CIFISP_DPF_GAIN_USAGE_DISABLED: don't use any gains in preprocessing stage\n- * @CIFISP_DPF_GAIN_USAGE_NF_GAINS: use only the noise function gains from\n+ * enum rkisp1_cif_isp_dpf_gain_usage - dpf gain usage\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED: don't use any gains in preprocessing stage\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS: use only the noise function gains from\n  *\t\t\t\t    registers DPF_NF_GAIN_R, ...\n- * @CIFISP_DPF_GAIN_USAGE_LSC_GAINS:  use only the gains from LSC module\n- * @CIFISP_DPF_GAIN_USAGE_NF_LSC_GAINS: use the noise function gains and the\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS:  use only the gains from LSC module\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS: use the noise function gains and the\n  *\t\t\t\t\tgains from LSC module\n- * @CIFISP_DPF_GAIN_USAGE_AWB_GAINS: use only the gains from AWB module\n- * @CIFISP_DPF_GAIN_USAGE_AWB_LSC_GAINS: use the gains from AWB and LSC module\n- * @CIFISP_DPF_GAIN_USAGE_MAX: upper border (only for an internal evaluation)\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS: use only the gains from AWB module\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS: use the gains from AWB and LSC module\n+ * @RKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX: upper border (only for an internal evaluation)\n  */\n-enum cifisp_dpf_gain_usage {\n-\tCIFISP_DPF_GAIN_USAGE_DISABLED,\n-\tCIFISP_DPF_GAIN_USAGE_NF_GAINS,\n-\tCIFISP_DPF_GAIN_USAGE_LSC_GAINS,\n-\tCIFISP_DPF_GAIN_USAGE_NF_LSC_GAINS,\n-\tCIFISP_DPF_GAIN_USAGE_AWB_GAINS,\n-\tCIFISP_DPF_GAIN_USAGE_AWB_LSC_GAINS,\n-\tCIFISP_DPF_GAIN_USAGE_MAX\n+enum rkisp1_cif_isp_dpf_gain_usage {\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED,\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS,\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS,\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS,\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS,\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS,\n+\tRKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX\n };\n \n /**\n- * enum cifisp_dpf_gain_usage - dpf gain usage\n- * @CIFISP_DPF_RB_FILTERSIZE_13x9: red and blue filter kernel size 13x9\n+ * enum rkisp1_cif_isp_dpf_rb_filtersize - Red and blue filter sizes\n+ * @RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9: red and blue filter kernel size 13x9\n  *\t\t\t\t   (means 7x5 active pixel)\n- * @CIFISP_DPF_RB_FILTERSIZE_9x9: red and blue filter kernel size 9x9\n+ * @RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9: red and blue filter kernel size 9x9\n  *\t\t\t\t   (means 5x5 active pixel)\n  */\n-enum cifisp_dpf_rb_filtersize {\n-\tCIFISP_DPF_RB_FILTERSIZE_13x9,\n-\tCIFISP_DPF_RB_FILTERSIZE_9x9,\n+enum rkisp1_cif_isp_dpf_rb_filtersize {\n+\tRKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9,\n+\tRKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9,\n };\n \n /**\n- * enum cifisp_dpf_nll_scale_mode - dpf noise level scale mode\n- * @CIFISP_NLL_SCALE_LINEAR: use a linear scaling\n- * @CIFISP_NLL_SCALE_LOGARITHMIC: use a logarithmic scaling\n+ * enum rkisp1_cif_isp_dpf_nll_scale_mode - dpf noise level scale mode\n+ * @RKISP1_CIF_ISP_NLL_SCALE_LINEAR: use a linear scaling\n+ * @RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC: use a logarithmic scaling\n  */\n-enum cifisp_dpf_nll_scale_mode {\n-\tCIFISP_NLL_SCALE_LINEAR,\n-\tCIFISP_NLL_SCALE_LOGARITHMIC,\n+enum rkisp1_cif_isp_dpf_nll_scale_mode {\n+\tRKISP1_CIF_ISP_NLL_SCALE_LINEAR,\n+\tRKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC,\n };\n \n /**\n- * struct cifisp_dpf_nll - Noise level lookup\n+ * struct rkisp1_cif_isp_dpf_nll - Noise level lookup\n  *\n  * @coeff: Noise level Lookup coefficient\n- * @scale_mode: dpf noise level scale mode (from enum cifisp_dpf_nll_scale_mode)\n+ * @scale_mode: dpf noise level scale mode (from enum rkisp1_cif_isp_dpf_nll_scale_mode)\n  */\n-struct cifisp_dpf_nll {\n-\t__u16 coeff[CIFISP_DPF_MAX_NLF_COEFFS];\n+struct rkisp1_cif_isp_dpf_nll {\n+\t__u16 coeff[RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS];\n \t__u32 scale_mode;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_dpf_rb_flt - Red blue filter config\n+ * struct rkisp1_cif_isp_dpf_rb_flt - Red blue filter config\n  *\n  * @fltsize: The filter size for the red and blue pixels\n- *\t     (from enum cifisp_dpf_rb_filtersize)\n+ *\t     (from enum rkisp1_cif_isp_dpf_rb_filtersize)\n  * @spatial_coeff: Spatial weights\n  * @r_enable: enable filter processing for red pixels\n  * @b_enable: enable filter processing for blue pixels\n  */\n-struct cifisp_dpf_rb_flt {\n+struct rkisp1_cif_isp_dpf_rb_flt {\n \t__u32 fltsize;\n-\t__u8 spatial_coeff[CIFISP_DPF_MAX_SPATIAL_COEFFS];\n+\t__u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS];\n \t__u8 r_enable;\n \t__u8 b_enable;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_dpf_g_flt - Green filter Configuration\n+ * struct rkisp1_cif_isp_dpf_g_flt - Green filter Configuration\n  *\n  * @spatial_coeff: Spatial weights\n  * @gr_enable: enable filter processing for green pixels in green/red lines\n  * @gb_enable: enable filter processing for green pixels in green/blue lines\n  */\n-struct cifisp_dpf_g_flt {\n-\t__u8 spatial_coeff[CIFISP_DPF_MAX_SPATIAL_COEFFS];\n+struct rkisp1_cif_isp_dpf_g_flt {\n+\t__u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS];\n \t__u8 gr_enable;\n \t__u8 gb_enable;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_dpf_gain - Noise function Configuration\n+ * struct rkisp1_cif_isp_dpf_gain - Noise function Configuration\n  *\n- * @mode: dpf gain usage  (from enum cifisp_dpf_gain_usage)\n+ * @mode: dpf gain usage  (from enum rkisp1_cif_isp_dpf_gain_usage)\n  * @nf_r_gain: Noise function Gain that replaces the AWB gain for red pixels\n  * @nf_b_gain: Noise function Gain that replaces the AWB gain for blue pixels\n  * @nf_gr_gain: Noise function Gain that replaces the AWB gain\n@@ -588,44 +660,44 @@ struct cifisp_dpf_g_flt {\n  * @nf_gb_gain: Noise function Gain that replaces the AWB gain\n  *\t\tfor green pixels in a blue line\n  */\n-struct cifisp_dpf_gain {\n+struct rkisp1_cif_isp_dpf_gain {\n \t__u32 mode;\n \t__u16 nf_r_gain;\n \t__u16 nf_b_gain;\n \t__u16 nf_gr_gain;\n \t__u16 nf_gb_gain;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_dpf_config - Configuration used by De-noising pre-filter\n+ * struct rkisp1_cif_isp_dpf_config - Configuration used by De-noising pre-filter\n  *\n  * @gain: noise function gain\n  * @g_flt: green filter config\n  * @rb_flt: red blue filter config\n  * @nll: noise level lookup\n  */\n-struct cifisp_dpf_config {\n-\tstruct cifisp_dpf_gain gain;\n-\tstruct cifisp_dpf_g_flt g_flt;\n-\tstruct cifisp_dpf_rb_flt rb_flt;\n-\tstruct cifisp_dpf_nll nll;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_dpf_config {\n+\tstruct rkisp1_cif_isp_dpf_gain gain;\n+\tstruct rkisp1_cif_isp_dpf_g_flt g_flt;\n+\tstruct rkisp1_cif_isp_dpf_rb_flt rb_flt;\n+\tstruct rkisp1_cif_isp_dpf_nll nll;\n+};\n \n /**\n- * struct cifisp_dpf_strength_config - strength of the filter\n+ * struct rkisp1_cif_isp_dpf_strength_config - strength of the filter\n  *\n  * @r: filter strength of the RED filter\n  * @g: filter strength of the GREEN filter\n  * @b: filter strength of the BLUE filter\n  */\n-struct cifisp_dpf_strength_config {\n+struct rkisp1_cif_isp_dpf_strength_config {\n \t__u8 r;\n \t__u8 g;\n \t__u8 b;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_isp_other_cfg - Parameters for some blocks in rockchip isp1\n+ * struct rkisp1_cif_isp_isp_other_cfg - Parameters for some blocks in rockchip isp1\n  *\n  * @dpcc_config: Defect Pixel Cluster Correction config\n  * @bls_config: Black Level Subtraction config\n@@ -642,39 +714,39 @@ struct cifisp_dpf_strength_config {\n  * @cproc_config: color process config\n  * @ie_config: image effects config\n  */\n-struct cifisp_isp_other_cfg {\n-\tstruct cifisp_dpcc_config dpcc_config;\n-\tstruct cifisp_bls_config bls_config;\n-\tstruct cifisp_sdg_config sdg_config;\n-\tstruct cifisp_lsc_config lsc_config;\n-\tstruct cifisp_awb_gain_config awb_gain_config;\n-\tstruct cifisp_flt_config flt_config;\n-\tstruct cifisp_bdm_config bdm_config;\n-\tstruct cifisp_ctk_config ctk_config;\n-\tstruct cifisp_goc_config goc_config;\n-\tstruct cifisp_dpf_config dpf_config;\n-\tstruct cifisp_dpf_strength_config dpf_strength_config;\n-\tstruct cifisp_cproc_config cproc_config;\n-\tstruct cifisp_ie_config ie_config;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_isp_other_cfg {\n+\tstruct rkisp1_cif_isp_dpcc_config dpcc_config;\n+\tstruct rkisp1_cif_isp_bls_config bls_config;\n+\tstruct rkisp1_cif_isp_sdg_config sdg_config;\n+\tstruct rkisp1_cif_isp_lsc_config lsc_config;\n+\tstruct rkisp1_cif_isp_awb_gain_config awb_gain_config;\n+\tstruct rkisp1_cif_isp_flt_config flt_config;\n+\tstruct rkisp1_cif_isp_bdm_config bdm_config;\n+\tstruct rkisp1_cif_isp_ctk_config ctk_config;\n+\tstruct rkisp1_cif_isp_goc_config goc_config;\n+\tstruct rkisp1_cif_isp_dpf_config dpf_config;\n+\tstruct rkisp1_cif_isp_dpf_strength_config dpf_strength_config;\n+\tstruct rkisp1_cif_isp_cproc_config cproc_config;\n+\tstruct rkisp1_cif_isp_ie_config ie_config;\n+};\n \n /**\n- * struct cifisp_isp_meas_cfg - Rockchip ISP1 Measure Parameters\n+ * struct rkisp1_cif_isp_isp_meas_cfg - Rockchip ISP1 Measure Parameters\n  *\n  * @awb_meas_config: auto white balance config\n  * @hst_config: histogram config\n  * @aec_config: auto exposure config\n  * @afc_config: auto focus config\n  */\n-struct cifisp_isp_meas_cfg {\n-\tstruct cifisp_awb_meas_config awb_meas_config;\n-\tstruct cifisp_hst_config hst_config;\n-\tstruct cifisp_aec_config aec_config;\n-\tstruct cifisp_afc_config afc_config;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_isp_meas_cfg {\n+\tstruct rkisp1_cif_isp_awb_meas_config awb_meas_config;\n+\tstruct rkisp1_cif_isp_hst_config hst_config;\n+\tstruct rkisp1_cif_isp_aec_config aec_config;\n+\tstruct rkisp1_cif_isp_afc_config afc_config;\n+};\n \n /**\n- * struct rkisp1_isp_params_cfg - Rockchip ISP1 Input Parameters Meta Data\n+ * struct rkisp1_params_cfg - Rockchip ISP1 Input Parameters Meta Data\n  *\n  * @module_en_update: mask the enable bits of which module should be updated\n  * @module_ens: mask the enable value of each module, only update the module\n@@ -683,21 +755,21 @@ struct cifisp_isp_meas_cfg {\n  * @meas: measurement config\n  * @others: other config\n  */\n-struct rkisp1_isp_params_cfg {\n+struct rkisp1_params_cfg {\n \t__u32 module_en_update;\n \t__u32 module_ens;\n \t__u32 module_cfg_update;\n \n-\tstruct cifisp_isp_meas_cfg meas;\n-\tstruct cifisp_isp_other_cfg others;\n-} __attribute__ ((packed));\n+\tstruct rkisp1_cif_isp_isp_meas_cfg meas;\n+\tstruct rkisp1_cif_isp_isp_other_cfg others;\n+};\n \n /*---------- PART2: Measurement Statistics ------------*/\n \n /**\n- * struct cifisp_bls_meas_val - AWB measured values\n+ * struct rkisp1_cif_isp_awb_meas - AWB measured values\n  *\n- * @cnt: White pixel count, number of \"white pixels\" found during laster\n+ * @cnt: White pixel count, number of \"white pixels\" found during last\n  *\t measurement\n  * @mean_y_or_g: Mean value of Y within window and frames,\n  *\t\t Green if RGB is selected.\n@@ -706,111 +778,111 @@ struct rkisp1_isp_params_cfg {\n  * @mean_cr_or_r: Mean value of Cr within window and frames,\n  *\t\t  Red if RGB is selected.\n  */\n-struct cifisp_awb_meas {\n+struct rkisp1_cif_isp_awb_meas {\n \t__u32 cnt;\n \t__u8 mean_y_or_g;\n \t__u8 mean_cb_or_b;\n \t__u8 mean_cr_or_r;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_awb_stat - statistics automatic white balance data\n+ * struct rkisp1_cif_isp_awb_stat - statistics automatic white balance data\n  *\n  * @awb_mean: Mean measured data\n  */\n-struct cifisp_awb_stat {\n-\tstruct cifisp_awb_meas awb_mean[CIFISP_AWB_MAX_GRID];\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_awb_stat {\n+\tstruct rkisp1_cif_isp_awb_meas awb_mean[RKISP1_CIF_ISP_AWB_MAX_GRID];\n+};\n \n /**\n- * struct cifisp_bls_meas_val - BLS measured values\n+ * struct rkisp1_cif_isp_bls_meas_val - BLS measured values\n  *\n  * @meas_r: Mean measured value for Bayer pattern R\n  * @meas_gr: Mean measured value for Bayer pattern Gr\n  * @meas_gb: Mean measured value for Bayer pattern Gb\n  * @meas_b: Mean measured value for Bayer pattern B\n  */\n-struct cifisp_bls_meas_val {\n+struct rkisp1_cif_isp_bls_meas_val {\n \t__u16 meas_r;\n \t__u16 meas_gr;\n \t__u16 meas_gb;\n \t__u16 meas_b;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_ae_stat - statistics auto exposure data\n+ * struct rkisp1_cif_isp_ae_stat - statistics auto exposure data\n  *\n  * @exp_mean: Mean luminance value of block xx\n  * @bls_val:  BLS measured values\n  *\n  * Image is divided into 5x5 blocks.\n  */\n-struct cifisp_ae_stat {\n-\t__u8 exp_mean[CIFISP_AE_MEAN_MAX];\n-\tstruct cifisp_bls_meas_val bls_val;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_ae_stat {\n+\t__u8 exp_mean[RKISP1_CIF_ISP_AE_MEAN_MAX];\n+\tstruct rkisp1_cif_isp_bls_meas_val bls_val;\n+};\n \n /**\n- * struct cifisp_af_meas_val - AF measured values\n+ * struct rkisp1_cif_isp_af_meas_val - AF measured values\n  *\n- * @sum: sharpness, refer to REF_01 for definition\n- * @lum: luminance, refer to REF_01 for definition\n+ * @sum: sharpness value\n+ * @lum: luminance value\n  */\n-struct cifisp_af_meas_val {\n+struct rkisp1_cif_isp_af_meas_val {\n \t__u32 sum;\n \t__u32 lum;\n-} __attribute__ ((packed));\n+};\n \n /**\n- * struct cifisp_af_stat - statistics auto focus data\n+ * struct rkisp1_cif_isp_af_stat - statistics auto focus data\n  *\n  * @window: AF measured value of window x\n  *\n  * The module measures the sharpness in 3 windows of selectable size via\n  * register settings(ISP_AFM_*_A/B/C)\n  */\n-struct cifisp_af_stat {\n-\tstruct cifisp_af_meas_val window[CIFISP_AFM_MAX_WINDOWS];\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_af_stat {\n+\tstruct rkisp1_cif_isp_af_meas_val window[RKISP1_CIF_ISP_AFM_MAX_WINDOWS];\n+};\n \n /**\n- * struct cifisp_hist_stat - statistics histogram data\n+ * struct rkisp1_cif_isp_hist_stat - statistics histogram data\n  *\n  * @hist_bins: measured bin counters\n  *\n  * Measurement window divided into 25 sub-windows, set\n  * with ISP_HIST_XXX\n  */\n-struct cifisp_hist_stat {\n-\t__u16 hist_bins[CIFISP_HIST_BIN_N_MAX];\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_hist_stat {\n+\t__u16 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];\n+};\n \n /**\n- * struct rkisp1_stat_buffer - Rockchip ISP1 Statistics Data\n+ * struct rkisp1_cif_isp_stat - Rockchip ISP1 Statistics Data\n  *\n- * @cifisp_awb_stat: statistics data for automatic white balance\n- * @cifisp_ae_stat: statistics data for auto exposure\n- * @cifisp_af_stat: statistics data for auto focus\n- * @cifisp_hist_stat: statistics histogram data\n+ * @awb: statistics data for automatic white balance\n+ * @ae: statistics data for auto exposure\n+ * @af: statistics data for auto focus\n+ * @hist: statistics histogram data\n  */\n-struct cifisp_stat {\n-\tstruct cifisp_awb_stat awb;\n-\tstruct cifisp_ae_stat ae;\n-\tstruct cifisp_af_stat af;\n-\tstruct cifisp_hist_stat hist;\n-} __attribute__ ((packed));\n+struct rkisp1_cif_isp_stat {\n+\tstruct rkisp1_cif_isp_awb_stat awb;\n+\tstruct rkisp1_cif_isp_ae_stat ae;\n+\tstruct rkisp1_cif_isp_af_stat af;\n+\tstruct rkisp1_cif_isp_hist_stat hist;\n+};\n \n /**\n  * struct rkisp1_stat_buffer - Rockchip ISP1 Statistics Meta Data\n  *\n- * @meas_type: measurement types (CIFISP_STAT_ definitions)\n+ * @meas_type: measurement types (RKISP1_CIF_ISP_STAT_* definitions)\n  * @frame_id: frame ID for sync\n  * @params: statistics data\n  */\n struct rkisp1_stat_buffer {\n \t__u32 meas_type;\n \t__u32 frame_id;\n-\tstruct cifisp_stat params;\n-} __attribute__ ((packed));\n+\tstruct rkisp1_cif_isp_stat params;\n+};\n \n #endif /* _RKISP1_CONFIG_H */\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 0f5f8a8b436e60ff..07d7f1b2ddd81bbd 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -50,7 +50,7 @@ public:\n \tvoid processEvent(const IPAOperationData &event) override;\n \n private:\n-\tvoid queueRequest(unsigned int frame, rkisp1_isp_params_cfg *params,\n+\tvoid queueRequest(unsigned int frame, rkisp1_params_cfg *params,\n \t\t\t  const ControlList &controls);\n \tvoid updateStatistics(unsigned int frame,\n \t\t\t      const rkisp1_stat_buffer *stats);\n@@ -176,8 +176,8 @@ void IPARkISP1::processEvent(const IPAOperationData &event)\n \t\tunsigned int frame = event.data[0];\n \t\tunsigned int bufferId = event.data[1];\n \n-\t\trkisp1_isp_params_cfg *params =\n-\t\t\tstatic_cast<rkisp1_isp_params_cfg *>(buffersMemory_[bufferId]);\n+\t\trkisp1_params_cfg *params =\n+\t\t\tstatic_cast<rkisp1_params_cfg *>(buffersMemory_[bufferId]);\n \n \t\tqueueRequest(frame, params, event.controls[0]);\n \t\tbreak;\n@@ -188,7 +188,7 @@ void IPARkISP1::processEvent(const IPAOperationData &event)\n \t}\n }\n \n-void IPARkISP1::queueRequest(unsigned int frame, rkisp1_isp_params_cfg *params,\n+void IPARkISP1::queueRequest(unsigned int frame, rkisp1_params_cfg *params,\n \t\t\t     const ControlList &controls)\n {\n \t/* Prepare parameters buffer. */\n@@ -198,9 +198,9 @@ void IPARkISP1::queueRequest(unsigned int frame, rkisp1_isp_params_cfg *params,\n \tif (controls.contains(controls::AeEnable)) {\n \t\tautoExposure_ = controls.get(controls::AeEnable);\n \t\tif (autoExposure_)\n-\t\t\tparams->module_ens = CIFISP_MODULE_AEC;\n+\t\t\tparams->module_ens = RKISP1_CIF_ISP_MODULE_AEC;\n \n-\t\tparams->module_en_update = CIFISP_MODULE_AEC;\n+\t\tparams->module_en_update = RKISP1_CIF_ISP_MODULE_AEC;\n \t}\n \n \tIPAOperationData op;\n@@ -212,17 +212,17 @@ void IPARkISP1::queueRequest(unsigned int frame, rkisp1_isp_params_cfg *params,\n void IPARkISP1::updateStatistics(unsigned int frame,\n \t\t\t\t const rkisp1_stat_buffer *stats)\n {\n-\tconst cifisp_stat *params = &stats->params;\n+\tconst rkisp1_cif_isp_stat *params = &stats->params;\n \tunsigned int aeState = 0;\n \n-\tif (stats->meas_type & CIFISP_STAT_AUTOEXP) {\n-\t\tconst cifisp_ae_stat *ae = &params->ae;\n+\tif (stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP) {\n+\t\tconst rkisp1_cif_isp_ae_stat *ae = &params->ae;\n \n \t\tconst unsigned int target = 60;\n \n \t\tunsigned int value = 0;\n \t\tunsigned int num = 0;\n-\t\tfor (int i = 0; i < CIFISP_AE_MEAN_MAX; i++) {\n+\t\tfor (int i = 0; i < RKISP1_CIF_ISP_AE_MEAN_MAX; i++) {\n \t\t\tif (ae->exp_mean[i] <= 15)\n \t\t\t\tcontinue;\n \n",
    "prefixes": [
        "libcamera-devel",
        "2/2"
    ]
}