Re: [PATCH v10 12/13] media: rppx1: ga: Add support for gamma out correction

Sakari Ailus <[email protected]> Tue, 28 Jul 2026 18:38:14 +0300
Newsgroups org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media
Message-ID <[email protected]>
Hejssan,

On Thu, Jun 11, 2026 at 10:41:47PM +0200, Niklas Söderlund wrote:
> +/**
> + * struct rppx1_ga_params - Gamma Out Correction configuration
> + *
> + * The Gamma Out Correction module is available on the Human Vision Output
> + * Pipe (HV) and the Machine Vision Output Pipe (MV). Userspace selects
> + * which pipe to operate by setting the @header.type field to
> + * RPPX1_PARAMS_BLOCK_TYPE_GA_HV or RPPX1_PARAMS_BLOCK_TYPE_GA_MV.
> + *
> + * The module allows to apply a @gamma_y gamma correction curve to RGB data
> + * represented as a table of 16 entries. The 16 input sampling points can be
> + * equidistant or segmented using a logarithmic scale according to the value of
> + * @mode.
> + *
> + * The gamma curve values are 12 bits on the HV output pipe and 24 bits on the
> + * MV output pipe. Userspace is expected to provide the curve values with a
> + * bit-depth matching the one of pipe in use.
> + *
> + * @header: block header (type = RPPX1_PARAMS_BLOCK_TYPE_GA_HV or
> + *	    type = RPPX1_PARAMS_BLOCK_TYPE_GA_MV)
> + * @mode: gamma curve input segmentation mode (see rppx1_ga_seg_mode)
> + * @gamma_y: gamma out curve y-axis values
> + */
> +struct rppx1_ga_params {
> +	struct v4l2_isp_params_block_header header;
> +	__u8 mode;

Please use reserved fields to avoid holes in structs!

> +	__u32 gamma_y[RPPX1_GA_MAX_SAMPLES];
> +};
> +
>  /**
>   * RPPX1_PARAMS_MAX_SIZE - Maximum size of all RPP-X1 parameter blocks
>   *
> @@ -516,7 +565,9 @@ struct rppx1_lsc_params {
>  	sizeof(struct rppx1_bls_params)				+	\
>  	sizeof(struct rppx1_ccor_params)			+	\
>  	sizeof(struct rppx1_lsc_params)				+	\
> -	sizeof(struct rppx1_lsc_params))
> +	sizeof(struct rppx1_lsc_params)				+	\
> +	sizeof(struct rppx1_ga_params)				+	\
> +	sizeof(struct rppx1_ga_params))
>  
>  /* ---------------------------------------------------------------------------
>   * Statistics Structures

-- 
Regards,

Sakari Ailus