diff mbox series

[RFC,v1,07/19] media: renesas: vsp1: Simplify partition calculation

Message ID 20231122043009.2741-8-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: renesas: vsp1: Conversion to subdev active state | expand

Commit Message

Laurent Pinchart Nov. 22, 2023, 4:29 a.m. UTC
When calculation a partition in vsp1_pipeline_calculate_partition(),
there is no need to handle the case where the whole image is covered by
a single partition locally. In that case, the index and div_size
parameters are 0 and format->width respectively, which makes the general
code behave exactly as the special case. Drop the special case.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/renesas/vsp1/vsp1_pipe.c | 10 ----------
 1 file changed, 10 deletions(-)

Comments

Jacopo Mondi June 18, 2024, 10:29 a.m. UTC | #1
Hi Laurent

On Wed, Nov 22, 2023 at 06:29:57AM GMT, Laurent Pinchart wrote:
> When calculation a partition in vsp1_pipeline_calculate_partition(),
> there is no need to handle the case where the whole image is covered by
> a single partition locally. In that case, the index and div_size
> parameters are 0 and format->width respectively, which makes the general
> code behave exactly as the special case. Drop the special case.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/media/platform/renesas/vsp1/vsp1_pipe.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c
> index b90240b24b3a..ca6817f45dd2 100644
> --- a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c
> +++ b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c
> @@ -495,16 +495,6 @@ void vsp1_pipeline_calculate_partition(struct vsp1_pipeline *pipe,
>  	format = v4l2_subdev_state_get_format(pipe->output->entity.state,
>  					      RWPF_PAD_SINK);
>
> -	/* A single partition simply processes the output size in full. */
> -	if (pipe->partitions <= 1) {
> -		window.left = 0;
> -		window.width = format->width;
> -
> -		vsp1_pipeline_propagate_partition(pipe, partition, index,
> -						  &window);
> -		return;
> -	}
> -
>  	/* Initialise the partition with sane starting conditions. */
>  	window.left = index * div_size;
>  	window.width = div_size;

Assuming index == 0 and div_size == format->width in case of a single
partition:
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> --
> Regards,
>
> Laurent Pinchart
>
>
diff mbox series

Patch

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c
index b90240b24b3a..ca6817f45dd2 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c
@@ -495,16 +495,6 @@  void vsp1_pipeline_calculate_partition(struct vsp1_pipeline *pipe,
 	format = v4l2_subdev_state_get_format(pipe->output->entity.state,
 					      RWPF_PAD_SINK);
 
-	/* A single partition simply processes the output size in full. */
-	if (pipe->partitions <= 1) {
-		window.left = 0;
-		window.width = format->width;
-
-		vsp1_pipeline_propagate_partition(pipe, partition, index,
-						  &window);
-		return;
-	}
-
 	/* Initialise the partition with sane starting conditions. */
 	window.left = index * div_size;
 	window.width = div_size;