diff options
author | Kieran Bingham <kieran+renesas@bingham.xyz> | 2016-07-12 16:06:34 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 21:00:03 +0300 |
commit | df32c924518716160d43defc444199e894859c08 (patch) | |
tree | e05bf995c9068949136f6537b8cecd80af95a9dc /drivers/media/platform/vsp1/vsp1_sru.c | |
parent | 76e48896c0b7b25a65740f03c6c5d3f35a02fd74 (diff) | |
download | linux-df32c924518716160d43defc444199e894859c08.tar.xz |
[media] v4l: vsp1: Determine partition requirements for scaled images
The partition algorithm needs to determine the capabilities of each
entity in the pipeline to identify the correct maximum partition width.
Extend the vsp1 entity operations to provide a max_width operation and
use this call to calculate the number of partitions that will be
processed by the algorithm.
Gen 2 hardware does not require multiple partitioning, and as such
will always return a single partition.
Signed-off-by: Kieran Bingham <kieran+renesas@bingham.xyz>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_sru.c')
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_sru.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c index 9d4a1afb6634..b4e568a3b4ed 100644 --- a/drivers/media/platform/vsp1/vsp1_sru.c +++ b/drivers/media/platform/vsp1/vsp1_sru.c @@ -306,8 +306,27 @@ static void sru_configure(struct vsp1_entity *entity, vsp1_sru_write(sru, dl, VI6_SRU_CTRL2, param->ctrl2); } +static unsigned int sru_max_width(struct vsp1_entity *entity, + struct vsp1_pipeline *pipe) +{ + struct vsp1_sru *sru = to_sru(&entity->subdev); + struct v4l2_mbus_framefmt *input; + struct v4l2_mbus_framefmt *output; + + input = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, + SRU_PAD_SINK); + output = vsp1_entity_get_pad_format(&sru->entity, sru->entity.config, + SRU_PAD_SOURCE); + + if (input->width != output->width) + return 512; + else + return 256; +} + static const struct vsp1_entity_operations sru_entity_ops = { .configure = sru_configure, + .max_width = sru_max_width, }; /* ----------------------------------------------------------------------------- |