[{"id":32605,"web_url":"https://patchwork.libcamera.org/comment/32605/","msgid":"<20241206181144.GC17570@pendragon.ideasonboard.com>","date":"2024-12-06T18:11:44","subject":"Re: [PATCH v4 02/11] include: linux: Add mali-c55-config.h","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Nov 15, 2024 at 12:25:31PM +0000, Daniel Scally wrote:\n> Add the header file describing the Mali C55's 3A statistics and\n> parameters structures so that they can be used by the new IPA module.\n> \n> The header has been taken from the v6 of the patchset for the Mali\n> C55 ISP driver submitted to linux-media, found at the link below:\n> \n> https://lore.kernel.org/linux-media/20240709132906.3198927-1-dan.scally@ideasonboard.com/\n> \n> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Acked-by: Nayden Kanchev  <nayden.kanchev@arm.com>\n> Co-developed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n\nAcked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> Changes in v4:\n> \n> \t- None\n> \n> Changes in v3:\n> \n> \t- None\n> \n>  include/linux/mali-c55-config.h | 909 ++++++++++++++++++++++++++++++++\n>  1 file changed, 909 insertions(+)\n>  create mode 100644 include/linux/mali-c55-config.h\n> \n> diff --git a/include/linux/mali-c55-config.h b/include/linux/mali-c55-config.h\n> new file mode 100644\n> index 00000000..b3141559\n> --- /dev/null\n> +++ b/include/linux/mali-c55-config.h\n> @@ -0,0 +1,909 @@\n> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> +/*\n> + * ARM Mali-C55 ISP Driver - Userspace API\n> + *\n> + * Copyright (C) 2023 Ideas on Board Oy\n> + */\n> +\n> +#ifndef __UAPI_MALI_C55_CONFIG_H\n> +#define __UAPI_MALI_C55_CONFIG_H\n> +\n> +#include <linux/types.h>\n> +\n> +/*\n> + * Frames are split into zones of almost equal width and height - a zone is a\n> + * rectangular tile of a frame. The metering blocks within the ISP collect\n> + * aggregated statistics per zone. A maximum of 15x15 zones can be configured,\n> + * and so the statistics buffer within the hardware is sized to accommodate\n> + * that.\n> + *\n> + * The utilised number of zones is runtime configurable.\n> + */\n> +#define MALI_C55_MAX_ZONES\t(15 * 15)\n> +\n> +/**\n> + * struct mali_c55_ae_1024bin_hist - Auto Exposure 1024-bin histogram statistics\n> + *\n> + * @bins:\t1024 element array of 16-bit pixel counts.\n> + *\n> + * The 1024-bin histogram module collects image-global but zone-weighted\n> + * intensity distributions of pixels in fixed-width bins. The modules can be\n> + * configured into different \"plane modes\" which affect the contents of the\n> + * collected statistics. In plane mode 0, pixel intensities are taken regardless\n> + * of colour plane into a single 1024-bin histogram with a bin width of 4. In\n> + * plane mode 1, four 256-bin histograms with a bin width of 16 are collected -\n> + * one for each CFA colour plane. In plane modes 4, 5, 6 and 7 two 512-bin\n> + * histograms with a bin width of 8 are collected - in each mode one of the\n> + * colour planes is collected into the first histogram and all the others are\n> + * combined into the second. The histograms are stored consecutively in the bins\n> + * array.\n> + *\n> + * The 16-bit pixel counts are stored as a 4-bit exponent in the most\n> + * significant bits followed by a 12-bit mantissa. Conversion to a usable\n> + * format can be done according to the following pseudo-code::\n> + *\n> + *\tif (e == 0) {\n> + *\t\tbin = m * 2;\n> + *\t} else {\n> + *\t\tbin = (m + 4096) * 2^e\n> + *\t}\n> + *\n> + * where\n> + *\te is the exponent value in range 0..15\n> + *\tm is the mantissa value in range 0..4095\n> + *\n> + * The pixels used in calculating the statistics can be masked using three\n> + * methods:\n> + *\n> + * 1. Pixels can be skipped in X and Y directions independently.\n> + * 2. Minimum/Maximum intensities can be configured\n> + * 3. Zones can be differentially weighted, including 0 weighted to mask them\n> + *\n> + * The data for this histogram can be collected from different tap points in the\n> + * ISP depending on configuration - after the white balance or digital gain\n> + * blocks, or immediately after the input crossbar.\n> + */\n> +struct mali_c55_ae_1024bin_hist {\n> +\t__u16 bins[1024];\n> +} __attribute__((packed));\n> +\n> +/**\n> + * struct mali_c55_ae_5bin_hist - Auto Exposure 5-bin histogram statistics\n> + *\n> + * @hist0:\t16-bit normalised pixel count for the 0th intensity bin\n> + * @hist1:\t16-bit normalised pixel count for the 1st intensity bin\n> + * @hist3:\t16-bit normalised pixel count for the 3rd intensity bin\n> + * @hist4:\t16-bit normalised pixel count for the 4th intensity bin\n> + *\n> + * The ISP generates a 5-bin histogram of normalised pixel counts within bins of\n> + * pixel intensity for each of 225 possible zones within a frame. The centre bin\n> + * of the histogram for each zone is not available from the hardware and must be\n> + * calculated by subtracting the values of hist0, hist1, hist3 and hist4 from\n> + * 0xffff as in the following equation:\n> + *\n> + *\thist2 = 0xffff - (hist0 + hist1 + hist3 + hist4)\n> + */\n> +struct mali_c55_ae_5bin_hist {\n> +\t__u16 hist0;\n> +\t__u16 hist1;\n> +\t__u16 hist3;\n> +\t__u16 hist4;\n> +} __attribute__((packed));\n> +\n> +/**\n> + * struct mali_c55_awb_average_ratios - Auto White Balance colour ratios\n> + *\n> + * @avg_rg_gr:\tAverage R/G or G/R ratio in Q4.8 format.\n> + * @avg_bg_br:\tAverage B/G or B/R ratio in Q4.8 format.\n> + * @num_pixels:\tThe number of pixels used in the AWB calculation\n> + *\n> + * The ISP calculates and collects average colour ratios for each zone in an\n> + * image and stores them in Q4.8 format (the lowest 8 bits are fractional, with\n> + * bits [11:8] representing the integer). The exact ratios collected (either\n> + * R/G, B/G or G/R, B/R) are configurable through the parameters buffer. The\n> + * value of the 4 high bits is undefined.\n> + */\n> +struct mali_c55_awb_average_ratios {\n> +\t__u16 avg_rg_gr;\n> +\t__u16 avg_bg_br;\n> +\t__u32 num_pixels;\n> +} __attribute__((packed));\n> +\n> +/**\n> + * struct mali_c55_af_statistics - Auto Focus edge and intensity statistics\n> + *\n> + * @intensity_stats:\tPacked mantissa and exponent value for pixel intensity\n> + * @edge_stats:\t\tPacked mantissa and exponent values for edge intensity\n> + *\n> + * The ISP collects the squared sum of pixel intensities for each zone within a\n> + * configurable Region of Interest on the frame. Additionally, the same data are\n> + * collected after being passed through a bandpass filter which removes high and\n> + * low frequency components - these are referred to as the edge statistics.\n> + *\n> + * The intensity and edge statistics for a zone can be used to calculate the\n> + * contrast information for a zone\n> + *\n> + *\tC = E2 / I2\n> + *\n> + * Where I2 is the intensity statistic for a zone and E2 is the edge statistic\n> + * for that zone. Optimum focus is reached when C is at its maximum.\n> + *\n> + * The intensity and edge statistics are stored packed into a non-standard 16\n> + * bit floating point format, where the 7 most significant bits represent the\n> + * exponent and the 9 least significant bits the mantissa. This format can be\n> + * unpacked with the following pseudocode::\n> + *\n> + *\tif (e == 0) {\n> + *\t\tx = m;\n> + *\t} else {\n> + *\t\tx = 2^e-1 * (m + 2^9)\n> + *\t}\n> + *\n> + * where\n> + *\te is the exponent value in range 0..127\n> + *\tm is the mantissa value in range 0..511\n> + */\n> +struct mali_c55_af_statistics {\n> +\t__u16 intensity_stats;\n> +\t__u16 edge_stats;\n> +} __attribute__((packed));\n> +\n> +/**\n> + * struct mali_c55_stats_buffer - 3A statistics for the mali-c55 ISP\n> + *\n> + * @ae_1024bin_hist:\t\t1024-bin frame-global pixel intensity histogram\n> + * @iridix_1024bin_hist:\tPost-Iridix block 1024-bin histogram\n> + * @ae_5bin_hists:\t\t5-bin pixel intensity histograms for AEC\n> + * @reserved1:\t\t\tUndefined buffer space\n> + * @awb_ratios:\t\t\tColor balance ratios for Auto White Balance\n> + * @reserved2:\t\t\tUndefined buffer space\n> + * @af_statistics:\t\tPixel intensity statistics for Auto Focus\n> + * @reserved3:\t\t\tUndefined buffer space\n> + *\n> + * This struct describes the metering statistics space in the Mali-C55 ISP's\n> + * hardware in its entirety. The space between each defined area is marked as\n> + * \"unknown\" and may not be 0, but should not be used. The @ae_5bin_hists,\n> + * @awb_ratios and @af_statistics members are arrays of statistics per-zone.\n> + * The zones are arranged in the array in raster order starting from the top\n> + * left corner of the image.\n> + */\n> +\n> +struct mali_c55_stats_buffer {\n> +\tstruct mali_c55_ae_1024bin_hist ae_1024bin_hist;\n> +\tstruct mali_c55_ae_1024bin_hist iridix_1024bin_hist;\n> +\tstruct mali_c55_ae_5bin_hist ae_5bin_hists[MALI_C55_MAX_ZONES];\n> +\t__u32 reserved1[14];\n> +\tstruct mali_c55_awb_average_ratios awb_ratios[MALI_C55_MAX_ZONES];\n> +\t__u32 reserved2[14];\n> +\tstruct mali_c55_af_statistics af_statistics[MALI_C55_MAX_ZONES];\n> +\t__u32 reserved3[15];\n> +} __attribute__((packed));\n> +\n> +/**\n> + * enum mali_c55_param_buffer_version - Mali-C55 parameters block versioning\n> + *\n> + * @MALI_C55_PARAM_BUFFER_V1: First version of Mali-C55 parameters block\n> + */\n> +enum mali_c55_param_buffer_version {\n> +\tMALI_C55_PARAM_BUFFER_V1,\n> +};\n> +\n> +/**\n> + * enum mali_c55_param_block_type - Enumeration of Mali-C55 parameter blocks\n> + *\n> + * This enumeration defines the types of Mali-C55 parameters block. Each block\n> + * configures a specific processing block of the Mali-C55 ISP. The block\n> + * type allows the driver to correctly interpret the parameters block data.\n> + *\n> + * It is the responsibility of userspace to correctly set the type of each\n> + * parameters block.\n> + *\n> + * @MALI_C55_PARAM_BLOCK_SENSOR_OFFS: Sensor pre-shading black level offset\n> + * @MALI_C55_PARAM_BLOCK_AEXP_HIST: Auto-exposure 1024-bin histogram\n> + *\t\t\t\t    configuration\n> + * @MALI_C55_PARAM_BLOCK_AEXP_IHIST: Post-Iridix auto-exposure 1024-bin\n> + *\t\t\t\t     histogram configuration\n> + * @MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS: Auto-exposure 1024-bin histogram\n> + *\t\t\t\t\t    weighting\n> + * @MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS: Post-Iridix auto-exposure 1024-bin\n> + *\t\t\t\t\t     histogram weighting\n> + * @MALI_C55_PARAM_BLOCK_DIGITAL_GAIN: Digital gain\n> + * @MALI_C55_PARAM_BLOCK_AWB_GAINS: Auto-white balance gains\n> + * @MALI_C55_PARAM_BLOCK_AWB_CONFIG: Auto-white balance statistics config\n> + * @MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP: Auto-white balance gains for AEXP-0 tap\n> + * @MALI_C55_PARAM_MESH_SHADING_CONFIG : Mesh shading tables configuration\n> + * @MALI_C55_PARAM_MESH_SHADING_SELECTION: Mesh shading table selection\n> + */\n> +enum mali_c55_param_block_type {\n> +\tMALI_C55_PARAM_BLOCK_SENSOR_OFFS,\n> +\tMALI_C55_PARAM_BLOCK_AEXP_HIST,\n> +\tMALI_C55_PARAM_BLOCK_AEXP_IHIST,\n> +\tMALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS,\n> +\tMALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS,\n> +\tMALI_C55_PARAM_BLOCK_DIGITAL_GAIN,\n> +\tMALI_C55_PARAM_BLOCK_AWB_GAINS,\n> +\tMALI_C55_PARAM_BLOCK_AWB_CONFIG,\n> +\tMALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP,\n> +\tMALI_C55_PARAM_MESH_SHADING_CONFIG,\n> +\tMALI_C55_PARAM_MESH_SHADING_SELECTION,\n> +};\n> +\n> +#define MALI_C55_PARAM_BLOCK_FL_NONE\t\t\t0\n> +#define MALI_C55_PARAM_BLOCK_FL_DISABLED\t\tBIT(0)\n> +\n> +/**\n> + * struct mali_c55_params_block_header - Mali-C55 parameter block header\n> + *\n> + * This structure represents the common part of all the ISP configuration\n> + * blocks. Each parameters block embeds an instance of this structure type\n> + * as its first member, followed by the block-specific configuration data. The\n> + * driver inspects this common header to discern the block type and its size and\n> + * properly handle the block content by casting it to the correct block-specific\n> + * type.\n> + *\n> + * The @type field is one of the values enumerated by\n> + * :c:type:`mali_c55_param_block_type` and specifies how the data should be\n> + * interpreted by the driver. The @size field specifies the size of the\n> + * parameters block and is used by the driver for validation purposes. The\n> + * @flags field holds a bitmask of per-block flags MALI_C55_PARAM_BLOCK_FL_*.\n> + *\n> + * If userspace wants to disable an ISP block the\n> + * MALI_C55_PARAM_BLOCK_FL_DISABLED bit should be set in the @flags field. In\n> + * that case userspace may optionally omit the remainder of the configuration\n> + * block, which will in any case be ignored by the driver. If a new\n> + * configuration of an ISP block has to be applied userspace shall fully\n> + * populate the ISP block and omit setting the MALI_C55_PARAM_BLOCK_FL_DISABLED\n> + * bit in the @flags field.\n> + *\n> + * Userspace is responsible for correctly populating the parameters block header\n> + * fields (@type, @flags and @size) and correctly populate the block-specific\n> + * parameters.\n> + *\n> + * For example:\n> + *\n> + * .. code-block:: c\n> + *\n> + *\tvoid populate_sensor_offs(struct mali_c55_params_block_header *block) {\n> + *\t\tblock->type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;\n> + *\t\tblock->enabled = MALI_C55_PARAM_BLOCK_FL_NONE;\n> + *\t\tblock->size = sizeof(struct mali_c55_params_sensor_off_preshading);\n> + *\n> + *\t\tstruct mali_c55_params_sensor_off_preshading *sensor_offs =\n> + *\t\t\t(struct mali_c55_params_sensor_off_preshading *)block;\n> + *\n> + *\t\tsensor_offs->chan00 = offset00;\n> + *\t\tsensor_offs->chan01 = offset01;\n> + *\t\tsensor_offs->chan10 = offset10;\n> + *\t\tsensor_offs->chan11 = offset11;\n> + *\t}\n> + *\n> + * @type: The parameters block type from :c:type:`mali_c55_param_block_type`\n> + * @flags: Bitmask of block flags\n> + * @size: Size (in bytes) of the parameters block\n> + */\n> +struct mali_c55_params_block_header {\n> +\t__u16 type;\n> +\t__u16 flags;\n> +\t__u32 size;\n> +} __attribute__((aligned(8)));\n> +\n> +/**\n> + * struct mali_c55_params_sensor_off_preshading - offset subtraction for each\n> + *\t\t\t\t\t\t  color channel\n> + *\n> + * Provides removal of the sensor black level from the sensor data. Separate\n> + * offsets are provided for each of the four Bayer component color channels\n> + * which are defaulted to R, Gr, Gb, B.\n> + *\n> + * header.type should be set to MALI_C55_PARAM_BLOCK_SENSOR_OFFS from\n> + * :c:type:`mali_c55_param_block_type` for this block.\n> + *\n> + * @header: The Mali-C55 parameters block header\n> + * @chan00: Offset for color channel 00 (default: R)\n> + * @chan01: Offset for color channel 01 (default: Gr)\n> + * @chan10: Offset for color channel 10 (default: Gb)\n> + * @chan11: Offset for color channel 11 (default: B)\n> + */\n> +struct mali_c55_params_sensor_off_preshading {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u32 chan00;\n> +\t__u32 chan01;\n> +\t__u32 chan10;\n> +\t__u32 chan11;\n> +};\n> +\n> +/**\n> + * enum mali_c55_aexp_hist_tap_points - Tap points for the AEXP histogram\n> + * @MALI_C55_AEXP_HIST_TAP_WB: After static white balance\n> + * @MALI_C55_AEXP_HIST_TAP_FS: After WDR Frame Stitch\n> + * @MALI_C55_AEXP_HIST_TAP_TPG: After the test pattern generator\n> + */\n> +enum mali_c55_aexp_hist_tap_points {\n> +\tMALI_C55_AEXP_HIST_TAP_WB = 0,\n> +\tMALI_C55_AEXP_HIST_TAP_FS,\n> +\tMALI_C55_AEXP_HIST_TAP_TPG,\n> +};\n> +\n> +/**\n> + * enum mali_c55_aexp_skip_x - Horizontal pixel skipping\n> + * @MALI_C55_AEXP_SKIP_X_EVERY_2ND: Collect every 2nd pixel horizontally\n> + * @MALI_C55_AEXP_SKIP_X_EVERY_3RD: Collect every 3rd pixel horizontally\n> + * @MALI_C55_AEXP_SKIP_X_EVERY_4TH: Collect every 4th pixel horizontally\n> + * @MALI_C55_AEXP_SKIP_X_EVERY_5TH: Collect every 5th pixel horizontally\n> + * @MALI_C55_AEXP_SKIP_X_EVERY_8TH: Collect every 8th pixel horizontally\n> + * @MALI_C55_AEXP_SKIP_X_EVERY_9TH: Collect every 9th pixel horizontally\n> + */\n> +enum mali_c55_aexp_skip_x {\n> +\tMALI_C55_AEXP_SKIP_X_EVERY_2ND,\n> +\tMALI_C55_AEXP_SKIP_X_EVERY_3RD,\n> +\tMALI_C55_AEXP_SKIP_X_EVERY_4TH,\n> +\tMALI_C55_AEXP_SKIP_X_EVERY_5TH,\n> +\tMALI_C55_AEXP_SKIP_X_EVERY_8TH,\n> +\tMALI_C55_AEXP_SKIP_X_EVERY_9TH\n> +};\n> +\n> +/**\n> + * enum mali_c55_aexp_skip_y - Vertical pixel skipping\n> + * @MALI_C55_AEXP_SKIP_Y_ALL: Collect every single pixel vertically\n> + * @MALI_C55_AEXP_SKIP_Y_EVERY_2ND: Collect every 2nd pixel vertically\n> + * @MALI_C55_AEXP_SKIP_Y_EVERY_3RD: Collect every 3rd pixel vertically\n> + * @MALI_C55_AEXP_SKIP_Y_EVERY_4TH: Collect every 4th pixel vertically\n> + * @MALI_C55_AEXP_SKIP_Y_EVERY_5TH: Collect every 5th pixel vertically\n> + * @MALI_C55_AEXP_SKIP_Y_EVERY_8TH: Collect every 8th pixel vertically\n> + * @MALI_C55_AEXP_SKIP_Y_EVERY_9TH: Collect every 9th pixel vertically\n> + */\n> +enum mali_c55_aexp_skip_y {\n> +\tMALI_C55_AEXP_SKIP_Y_ALL,\n> +\tMALI_C55_AEXP_SKIP_Y_EVERY_2ND,\n> +\tMALI_C55_AEXP_SKIP_Y_EVERY_3RD,\n> +\tMALI_C55_AEXP_SKIP_Y_EVERY_4TH,\n> +\tMALI_C55_AEXP_SKIP_Y_EVERY_5TH,\n> +\tMALI_C55_AEXP_SKIP_Y_EVERY_8TH,\n> +\tMALI_C55_AEXP_SKIP_Y_EVERY_9TH\n> +};\n> +\n> +/**\n> + * enum mali_c55_aexp_row_column_offset - Start from the first or second row or\n> + *\t\t\t\t\t  column\n> + * @MALI_C55_AEXP_FIRST_ROW_OR_COL:\tStart from the first row / column\n> + * @MALI_C55_AEXP_SECOND_ROW_OR_COL:\tStart from the second row / column\n> + */\n> +enum mali_c55_aexp_row_column_offset {\n> +\tMALI_C55_AEXP_FIRST_ROW_OR_COL = 1,\n> +\tMALI_C55_AEXP_SECOND_ROW_OR_COL = 2,\n> +};\n> +\n> +/**\n> + * enum mali_c55_aexp_hist_plane_mode - Mode for the AEXP Histograms\n> + * @MALI_C55_AEXP_HIST_COMBINED: All color planes in one 1024-bin histogram\n> + * @MALI_C55_AEXP_HIST_SEPARATE: Each color plane in one 256-bin histogram with a bin width of 16\n> + * @MALI_C55_AEXP_HIST_FOCUS_00: Top left plane in the first bank, rest in second bank\n> + * @MALI_C55_AEXP_HIST_FOCUS_01: Top right plane in the first bank, rest in second bank\n> + * @MALI_C55_AEXP_HIST_FOCUS_10: Bottom left plane in the first bank, rest in second bank\n> + * @MALI_C55_AEXP_HIST_FOCUS_11: Bottom right plane in the first bank, rest in second bank\n> + *\n> + * In the \"focus\" modes statistics are collected into two 512-bin histograms\n> + * with a bin width of 8. One colour plane is in the first histogram with the\n> + * remainder combined into the second. The four options represent which of the\n> + * four positions in a bayer pattern are the focused plane.\n> + */\n> +enum mali_c55_aexp_hist_plane_mode {\n> +\tMALI_C55_AEXP_HIST_COMBINED = 0,\n> +\tMALI_C55_AEXP_HIST_SEPARATE = 1,\n> +\tMALI_C55_AEXP_HIST_FOCUS_00 = 4,\n> +\tMALI_C55_AEXP_HIST_FOCUS_01 = 5,\n> +\tMALI_C55_AEXP_HIST_FOCUS_10 = 6,\n> +\tMALI_C55_AEXP_HIST_FOCUS_11 = 7,\n> +};\n> +\n> +/**\n> + * struct mali_c55_params_aexp_hist - configuration for AEXP metering hists\n> + *\n> + * This struct allows users to configure the 1024-bin AEXP histograms. Broadly\n> + * speaking the parameters allow you to mask particular regions of the image and\n> + * to select different kinds of histogram.\n> + *\n> + * The skip_x, offset_x, skip_y and offset_y fields allow users to ignore or\n> + * mask pixels in the frame by their position relative to the top left pixel.\n> + * First, the skip_y, offset_x and offset_y fields define which of the pixels\n> + * within each 2x2 region will be counted in the statistics.\n> + *\n> + * If skip_y == 0 then two pixels from each covered region will be counted. If\n> + * both offset_x and offset_y are zero, then the two left-most pixels in each\n> + * 2x2 pixel region will be counted. Setting offset_x = 1 will discount the top\n> + * left pixel and count the top right pixel. Setting offset_y = 1 will discount\n> + * the bottom left pixel and count the bottom right pixel.\n> + *\n> + * If skip_y != 0 then only a single pixel from each region covered by the\n> + * pattern will be counted. In this case offset_x controls whether the pixel\n> + * that's counted is in the left (if offset_x == 0) or right (if offset_x == 1)\n> + * column and offset_y controls whether the pixel that's counted is in the top\n> + * (if offset_y == 0) or bottom (if offset_y == 1) row.\n> + *\n> + * The skip_x and skip_y fields control how the 2x2 pixel region is repeated\n> + * across the image data. The first instance of the region is always in the top\n> + * left of the image data. The skip_x field controls how many pixels are ignored\n> + * in the x direction before the pixel masking region is repeated. The skip_y\n> + * field controls how many pixels are ignored in the y direction before the\n> + * pixel masking region is repeated.\n> + *\n> + * These fields can be used to reduce the number of pixels counted for the\n> + * statistics, but it's important to be careful to configure them correctly.\n> + * Some combinations of values will result in colour components from the input\n> + * data being ignored entirely, for example in the following configuration:\n> + *\n> + * skip_x = 0\n> + * offset_x = 0\n> + * skip_y = 0\n> + * offset_y = 0\n> + *\n> + * Only the R and Gb components of RGGB data that was input would be collected.\n> + * Similarly in the following configuration:\n> + *\n> + * skip_x = 0\n> + * offset_x = 0\n> + * skip_y = 1\n> + * offset_y = 1\n> + *\n> + * Only the Gb component of RGGB data that was input would be collected. To\n> + * correct things such that all 4 colour components were included it would be\n> + * necessary to set the skip_x and skip_y fields in a way that resulted in all\n> + * four colour components being collected:\n> + *\n> + * skip_x = 1\n> + * offset_x = 0\n> + * skip_y = 1\n> + * offset_y = 1\n> + *\n> + * header.type should be set to one of either MALI_C55_PARAM_BLOCK_AEXP_HIST or\n> + * MALI_C55_PARAM_BLOCK_AEXP_IHIST from :c:type:`mali_c55_param_block_type`.\n> + *\n> + * @header:\t\tThe Mali-C55 parameters block header\n> + * @skip_x:\t\tHorizontal decimation. See enum mali_c55_aexp_skip_x\n> + * @offset_x:\t\tSkip the first column, or not. See enum mali_c55_aexp_row_column_offset\n> + * @skip_y:\t\tVertical decimation. See enum mali_c55_aexp_skip_y\n> + * @offset_y:\t\tSkip the first row, or not. See enum mali_c55_aexp_row_column_offset\n> + * @scale_bottom:\tScale pixels in bottom half of intensity range: 0=1x ,1=2x, 2=4x, 4=8x, 4=16x\n> + * @scale_top:\t\tscale pixels in top half of intensity range: 0=1x ,1=2x, 2=4x, 4=8x, 4=16x\n> + * @plane_mode:\t\tPlane separation mode. See enum mali_c55_aexp_hist_plane_mode\n> + * @tap_point:\t\tTap point for histogram from enum mali_c55_aexp_hist_tap_points.\n> + *\t\t\tThis parameter is unused for the post-Iridix Histogram\n> + */\n> +struct mali_c55_params_aexp_hist {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u8 skip_x;\n> +\t__u8 offset_x;\n> +\t__u8 skip_y;\n> +\t__u8 offset_y;\n> +\t__u8 scale_bottom;\n> +\t__u8 scale_top;\n> +\t__u8 plane_mode;\n> +\t__u8 tap_point;\n> +};\n> +\n> +/**\n> + * struct mali_c55_params_aexp_weights - Array of weights for AEXP metering\n> + *\n> + * This struct allows users to configure the weighting for both of the 1024-bin\n> + * AEXP histograms. The pixel data collected for each zone is multiplied by the\n> + * corresponding weight from this array, which may be zero if the intention is\n> + * to mask off the zone entirely.\n> + *\n> + * header.type should be set to one of either MALI_C55_PARAM_BLOCK_AEXP_HIST_WEIGHTS\n> + * or MALI_C55_PARAM_BLOCK_AEXP_IHIST_WEIGHTS from :c:type:`mali_c55_param_block_type`.\n> + *\n> + * @header:\t\tThe Mali-C55 parameters block header\n> + * @nodes_used_horiz:\tNumber of active zones horizontally [0..15]\n> + * @nodes_used_vert:\tNumber of active zones vertically [0..15]\n> + * @zone_weights:\tZone weighting. Index is row*col where 0,0 is the top\n> + *\t\t\tleft zone continuing in raster order. Each zone can be\n> + *\t\t\tweighted in the range [0..15]. The number of rows and\n> + *\t\t\tcolumns is defined by @nodes_used_vert and\n> + *\t\t\t@nodes_used_horiz\n> + */\n> +struct mali_c55_params_aexp_weights {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u8 nodes_used_horiz;\n> +\t__u8 nodes_used_vert;\n> +\t__u8 zone_weights[MALI_C55_MAX_ZONES];\n> +};\n> +\n> +/**\n> + * struct mali_c55_params_digital_gain - Digital gain value\n> + *\n> + * This struct carries a digital gain value to set in the ISP.\n> + *\n> + * header.type should be set to MALI_C55_PARAM_BLOCK_DIGITAL_GAIN from\n> + * :c:type:`mali_c55_param_block_type` for this block.\n> + *\n> + * @header:\tThe Mali-C55 parameters block header\n> + * @gain:\tThe digital gain value to apply, in Q5.8 format.\n> + */\n> +struct mali_c55_params_digital_gain {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u16 gain;\n> +};\n> +\n> +/**\n> + * enum mali_c55_awb_stats_mode - Statistics mode for AWB\n> + * @MALI_C55_AWB_MODE_GRBR: Statistics collected as Green/Red and Blue/Red ratios\n> + * @MALI_C55_AWB_MODE_RGBG: Statistics collected as Red/Green and Blue/Green ratios\n> + */\n> +enum mali_c55_awb_stats_mode {\n> +\tMALI_C55_AWB_MODE_GRBR = 0,\n> +\tMALI_C55_AWB_MODE_RGBG,\n> +};\n> +\n> +/**\n> + * struct mali_c55_params_awb_gains - Gain settings for auto white balance\n> + *\n> + * This struct allows users to configure the gains for auto-white balance. There\n> + * are four gain settings corresponding to each colour channel in the bayer\n> + * domain. Although named generically, the association between the gain applied\n> + * and the colour channel is done automatically within the ISP depending on the\n> + * input format, and so the following mapping always holds true::\n> + *\n> + *\tgain00 = R\n> + *\tgain01 = Gr\n> + *\tgain10 = Gb\n> + *\tgain11 = B\n> + *\n> + * All of the gains are stored in Q4.8 format.\n> + *\n> + * header.type should be set to one of either MALI_C55_PARAM_BLOCK_AWB_GAINS or\n> + * MALI_C55_PARAM_BLOCK_AWB_GAINS_AEXP from :c:type:`mali_c55_param_block_type`.\n> + *\n> + * @header:\tThe Mali-C55 parameters block header\n> + * @gain00:\tMultiplier for colour channel 00\n> + * @gain01:\tMultiplier for colour channel 01\n> + * @gain10:\tMultiplier for colour channel 10\n> + * @gain11:\tMultiplier for colour channel 11\n> + */\n> +struct mali_c55_params_awb_gains {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u16 gain00;\n> +\t__u16 gain01;\n> +\t__u16 gain10;\n> +\t__u16 gain11;\n> +};\n> +\n> +/**\n> + * enum mali_c55_params_awb_tap_points - Tap points for the AWB statistics\n> + * @MALI_C55_AWB_STATS_TAP_PF: Immediately after the Purple Fringe block\n> + * @MALI_C55_AWB_STATS_TAP_CNR: Immediately after the CNR block\n> + */\n> +enum mali_c55_params_awb_tap_points {\n> +\tMALI_C55_AWB_STATS_TAP_PF = 0,\n> +\tMALI_C55_AWB_STATS_TAP_CNR,\n> +};\n> +\n> +/**\n> + * struct mali_c55_params_awb_config - Stats settings for auto-white balance\n> + *\n> + * This struct allows the configuration of the statistics generated for auto\n> + * white balance. Pixel intensity limits can be set to exclude overly bright or\n> + * dark regions of an image from the statistics entirely. Colour ratio minima\n> + * and maxima can be set to discount pixels who's ratios fall outside the\n> + * defined boundaries; there are two sets of registers to do this - the\n> + * \"min/max\" ratios which bound a region and the \"high/low\" ratios which further\n> + * trim the upper and lower ratios. For example with the boundaries configured\n> + * as follows, only pixels whos colour ratios falls into the region marked \"A\"\n> + * would be counted::\n> + *\n> + *\t                                                          cr_high\n> + *\t    2.0 |                                                   |\n> + *\t        |               cb_max --> _________________________v_____\n> + *\t    1.8 |                         |                         \\    |\n> + *\t        |                         |                          \\   |\n> + *\t    1.6 |                         |                           \\  |\n> + *\t        |                         |                            \\ |\n> + *\t c  1.4 |               cb_low -->|\\              A             \\|<--  cb_high\n> + *\t b      |                         | \\                            |\n> + *\t    1.2 |                         |  \\                           |\n> + *\t r      |                         |   \\                          |\n> + *\t a  1.0 |              cb_min --> |____\\_________________________|\n> + *\t t      |                         ^    ^                         ^\n> + *\t i  0.8 |                         |    |                         |\n> + *\t o      |                      cr_min  |                       cr_max\n> + *\t s  0.6 |                              |\n> + *\t        |                             cr_low\n> + *\t    0.4 |\n> + *\t        |\n> + *\t    0.2 |\n> + *\t        |\n> + *\t    0.0 |_______________________________________________________________\n> + *\t        0.0   0.2   0.4   0.6   0.8   1.0   1.2   1.4   1.6   1.8   2.0\n> + *\t                                   cr ratios\n> + *\n> + * header.type should be set to MALI_C55_PARAM_BLOCK_AWB_CONFIG from\n> + * :c:type:`mali_c55_param_block_type` for this block.\n> + *\n> + * @header:\t\tThe Mali-C55 parameters block header\n> + * @tap_point:\t\tThe tap point from enum mali_c55_params_awb_tap_points\n> + * @stats_mode:\t\tAWB statistics collection mode, see :c:type:`mali_c55_awb_stats_mode`\n> + * @white_level:\tUpper pixel intensity (I.E. raw pixel values) limit\n> + * @black_level:\tLower pixel intensity (I.E. raw pixel values) limit\n> + * @cr_max:\t\tMaximum R/G ratio (Q4.8 format)\n> + * @cr_min:\t\tMinimum R/G ratio (Q4.8 format)\n> + * @cb_max:\t\tMaximum B/G ratio (Q4.8 format)\n> + * @cb_min:\t\tMinimum B/G ratio (Q4.8 format)\n> + * @nodes_used_horiz:\tNumber of active zones horizontally [0..15]\n> + * @nodes_used_vert:\tNumber of active zones vertically [0..15]\n> + * @cr_high:\t\tR/G ratio trim high (Q4.8 format)\n> + * @cr_low:\t\tR/G ratio trim low (Q4.8 format)\n> + * @cb_high:\t\tB/G ratio trim high (Q4.8 format)\n> + * @cb_low:\t\tB/G ratio trim low (Q4.8 format)\n> + */\n> +struct mali_c55_params_awb_config {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u8 tap_point;\n> +\t__u8 stats_mode;\n> +\t__u16 white_level;\n> +\t__u16 black_level;\n> +\t__u16 cr_max;\n> +\t__u16 cr_min;\n> +\t__u16 cb_max;\n> +\t__u16 cb_min;\n> +\t__u8 nodes_used_horiz;\n> +\t__u8 nodes_used_vert;\n> +\t__u16 cr_high;\n> +\t__u16 cr_low;\n> +\t__u16 cb_high;\n> +\t__u16 cb_low;\n> +};\n> +\n> +#define MALI_C55_NUM_MESH_SHADING_ELEMENTS 3072\n> +\n> +/**\n> + * struct mali_c55_params_mesh_shading_config - Mesh shading configuration\n> + *\n> + * The mesh shading correction module allows programming a separate table of\n> + * either 16x16 or 32x32 node coefficients for 3 different light sources. The\n> + * final correction coefficients applied are computed by blending the\n> + * coefficients from two tables together.\n> + *\n> + * A page of 1024 32-bit integers is associated to each colour channel, with\n> + * pages stored consecutively in memory. Each 32-bit integer packs 3 8-bit\n> + * correction coefficients for a single node, one for each of the three light\n> + * sources. The 8 most significant bits are unused. The following table\n> + * describes the layout::\n> + *\n> + *\t+----------- Page (Colour Plane) 0 -------------+\n> + *\t| @mesh[i]  | Mesh Point | Bits  | Light Source |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|         0 |        0,0 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|         1 |        0,1 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|       ... |        ... | ...   | ...          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      1023 |      31,31 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+----------- Page (Colour Plane) 1 -------------+\n> + *\t| @mesh[i]  | Mesh Point | Bits  | Light Source |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      1024 |        0,0 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      1025 |        0,1 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|       ... |        ... | ...   | ...          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      2047 |      31,31 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+----------- Page (Colour Plane) 2 -------------+\n> + *\t| @mesh[i]  | Mesh Point | Bits  | Light Source |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      2048 |        0,0 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      2049 |        0,1 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|       ... |        ... | ...   | ...          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\t|      3071 |      31,31 | 16,23 | LS2          |\n> + *\t|           |            | 08-15 | LS1          |\n> + *\t|           |            | 00-07 | LS0          |\n> + *\t+-----------+------------+-------+--------------+\n> + *\n> + * The @mesh_scale member determines the precision and minimum and maximum gain.\n> + * For example if @mesh_scale is 0 and therefore selects 0 - 2x gain, a value of\n> + * 0 in a coefficient means 0.0 gain, a value of 128 means 1.0 gain and 255\n> + * means 2.0 gain.\n> + *\n> + * header.type should be set to MALI_C55_PARAM_MESH_SHADING_CONFIG from\n> + * :c:type:`mali_c55_param_block_type` for this block.\n> + *\n> + * @header:\t\tThe Mali-C55 parameters block header\n> + * @mesh_show:\t\tOutput the mesh data rather than image data\n> + * @mesh_scale:\t\tSet the precision and maximum gain range of mesh shading\n> + *\t\t\t\t- 0 = 0-2x gain\n> + *\t\t\t\t- 1 = 0-4x gain\n> + *\t\t\t\t- 2 = 0-8x gain\n> + *\t\t\t\t- 3 = 0-16x gain\n> + *\t\t\t\t- 4 = 1-2x gain\n> + *\t\t\t\t- 5 = 1-3x gain\n> + *\t\t\t\t- 6 = 1-5x gain\n> + *\t\t\t\t- 7 = 1-9x gain\n> + * @mesh_page_r:\tMesh page select for red colour plane [0..2]\n> + * @mesh_page_g:\tMesh page select for green colour plane [0..2]\n> + * @mesh_page_b:\tMesh page select for blue colour plane [0..2]\n> + * @mesh_width:\t\tNumber of horizontal nodes minus 1 [15,31]\n> + * @mesh_height:\tNumber of vertical nodes minus 1 [15,31]\n> + * @mesh:\t\tMesh shading correction tables\n> + */\n> +struct mali_c55_params_mesh_shading_config {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u8 mesh_show;\n> +\t__u8 mesh_scale;\n> +\t__u8 mesh_page_r;\n> +\t__u8 mesh_page_g;\n> +\t__u8 mesh_page_b;\n> +\t__u8 mesh_width;\n> +\t__u8 mesh_height;\n> +\t__u32 mesh[MALI_C55_NUM_MESH_SHADING_ELEMENTS];\n> +};\n> +\n> +/** enum mali_c55_params_mesh_alpha_bank - Mesh shading table bank selection\n> + * @MALI_C55_MESH_ALPHA_BANK_LS0_AND_LS1 - Select Light Sources 0 and 1\n> + * @MALI_C55_MESH_ALPHA_BANK_LS1_AND_LS2 - Select Light Sources 1 and 2\n> + * @MALI_C55_MESH_ALPHA_BANK_LS0_AND_LS2 - Select Light Sources 0 and 2\n> + */\n> +enum mali_c55_params_mesh_alpha_bank {\n> +\tMALI_C55_MESH_ALPHA_BANK_LS0_AND_LS1 = 0,\n> +\tMALI_C55_MESH_ALPHA_BANK_LS1_AND_LS2 = 1,\n> +\tMALI_C55_MESH_ALPHA_BANK_LS0_AND_LS2 = 4\n> +};\n> +\n> +/**\n> + * struct mali_c55_params_mesh_shading_selection - Mesh table selection\n> + *\n> + * The module computes the final correction coefficients by blending the ones\n> + * from two light source tables, which are selected (independently for each\n> + * colour channel) by the @mesh_alpha_bank_r/g/b fields.\n> + *\n> + * The final blended coefficients for each node are calculated using the\n> + * following equation:\n> + *\n> + *     Final coefficient = (a * LS\\ :sub:`b`\\ + (256 - a) * LS\\ :sub:`a`\\) / 256\n> + *\n> + * Where a is the @mesh_alpha_r/g/b value, and LS\\ :sub:`a`\\ and LS\\ :sub:`b`\\\n> + * are the node cofficients for the two tables selected by the\n> + * @mesh_alpha_bank_r/g/b value.\n> + *\n> + * The scale of the applied correction may also be controlled by tuning the\n> + * @mesh_strength member. This is a modifier to the final coefficients which can\n> + * be used to globally reduce the gains applied.\n> + *\n> + * header.type should be set to MALI_C55_PARAM_MESH_SHADING_SELECTION from\n> + * :c:type:`mali_c55_param_block_type` for this block.\n> + *\n> + * @header:\t\tThe Mali-C55 parameters block header\n> + * @mesh_alpha_bank_r:\tRed mesh table select (c:type:`enum mali_c55_params_mesh_alpha_bank`)\n> + * @mesh_alpha_bank_g:\tGreen mesh table select (c:type:`enum mali_c55_params_mesh_alpha_bank`)\n> + * @mesh_alpha_bank_b:\tBlue mesh table select (c:type:`enum mali_c55_params_mesh_alpha_bank`)\n> + * @mesh_alpha_r:\tBlend coefficient for R [0..255]\n> + * @mesh_alpha_g:\tBlend coefficient for G [0..255]\n> + * @mesh_alpha_b:\tBlend coefficient for B [0..255]\n> + * @mesh_strength:\tMesh strength in Q4.12 format [0..4096]\n> + */\n> +struct mali_c55_params_mesh_shading_selection {\n> +\tstruct mali_c55_params_block_header header;\n> +\t__u8 mesh_alpha_bank_r;\n> +\t__u8 mesh_alpha_bank_g;\n> +\t__u8 mesh_alpha_bank_b;\n> +\t__u8 mesh_alpha_r;\n> +\t__u8 mesh_alpha_g;\n> +\t__u8 mesh_alpha_b;\n> +\t__u16 mesh_strength;\n> +};\n> +\n> +/**\n> + * define MALI_C55_PARAMS_MAX_SIZE - Maximum size of all Mali C55 Parameters\n> + *\n> + * Though the parameters for the Mali-C55 are passed as optional blocks, the\n> + * driver still needs to know the absolute maximum size so that it can allocate\n> + * a buffer sized appropriately to accommodate userspace attempting to set all\n> + * possible parameters in a single frame.\n> + *\n> + * Some structs are in this list multiple times. Where that's the case, it just\n> + * reflects the fact that the same struct can be used with multiple different\n> + * header types from :c:type:`mali_c55_param_block_type`.\n> + */\n> +#define MALI_C55_PARAMS_MAX_SIZE\t\t\t\t\\\n> +\t(sizeof(struct mali_c55_params_sensor_off_preshading) +\t\\\n> +\tsizeof(struct mali_c55_params_aexp_hist) +\t\t\\\n> +\tsizeof(struct mali_c55_params_aexp_weights) +\t\t\\\n> +\tsizeof(struct mali_c55_params_aexp_hist) +\t\t\\\n> +\tsizeof(struct mali_c55_params_aexp_weights) +\t\t\\\n> +\tsizeof(struct mali_c55_params_digital_gain) +\t\t\\\n> +\tsizeof(struct mali_c55_params_awb_gains) +\t\t\\\n> +\tsizeof(struct mali_c55_params_awb_config) +\t\t\\\n> +\tsizeof(struct mali_c55_params_awb_gains) +\t\t\\\n> +\tsizeof(struct mali_c55_params_mesh_shading_config) +\t\\\n> +\tsizeof(struct mali_c55_params_mesh_shading_selection))\n> +\n> +/**\n> + * struct mali_c55_params_buffer - 3A configuration parameters\n> + *\n> + * This struct contains the configuration parameters of the Mali-C55 ISP\n> + * algorithms, serialized by userspace into a data buffer. Each configuration\n> + * parameter block is represented by a block-specific structure which contains a\n> + * :c:type:`mali_c55_params_block_header` entry as first member. Userspace\n> + * populates the @data buffer with configuration parameters for the blocks that\n> + * it intends to configure. As a consequence, the data buffer effective size\n> + * changes according to the number of ISP blocks that userspace intends to\n> + * configure.\n> + *\n> + * The parameters buffer is versioned by the @version field to allow modifying\n> + * and extending its definition. Userspace shall populate the @version field to\n> + * inform the driver about the version it intends to use. The driver will parse\n> + * and handle the @data buffer according to the data layout specific to the\n> + * indicated version and return an error if the desired version is not\n> + * supported.\n> + *\n> + * For each ISP block that userspace wants to configure, a block-specific\n> + * structure is appended to the @data buffer, one after the other without gaps\n> + * in between nor overlaps. Userspace shall populate the @total_size field with\n> + * the effective size, in bytes, of the @data buffer.\n> + *\n> + * The expected memory layout of the parameters buffer is::\n> + *\n> + *\t+-------------------- struct mali_c55_params_buffer ------------------+\n> + *\t| version = MALI_C55_PARAM_BUFFER_V1;                                 |\n> + *\t| total_size = sizeof(struct mali_c55_params_sensor_off_preshading)   |\n> + *\t|              sizeof(struct mali_c55_params_aexp_hist);              |\n> + *\t| +------------------------- data  ---------------------------------+ |\n> + *\t| | +--------- struct mali_c55_params_sensor_off_preshading ------+ | |\n> + *\t| | | +-------- struct mali_c55_params_block_header header -----+ | | |\n> + *\t| | | | type = MALI_C55_PARAM_BLOCK_SENSOR_OFFS;                | | | |\n> + *\t| | | | flags = MALI_C55_PARAM_BLOCK_FL_NONE;                   | | | |\n> + *\t| | | | size =                                                  | | | |\n> + *\t| | | |    sizeof(struct mali_c55_params_sensor_off_preshading);| | | |\n> + *\t| | | +---------------------------------------------------------+ | | |\n> + *\t| | | chan00 = ...;                                               | | |\n> + *\t| | | chan01 = ...;                                               | | |\n> + *\t| | | chan10 = ...;                                               | | |\n> + *\t| | | chan11 = ...;                                               | | |\n> + *\t| | +------------ struct mali_c55_params_aexp_hist ---------------+ | |\n> + *\t| | | +-------- struct mali_c55_params_block_header header -----+ | | |\n> + *\t| | | | type = MALI_C55_PARAM_BLOCK_AEXP_HIST;                  | | | |\n> + *\t| | | | flags = MALI_C55_PARAM_BLOCK_FL_NONE;                   | | | |\n> + *\t| | | | size = sizeof(struct mali_c55_params_aexp_hist);        | | | |\n> + *\t| | | +---------------------------------------------------------+ | | |\n> + *\t| | | skip_x = ...;                                               | | |\n> + *\t| | | offset_x = ...;                                             | | |\n> + *\t| | | skip_y = ...;                                               | | |\n> + *\t| | | offset_y = ...;                                             | | |\n> + *\t| | | scale_bottom = ...;                                         | | |\n> + *\t| | | scale_top = ...;                                            | | |\n> + *\t| | | plane_mode = ...;                                           | | |\n> + *\t| | | tap_point = ...;                                            | | |\n> + *\t| | +-------------------------------------------------------------+ | |\n> + *\t| +-----------------------------------------------------------------+ |\n> + *\t+---------------------------------------------------------------------+\n> + *\n> + * @version: The version from :c:type:`mali_c55_param_buffer_version`\n> + * @total_size: The Mali-C55 configuration data effective size, excluding this\n> + *\t\theader\n> + * @data: The Mali-C55 configuration blocks data\n> + */\n> +struct mali_c55_params_buffer {\n> +\t__u8 version;\n> +\t__u32 total_size;\n> +\t__u8 data[MALI_C55_PARAMS_MAX_SIZE];\n> +};\n> +\n> +#endif /* __UAPI_MALI_C55_CONFIG_H */\n> -- \n> 2.30.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E3F91BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Dec 2024 18:11:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A922B67E36;\n\tFri,  6 Dec 2024 19:11:59 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 775D0618B3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Dec 2024 19:11:58 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 658AC641;\n\tFri,  6 Dec 2024 19:11:28 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YmX57GL+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1733508688;\n\tbh=Wfn/cXeqbNPhCeV3j7Q2vEo92aIgAieNdD7BRJ3B1XU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YmX57GL+xcu/oVbw95CH8E25AGR5Cq1OngHX/Sglqn48D2KZuvCme3V3PEB8lwh5o\n\t7OYmfxH/oY+XtZ7TVN0aV3IEfK2cqTHg4v/Q4RNaw1LyBDKrbMhUs8EzPYXearob8Y\n\tJ793dLkxKPpHqNyKJ16MdIm97zelPpf4YpcIE3zo=","Date":"Fri, 6 Dec 2024 20:11:44 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, Anthony.McGivern@arm.com,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tNayden Kanchev <nayden.kanchev@arm.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH v4 02/11] include: linux: Add mali-c55-config.h","Message-ID":"<20241206181144.GC17570@pendragon.ideasonboard.com>","References":"<20241115122540.478103-1-dan.scally@ideasonboard.com>\n\t<20241115122540.478103-3-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20241115122540.478103-3-dan.scally@ideasonboard.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]