Commit 79b15b4b authored by Laurent Pinchart's avatar Laurent Pinchart

media: vsp1: wpf: Fix partition configuration for display pipelines

When configuring partitions for memory-to-memory pipelines, the WPF
accesses data of the current partition through pipe->partition.
Writeback support will require full configuration of the WPF while not
providing a valid pipe->partition. Rework the configuration code to fall
back to the full image width in that case, as is already done for the
part of the configuration currently relevant for display pipelines.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: default avatarKieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 437c24dd
...@@ -362,6 +362,7 @@ static void wpf_configure_partition(struct vsp1_entity *entity, ...@@ -362,6 +362,7 @@ static void wpf_configure_partition(struct vsp1_entity *entity,
const struct vsp1_format_info *fmtinfo = wpf->fmtinfo; const struct vsp1_format_info *fmtinfo = wpf->fmtinfo;
unsigned int width; unsigned int width;
unsigned int height; unsigned int height;
unsigned int left;
unsigned int offset; unsigned int offset;
unsigned int flip; unsigned int flip;
unsigned int i; unsigned int i;
...@@ -371,13 +372,16 @@ static void wpf_configure_partition(struct vsp1_entity *entity, ...@@ -371,13 +372,16 @@ static void wpf_configure_partition(struct vsp1_entity *entity,
RWPF_PAD_SINK); RWPF_PAD_SINK);
width = sink_format->width; width = sink_format->width;
height = sink_format->height; height = sink_format->height;
left = 0;
/* /*
* Cropping. The partition algorithm can split the image into * Cropping. The partition algorithm can split the image into
* multiple slices. * multiple slices.
*/ */
if (pipe->partitions > 1) if (pipe->partitions > 1) {
width = pipe->partition->wpf.width; width = pipe->partition->wpf.width;
left = pipe->partition->wpf.left;
}
vsp1_wpf_write(wpf, dlb, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN | vsp1_wpf_write(wpf, dlb, VI6_WPF_HSZCLIP, VI6_WPF_SZCLIP_EN |
(0 << VI6_WPF_SZCLIP_OFST_SHIFT) | (0 << VI6_WPF_SZCLIP_OFST_SHIFT) |
...@@ -408,13 +412,11 @@ static void wpf_configure_partition(struct vsp1_entity *entity, ...@@ -408,13 +412,11 @@ static void wpf_configure_partition(struct vsp1_entity *entity,
flip = wpf->flip.active; flip = wpf->flip.active;
if (flip & BIT(WPF_CTRL_HFLIP) && !wpf->flip.rotate) if (flip & BIT(WPF_CTRL_HFLIP) && !wpf->flip.rotate)
offset = format->width - pipe->partition->wpf.left offset = format->width - left - width;
- pipe->partition->wpf.width;
else if (flip & BIT(WPF_CTRL_VFLIP) && wpf->flip.rotate) else if (flip & BIT(WPF_CTRL_VFLIP) && wpf->flip.rotate)
offset = format->height - pipe->partition->wpf.left offset = format->height - left - width;
- pipe->partition->wpf.width;
else else
offset = pipe->partition->wpf.left; offset = left;
for (i = 0; i < format->num_planes; ++i) { for (i = 0; i < format->num_planes; ++i) {
unsigned int hsub = i > 0 ? fmtinfo->hsub : 1; unsigned int hsub = i > 0 ? fmtinfo->hsub : 1;
...@@ -436,7 +438,7 @@ static void wpf_configure_partition(struct vsp1_entity *entity, ...@@ -436,7 +438,7 @@ static void wpf_configure_partition(struct vsp1_entity *entity,
* image height. * image height.
*/ */
if (wpf->flip.rotate) if (wpf->flip.rotate)
height = pipe->partition->wpf.width; height = width;
else else
height = format->height; height = format->height;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment