From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
kieran.bingham@ideasonboard.com
Subject: Re: [PATCH 4/8] v4l: vsp1: Move partition rectangles to struct
Date: Mon, 13 Feb 2017 23:52:58 +0200 [thread overview]
Message-ID: <4172040.3kVqaMM1Dh@avalon> (raw)
In-Reply-To: <2a0da9a22511742091a8b8d1b79549f3cbd0c775.1486758327.git-series.kieran.bingham+renesas@ideasonboard.com>
Hi Kieran,
Thank you for the patch.
On Friday 10 Feb 2017 20:27:32 Kieran Bingham wrote:
> As we develop the partition algorithm, we need to store more information
> per partition to describe the phase and other parameters.
>
> To keep this data together, further abstract the existing v4l2_rect
> into a partition specific structure
>
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> ---
> drivers/media/platform/vsp1/vsp1_pipe.h | 12 ++++++++++--
> drivers/media/platform/vsp1/vsp1_rpf.c | 4 ++--
> drivers/media/platform/vsp1/vsp1_uds.c | 8 +++++---
> drivers/media/platform/vsp1/vsp1_video.c | 14 ++++++++++----
> drivers/media/platform/vsp1/vsp1_wpf.c | 9 +++++----
> 5 files changed, 32 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_pipe.h
> b/drivers/media/platform/vsp1/vsp1_pipe.h index 5aa31143ce59..6494c4c75023
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_pipe.h
> +++ b/drivers/media/platform/vsp1/vsp1_pipe.h
> @@ -60,6 +60,14 @@ enum vsp1_pipeline_state {
> };
>
> /*
> + * struct vsp1_partition - A description of each partition slice performed
> by HW
> + * @dest: The position and dimension of this partition in the destination
> image
> + */
> +struct vsp1_partition {
> + struct v4l2_rect dest;
Given that we only partition the image horizontally, how about just storing
the left and width values ?
Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> +};
> +
> +/*
> * struct vsp1_pipeline - A VSP1 hardware pipeline
> * @pipe: the media pipeline
> * @irqlock: protects the pipeline state
> @@ -114,8 +122,8 @@ struct vsp1_pipeline {
> struct vsp1_dl_list *dl;
>
> unsigned int partitions;
> - struct v4l2_rect partition;
> - struct v4l2_rect part_table[VSP1_PIPE_MAX_PARTITIONS];
> + struct vsp1_partition *partition;
> + struct vsp1_partition part_table[VSP1_PIPE_MAX_PARTITIONS];
> };
>
> void vsp1_pipeline_reset(struct vsp1_pipeline *pipe);
> diff --git a/drivers/media/platform/vsp1/vsp1_rpf.c
> b/drivers/media/platform/vsp1/vsp1_rpf.c index b2e34a800ffa..df380a237118
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_rpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_rpf.c
> @@ -107,9 +107,9 @@ static void rpf_configure(struct vsp1_entity *entity,
> output = vsp1_entity_get_pad_format(wpf, wpf->config,
> RWPF_PAD_SOURCE);
>
> - crop.width = pipe->partition.width * input_width
> + crop.width = pipe->partition->dest.width * input_width
> / output->width;
> - crop.left += pipe->partition.left * input_width
> + crop.left += pipe->partition->dest.left * input_width
> / output->width;
> }
>
> diff --git a/drivers/media/platform/vsp1/vsp1_uds.c
> b/drivers/media/platform/vsp1/vsp1_uds.c index da8f89a31ea4..98c0836d6dcd
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_uds.c
> +++ b/drivers/media/platform/vsp1/vsp1_uds.c
> @@ -272,11 +272,13 @@ static void uds_configure(struct vsp1_entity *entity,
> bool multitap;
>
> if (params == VSP1_ENTITY_PARAMS_PARTITION) {
> - const struct v4l2_rect *clip = &pipe->partition;
> + struct vsp1_partition *partition = pipe->partition;
>
> vsp1_uds_write(uds, dl, VI6_UDS_CLIP_SIZE,
> - (clip->width << VI6_UDS_CLIP_SIZE_HSIZE_SHIFT)
|
> - (clip->height <<
VI6_UDS_CLIP_SIZE_VSIZE_SHIFT));
> + (partition->dest.width
> + << VI6_UDS_CLIP_SIZE_HSIZE_SHIFT) |
> + (partition->dest.height
> + << VI6_UDS_CLIP_SIZE_VSIZE_SHIFT));
> return;
> }
>
> diff --git a/drivers/media/platform/vsp1/vsp1_video.c
> b/drivers/media/platform/vsp1/vsp1_video.c index 4ade958a1c9e..a978508a4993
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_video.c
> +++ b/drivers/media/platform/vsp1/vsp1_video.c
> @@ -271,8 +271,11 @@ static void vsp1_video_pipeline_setup_partitions(struct
> vsp1_pipeline *pipe)
>
> /* Gen2 hardware doesn't require image partitioning. */
> if (vsp1->info->gen == 2) {
> + struct vsp1_partition *partition = &pipe->part_table[0];
> +
> pipe->partitions = 1;
> - pipe->part_table[0] = vsp1_video_partition(pipe, div_size, 0);
> + partition->dest = vsp1_video_partition(pipe, div_size, 0);
> +
> return;
> }
>
> @@ -288,8 +291,11 @@ static void vsp1_video_pipeline_setup_partitions(struct
> vsp1_pipeline *pipe)
>
> pipe->partitions = DIV_ROUND_UP(format->width, div_size);
>
> - for (i = 0; i < pipe->partitions; i++)
> - pipe->part_table[i] = vsp1_video_partition(pipe, div_size, i);
> + for (i = 0; i < pipe->partitions; i++) {
> + struct vsp1_partition *partition = &pipe->part_table[i];
> +
> + partition->dest = vsp1_video_partition(pipe, div_size, i);
> + }
> }
>
> /*
> ---------------------------------------------------------------------------
> -- @@ -373,7 +379,7 @@ static void vsp1_video_pipeline_run_partition(struct
> vsp1_pipeline *pipe, {
> struct vsp1_entity *entity;
>
> - pipe->partition = pipe->part_table[partition_number];
> + pipe->partition = &pipe->part_table[partition_number];
>
> list_for_each_entry(entity, &pipe->entities, list_pipe) {
> if (entity->ops->configure)
> diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c
> b/drivers/media/platform/vsp1/vsp1_wpf.c index ad67034e08e9..bd4cd2807cc6
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_wpf.c
> +++ b/drivers/media/platform/vsp1/vsp1_wpf.c
> @@ -227,7 +227,7 @@ static void wpf_configure(struct vsp1_entity *entity,
> * multiple slices.
> */
> if (pipe->partitions > 1)
> - width = pipe->partition.width;
> + width = pipe->partition->dest.width;
>
> vsp1_wpf_write(wpf, dl, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN |
> (0 << VI6_WPF_SZCLIP_OFST_SHIFT) |
> @@ -255,10 +255,11 @@ static void wpf_configure(struct vsp1_entity *entity,
> * order the partitions correctly.
> */
> if (flip & BIT(WPF_CTRL_HFLIP))
> - offset = format->width - pipe->partition.left
> - - pipe->partition.width;
> + offset = format->width
> + - pipe->partition->dest.left
> + - pipe->partition->dest.width;
> else
> - offset = pipe->partition.left;
> + offset = pipe->partition->dest.left;
>
> mem.addr[0] += offset * fmtinfo->bpp[0] / 8;
> if (format->num_planes > 1) {
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2017-02-13 21:52 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 20:27 [PATCH 0/8] v4l: vsp1: Partition phase developments Kieran Bingham
2017-02-10 20:27 ` [PATCH 1/8] v4l: vsp1: Provide UDS register updates Kieran Bingham
2017-02-13 21:30 ` Laurent Pinchart
2017-02-10 20:27 ` [PATCH 2/8] v4l: vsp1: Track the SRU entity in the pipeline Kieran Bingham
2017-02-13 21:36 ` Laurent Pinchart
2017-02-10 20:27 ` [PATCH 3/8] v4l: vsp1: Correct image partition parameters Kieran Bingham
2017-02-13 21:45 ` Laurent Pinchart
2017-02-10 20:27 ` [PATCH 4/8] v4l: vsp1: Move partition rectangles to struct Kieran Bingham
2017-02-13 21:52 ` Laurent Pinchart [this message]
2017-02-10 20:27 ` [PATCH 5/8] v4l: vsp1: Operate on partition struct data directly Kieran Bingham
2017-02-13 22:05 ` Laurent Pinchart
2017-02-10 20:27 ` [PATCH 6/8] v4l: vsp1: Allow entities to participate in the partition algorithm Kieran Bingham
2017-02-13 22:51 ` Laurent Pinchart
2017-02-13 23:03 ` Laurent Pinchart
2017-02-10 20:27 ` [PATCH 7/8] v4l: vsp1: Calculate UDS phase for partitions Kieran Bingham
2017-02-13 23:21 ` Laurent Pinchart
2017-02-10 20:27 ` [PATCH 8/8] v4l: vsp1: Implement left edge partition algorithm overlap Kieran Bingham
2017-02-13 23:30 ` Laurent Pinchart
2017-02-14 0:01 ` [PATCH 0/8] v4l: vsp1: Partition phase developments Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4172040.3kVqaMM1Dh@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox