diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/media/v4l2-isp.h | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/include/media/v4l2-isp.h b/include/media/v4l2-isp.h index 1f35a52f978a..7a54cf98c79a 100644 --- a/include/media/v4l2-isp.h +++ b/include/media/v4l2-isp.h @@ -53,7 +53,7 @@ int v4l2_isp_params_validate_buffer_size(struct device *dev, size_t max_size); /** - * struct v4l2_isp_params_block_type_info - V4L2 ISP per-block-type info + * struct v4l2_isp_params_block_type_info - V4L2 ISP params per-block-type info * @size: the block type expected size * @block_validate: driver's callback to implement per-block validation * @@ -97,4 +97,61 @@ int v4l2_isp_params_validate_buffer(struct device *dev, struct vb2_buffer *vb, const struct v4l2_isp_params_block_type_info *type_info, size_t num_block_types); +/** + * struct v4l2_isp_stats_block_type_info - V4L2 ISP stats per-block-type info + * @size: the block type expected size + * + * The v4l2_isp_stats_block_type_info collects information of the ISP + * statistics block types for validation purposes. It currently only contains + * the expected block size. + * + * Drivers shall prepare a list of statistics block type info, indexed by block + * type, one for each supported ISP statistics block type and correctly populate + * them with the expected block size. + */ +struct v4l2_isp_stats_block_type_info { + size_t size; +}; + +/** + * v4l2_isp_stats_init_buffer - Initialize a statistics buffer + * + * Initialize a buffer of statistics. Only set the 'version' field and reset + * 'data_size' to 0. + * + * @buf: the v4l2_isp_buffer to initialize + * @version: the v4l2-isp serialization format version used by the driver + */ +void v4l2_isp_stats_init_buffer(struct v4l2_isp_buffer *buf, + enum v4l2_isp_version version); + +/** + * v4l2_isp_stats_init_block - Create and initialize a new block in a statistics + * buffer + * @dev: the driver's device pointer + * @buf: the v4l2_isp_buffer where statistics are serialized + * @type_info: the array of per-block-type validation info + * @num_block_types: the number of block types in the type_info array + * @block_type: the type of the statistics block to initialize + * @max_size: the maximum size of the data[] member of @buf + * + * This function locates and initialize a new statistics block in @buf for the + * driver to populate its content. The function checks that enough space for the + * requested @block_type is available in @buf and increments the 'data_size' + * member of @buf. The newly created statistics block's header is initialized + * with the size and type information provided by the caller in @type_info. + * + * Drivers should call this function before populating a new statistics block + * content. + * + * Returns a pointer to the next available location in @buf, or an error pointer + * if the requested @block_size is not available in @buf or @block_type is not + * valid. + */ +struct v4l2_isp_block_header * +v4l2_isp_stats_init_block(struct device *dev, struct v4l2_isp_buffer *buf, + const struct v4l2_isp_stats_block_type_info *type_info, + size_t num_block_types, unsigned int block_type, + size_t max_size); + #endif /* _V4L2_ISP_H_ */ |
