diff mbox series

[v1,2/5] media: rkisp1: Add features mask to extensible block handlers

Message ID 20240703222533.1662-3-laurent.pinchart@ideasonboard.com (mailing list archive)
State New
Headers show
Series media: rkisp1: Add support for the companding block | expand

Commit Message

Laurent Pinchart July 3, 2024, 10:25 p.m. UTC
Future ISP parameter blocks for i.MX8MP-specific features will not
support on Rockchip platforms as they lack the corresponding hardware.
Introduce a features mask in the extensible block handlers to indicate
which device features a block require, and ignore blocks that require
unavailable features.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-params.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jacopo Mondi July 4, 2024, 8:49 a.m. UTC | #1
Hi Laurent

On Thu, Jul 04, 2024 at 01:25:30AM GMT, Laurent Pinchart wrote:
> Future ISP parameter blocks for i.MX8MP-specific features will not
> support on Rockchip platforms as they lack the corresponding hardware.
> Introduce a features mask in the extensible block handlers to indicate
> which device features a block require, and ignore blocks that require
> unavailable features.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/platform/rockchip/rkisp1/rkisp1-params.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
> index b10cc2701244..92312b4dabf6 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
> @@ -1845,6 +1845,7 @@ static const struct rkisp1_ext_params_handler {
>  	size_t size;
>  	rkisp1_block_handler handler;
>  	unsigned int group;
> +	unsigned int features;
>  } rkisp1_ext_params_handlers[] = {
>  	[RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS] = {
>  		.size		= sizeof(struct rkisp1_ext_params_bls_config),
> @@ -1956,6 +1957,10 @@ static void rkisp1_ext_params_config(struct rkisp1_params *params,

Maybe exapand the comment to also specify the feature has to be
supported by the platform ?

		/*
                 * Make sure the block is supported by the platform and in the
                 * list of groups to configure.
                 */


>  		if (!(block_handler->group & block_group_mask))
>  			continue;
>
> +		if ((block_handler->features & params->rkisp1->info->features) !=
> +		    params->rkisp1->info->features)

This should probably be

		if ((block_handler->features & params->rkisp1->info->features) !=
		    block_handler->features)

Thanks
  j

> +			continue;
> +
>  		block_handler->handler(params, block);
>
>  		if (block->header.enable == RKISP1_EXT_PARAMS_BLOCK_DISABLE)
> --
> Regards,
>
> Laurent Pinchart
>
diff mbox series

Patch

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
index b10cc2701244..92312b4dabf6 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-params.c
@@ -1845,6 +1845,7 @@  static const struct rkisp1_ext_params_handler {
 	size_t size;
 	rkisp1_block_handler handler;
 	unsigned int group;
+	unsigned int features;
 } rkisp1_ext_params_handlers[] = {
 	[RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS] = {
 		.size		= sizeof(struct rkisp1_ext_params_bls_config),
@@ -1956,6 +1957,10 @@  static void rkisp1_ext_params_config(struct rkisp1_params *params,
 		if (!(block_handler->group & block_group_mask))
 			continue;
 
+		if ((block_handler->features & params->rkisp1->info->features) !=
+		    params->rkisp1->info->features)
+			continue;
+
 		block_handler->handler(params, block);
 
 		if (block->header.enable == RKISP1_EXT_PARAMS_BLOCK_DISABLE)