]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: v4l2-isp: Rename block_info to block_type_info
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>
Fri, 14 Nov 2025 11:02:11 +0000 (12:02 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Fri, 14 Nov 2025 14:48:49 +0000 (15:48 +0100)
The v4l2_isp_params_block_info structure contains validation information
that apply to a block -type- and not only to a specific ISP block
implementation.

Clarify this by renaming v4l2_isp_params_block_info in
v4l2_isp_params_block_type_info and update the documentation and the
users of v4l2-isp accordingly.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/amlogic/c3/isp/c3-isp-params.c
drivers/media/platform/arm/mali-c55/mali-c55-params.c
drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
drivers/media/v4l2-core/v4l2-isp.c
include/media/v4l2-isp.h

index c2339d6dc1074818d333e0221b1d6a407a41acd7..6f9ca7a7dd882328edab2f94c8bdac100119717e 100644 (file)
@@ -536,7 +536,8 @@ static const c3_isp_block_handler c3_isp_params_handlers[] = {
                .size = sizeof(struct c3_isp_params_ ## data), \
        }
 
-static const struct v4l2_isp_params_block_info c3_isp_params_blocks_info[] = {
+static const struct v4l2_isp_params_block_type_info
+c3_isp_params_block_types_info[] = {
        C3_ISP_PARAMS_BLOCK_INFO(AWB_GAINS, awb_gains),
        C3_ISP_PARAMS_BLOCK_INFO(AWB_CONFIG, awb_config),
        C3_ISP_PARAMS_BLOCK_INFO(AE_CONFIG, ae_config),
@@ -548,7 +549,7 @@ static const struct v4l2_isp_params_block_info c3_isp_params_blocks_info[] = {
 };
 
 static_assert(ARRAY_SIZE(c3_isp_params_handlers) ==
-             ARRAY_SIZE(c3_isp_params_blocks_info));
+             ARRAY_SIZE(c3_isp_params_block_types_info));
 
 static void c3_isp_params_cfg_blocks(struct c3_isp_params *params)
 {
@@ -781,8 +782,8 @@ static int c3_isp_params_vb2_buf_prepare(struct vb2_buffer *vb)
 
        return v4l2_isp_params_validate_buffer(params->isp->dev, vb,
                                        (struct v4l2_isp_params_buffer *)cfg,
-                                       c3_isp_params_blocks_info,
-                                       ARRAY_SIZE(c3_isp_params_blocks_info));
+                                       c3_isp_params_block_types_info,
+                                       ARRAY_SIZE(c3_isp_params_block_types_info));
 }
 
 static int c3_isp_params_vb2_buf_init(struct vb2_buffer *vb)
index ce220a50d25314d48d732a5f6c73d0331e493bff..c643cd013e4682cbd37114aa7101185ca2381bac 100644 (file)
@@ -428,7 +428,8 @@ static const mali_c55_params_handler mali_c55_params_handlers[] = {
        [MALI_C55_PARAM_MESH_SHADING_SELECTION] = &mali_c55_params_lsc_selection,
 };
 
-static const struct v4l2_isp_params_block_info mali_c55_params_blocks_info[] = {
+static const struct v4l2_isp_params_block_type_info
+mali_c55_params_block_types_info[] = {
        [MALI_C55_PARAM_BLOCK_SENSOR_OFFS] = {
                .size = sizeof(struct mali_c55_params_sensor_off_preshading),
        },
@@ -599,8 +600,8 @@ static int mali_c55_params_buf_prepare(struct vb2_buffer *vb)
        memcpy(buf->config, config, v4l2_isp_params_buffer_size(MALI_C55_PARAMS_MAX_SIZE));
 
        return v4l2_isp_params_validate_buffer(mali_c55->dev, vb, buf->config,
-                                              mali_c55_params_blocks_info,
-                                              ARRAY_SIZE(mali_c55_params_blocks_info));
+                                              mali_c55_params_block_types_info,
+                                              ARRAY_SIZE(mali_c55_params_block_types_info));
 }
 
 static void mali_c55_params_buf_queue(struct vb2_buffer *vb)
index 2dde0c62c8e6b8f8447e0414950cec0a511169fd..c9f88635224cc64e6b25802a4bbac9b3f907f96e 100644 (file)
@@ -2198,7 +2198,8 @@ static const struct rkisp1_ext_params_handler {
                .size = sizeof(struct rkisp1_ext_params_ ## data ## _config), \
        }
 
-static const struct v4l2_isp_params_block_info rkisp1_ext_params_blocks_info[] = {
+static const struct v4l2_isp_params_block_type_info
+rkisp1_ext_params_block_types_info[] = {
        RKISP1_PARAMS_BLOCK_INFO(BLS, bls),
        RKISP1_PARAMS_BLOCK_INFO(DPCC, dpcc),
        RKISP1_PARAMS_BLOCK_INFO(SDG, sdg),
@@ -2223,7 +2224,7 @@ static const struct v4l2_isp_params_block_info rkisp1_ext_params_blocks_info[] =
 };
 
 static_assert(ARRAY_SIZE(rkisp1_ext_params_handlers) ==
-             ARRAY_SIZE(rkisp1_ext_params_blocks_info));
+             ARRAY_SIZE(rkisp1_ext_params_block_types_info));
 
 static void rkisp1_ext_params_config(struct rkisp1_params *params,
                                     struct rkisp1_ext_params_cfg *cfg,
@@ -2677,8 +2678,8 @@ static int rkisp1_params_prepare_ext_params(struct rkisp1_params *params,
 
        return v4l2_isp_params_validate_buffer(params->rkisp1->dev, vb,
                                (struct v4l2_isp_params_buffer *)cfg,
-                               rkisp1_ext_params_blocks_info,
-                               ARRAY_SIZE(rkisp1_ext_params_blocks_info));
+                               rkisp1_ext_params_block_types_info,
+                               ARRAY_SIZE(rkisp1_ext_params_block_types_info));
 }
 
 static int rkisp1_params_vb2_buf_prepare(struct vb2_buffer *vb)
index 756d2b4996cc15afb0b6eea3fa2bbc804f292366..29831f7032e9428a5f4659580b07c042dbfcef27 100644 (file)
@@ -38,8 +38,8 @@ EXPORT_SYMBOL_GPL(v4l2_isp_params_validate_buffer_size);
 
 int v4l2_isp_params_validate_buffer(struct device *dev, struct vb2_buffer *vb,
                                    const struct v4l2_isp_params_buffer *buffer,
-                                   const struct v4l2_isp_params_block_info *info,
-                                   size_t num_blocks)
+                                   const struct v4l2_isp_params_block_type_info *type_info,
+                                   size_t num_block_types)
 {
        size_t header_size = offsetof(struct v4l2_isp_params_buffer, data);
        size_t payload_size = vb2_get_plane_payload(vb, 0);
@@ -71,13 +71,13 @@ int v4l2_isp_params_validate_buffer(struct device *dev, struct vb2_buffer *vb,
        /* Walk the list of ISP configuration blocks and validate them. */
        buffer_size = buffer->data_size;
        while (buffer_size >= sizeof(struct v4l2_isp_params_block_header)) {
-               const struct v4l2_isp_params_block_info *block_info;
+               const struct v4l2_isp_params_block_type_info *info;
                const struct v4l2_isp_params_block_header *block;
 
                block = (const struct v4l2_isp_params_block_header *)
                        (buffer->data + block_offset);
 
-               if (block->type >= num_blocks) {
+               if (block->type >= num_block_types) {
                        dev_dbg(dev,
                                "Invalid block type %u at offset %zu\n",
                                block->type, block_offset);
@@ -100,17 +100,17 @@ int v4l2_isp_params_validate_buffer(struct device *dev, struct vb2_buffer *vb,
                }
 
                /*
-                * Match the block reported size against the info provided
+                * Match the block reported size against the type info provided
                 * one, but allow the block to only contain the header in
                 * case it is going to be disabled.
                 */
-               block_info = &info[block->type];
-               if (block->size != block_info->size &&
+               info = &type_info[block->type];
+               if (block->size != info->size &&
                    (!(block->flags & V4L2_ISP_PARAMS_FL_BLOCK_DISABLE) ||
                    block->size != sizeof(*block))) {
                        dev_dbg(dev,
                                "Invalid block size %u (expected %zu) at offset %zu\n",
-                               block->size, block_info->size, block_offset);
+                               block->size, info->size, block_offset);
                        return -EINVAL;
                }
 
index 8b4695663699e7f176384739cf54ed7fa2c578f8..f3a6d0edcb24cb753251e50ad899dd4ac2dbef79 100644 (file)
@@ -49,18 +49,18 @@ int v4l2_isp_params_validate_buffer_size(struct device *dev,
                                         size_t max_size);
 
 /**
- * struct v4l2_isp_params_block_info - V4L2 ISP per-block info
- * @size: the block expected size
+ * struct v4l2_isp_params_block_type_info - V4L2 ISP per-block-type info
+ * @size: the block type expected size
  *
- * The v4l2_isp_params_block_info collects information of the ISP configuration
- * blocks for validation purposes. It currently only contains the expected
- * block size.
+ * The v4l2_isp_params_block_type_info collects information of the ISP
+ * configuration block types for validation purposes. It currently only contains
+ * the expected block type size.
  *
- * Drivers shall prepare a list of block info, indexed by block type, one for
- * each supported ISP block and correctly populate them with the expected block
- * size.
+ * Drivers shall prepare a list of block type info, indexed by block type, one
+ * for each supported ISP block type and correctly populate them with the
+ * expected block type size.
  */
-struct v4l2_isp_params_block_info {
+struct v4l2_isp_params_block_type_info {
        size_t size;
 };
 
@@ -69,8 +69,8 @@ struct v4l2_isp_params_block_info {
  * @dev: the driver's device pointer
  * @vb: the videobuf2 buffer
  * @buffer: the V4L2 ISP parameters buffer
- * @info: the list of per-block validation info
- * @num_blocks: the number of blocks
+ * @type_info: the array of per-block-type validation info
+ * @num_block_types: the number of block types in the type_info array
  *
  * This function completes the validation of a V4L2 ISP parameters buffer,
  * verifying each configuration block correctness before the driver can use
@@ -85,7 +85,7 @@ struct v4l2_isp_params_block_info {
  */
 int v4l2_isp_params_validate_buffer(struct device *dev, struct vb2_buffer *vb,
                                    const struct v4l2_isp_params_buffer *buffer,
-                                   const struct v4l2_isp_params_block_info *info,
-                                   size_t num_blocks);
+                                   const struct v4l2_isp_params_block_type_info *type_info,
+                                   size_t num_block_types);
 
 #endif /* _V4L2_ISP_H_ */