summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vsp1/vsp1_uds.c
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham+renesas@ideasonboard.com>2017-08-04 19:32:42 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-08-20 16:31:35 +0300
commit40650268787afed3600e91599b7d8570be42bf96 (patch)
tree15b0b76c1f42c78a7f6afcedccbb52186ef4d5b4 /drivers/media/platform/vsp1/vsp1_uds.c
parent62dad91c29f36799bf778178f52864a749603d4f (diff)
downloadlinux-40650268787afed3600e91599b7d8570be42bf96.tar.xz
media: v4l: vsp1: Move partition rectangles to struct and operate directly
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. As partitions only have horizontal coordinates, store the left and width values only. When generating the partition windows, operate directly on the partition struct rather than copying and duplicating the processed data Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vsp1/vsp1_uds.c')
-rw-r--r--drivers/media/platform/vsp1/vsp1_uds.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_uds.c b/drivers/media/platform/vsp1/vsp1_uds.c
index 4226403ad235..4a43e7413b68 100644
--- a/drivers/media/platform/vsp1/vsp1_uds.c
+++ b/drivers/media/platform/vsp1/vsp1_uds.c
@@ -271,23 +271,25 @@ static void uds_configure(struct vsp1_entity *entity,
unsigned int vscale;
bool multitap;
+ input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config,
+ UDS_PAD_SINK);
+ output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config,
+ UDS_PAD_SOURCE);
+
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->width
+ << VI6_UDS_CLIP_SIZE_HSIZE_SHIFT) |
+ (output->height
+ << VI6_UDS_CLIP_SIZE_VSIZE_SHIFT));
return;
}
if (params != VSP1_ENTITY_PARAMS_INIT)
return;
- input = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config,
- UDS_PAD_SINK);
- output = vsp1_entity_get_pad_format(&uds->entity, uds->entity.config,
- UDS_PAD_SOURCE);
-
hscale = uds_compute_ratio(input->width, output->width);
vscale = uds_compute_ratio(input->height, output->height);