diff mbox

[3/8] v4l: vsp1: Correct image partition parameters

Message ID 6d9f8e04ac314ef7a1ffdc10d079fcd30707a03a.1486758327.git-series.kieran.bingham+renesas@ideasonboard.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Kieran Bingham Feb. 10, 2017, 8:27 p.m. UTC
The image partition algorithm operates on the image dimensions as input
into the WPF entity.

Correct this in the code, and document what defines the properties for
the algorithm in the section header

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
 drivers/media/platform/vsp1/vsp1_video.c | 12 ++++++++++--
 drivers/media/platform/vsp1/vsp1_wpf.c   |  4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart Feb. 13, 2017, 9:45 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Friday 10 Feb 2017 20:27:31 Kieran Bingham wrote:
> The image partition algorithm operates on the image dimensions as input
> into the WPF entity.
> 
> Correct this in the code, and document what defines the properties for
> the algorithm in the section header

Nitpicking, this sentence lacks a period.

> 
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/vsp1/vsp1_video.c | 12 ++++++++++--
>  drivers/media/platform/vsp1/vsp1_wpf.c   |  4 ++--
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_video.c
> b/drivers/media/platform/vsp1/vsp1_video.c index be9c860b1c04..4ade958a1c9e
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_video.c
> +++ b/drivers/media/platform/vsp1/vsp1_video.c
> @@ -176,6 +176,14 @@ static int __vsp1_video_try_format(struct vsp1_video
> *video,
> 
>  /*
> ---------------------------------------------------------------------------
> -- * VSP1 Partition Algorithm support
> + *
> + * VSP hardware can have restrictions on image width dependent on the
> hardware + * configuration of the pipeline. Adapting for these restrictions
> is implemented + * via the partition algorithm.
> + *
> + * The partition windows and sizes are based on the output size of the WPF
> + * before rotation, which is represented by the input parameters to the WPF
> + * entity in our pipeline.
>   */
> 
>  /**
> @@ -196,7 +204,7 @@ static struct v4l2_rect vsp1_video_partition(struct
> vsp1_pipeline *pipe,
> 
>  	format = vsp1_entity_get_pad_format(&pipe->output->entity,
>  					    pipe->output->entity.config,
> -					    RWPF_PAD_SOURCE);
> +					    RWPF_PAD_SINK);
> 
>  	/* A single partition simply processes the output size in full. */
>  	if (pipe->partitions <= 1) {
> @@ -258,7 +266,7 @@ static void vsp1_video_pipeline_setup_partitions(struct
> vsp1_pipeline *pipe)
> 
>  	format = vsp1_entity_get_pad_format(&pipe->output->entity,
>  					    pipe->output->entity.config,
> -					    RWPF_PAD_SOURCE);
> +					    RWPF_PAD_SINK);
>  	div_size = format->width;
> 
>  	/* Gen2 hardware doesn't require image partitioning. */
> diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c
> b/drivers/media/platform/vsp1/vsp1_wpf.c index 7c48f81cd5c1..ad67034e08e9
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_wpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_wpf.c
> @@ -218,8 +218,8 @@ static void wpf_configure(struct vsp1_entity *entity,
>  		const struct v4l2_pix_format_mplane *format = &wpf->format;
>  		struct vsp1_rwpf_memory mem = wpf->mem;
>  		unsigned int flip = wpf->flip.active;
> -		unsigned int width = source_format->width;
> -		unsigned int height = source_format->height;
> +		unsigned int width = sink_format->width;
> +		unsigned int height = sink_format->height;
>  		unsigned int offset;
> 
>  		/*
diff mbox

Patch

diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c
index be9c860b1c04..4ade958a1c9e 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -176,6 +176,14 @@  static int __vsp1_video_try_format(struct vsp1_video *video,
 
 /* -----------------------------------------------------------------------------
  * VSP1 Partition Algorithm support
+ *
+ * VSP hardware can have restrictions on image width dependent on the hardware
+ * configuration of the pipeline. Adapting for these restrictions is implemented
+ * via the partition algorithm.
+ *
+ * The partition windows and sizes are based on the output size of the WPF
+ * before rotation, which is represented by the input parameters to the WPF
+ * entity in our pipeline.
  */
 
 /**
@@ -196,7 +204,7 @@  static struct v4l2_rect vsp1_video_partition(struct vsp1_pipeline *pipe,
 
 	format = vsp1_entity_get_pad_format(&pipe->output->entity,
 					    pipe->output->entity.config,
-					    RWPF_PAD_SOURCE);
+					    RWPF_PAD_SINK);
 
 	/* A single partition simply processes the output size in full. */
 	if (pipe->partitions <= 1) {
@@ -258,7 +266,7 @@  static void vsp1_video_pipeline_setup_partitions(struct vsp1_pipeline *pipe)
 
 	format = vsp1_entity_get_pad_format(&pipe->output->entity,
 					    pipe->output->entity.config,
-					    RWPF_PAD_SOURCE);
+					    RWPF_PAD_SINK);
 	div_size = format->width;
 
 	/* Gen2 hardware doesn't require image partitioning. */
diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c
index 7c48f81cd5c1..ad67034e08e9 100644
--- a/drivers/media/platform/vsp1/vsp1_wpf.c
+++ b/drivers/media/platform/vsp1/vsp1_wpf.c
@@ -218,8 +218,8 @@  static void wpf_configure(struct vsp1_entity *entity,
 		const struct v4l2_pix_format_mplane *format = &wpf->format;
 		struct vsp1_rwpf_memory mem = wpf->mem;
 		unsigned int flip = wpf->flip.active;
-		unsigned int width = source_format->width;
-		unsigned int height = source_format->height;
+		unsigned int width = sink_format->width;
+		unsigned int height = sink_format->height;
 		unsigned int offset;
 
 		/*