[media] v4l: vsp1: Fix RPF cropping
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Mon, 12 Sep 2016 15:38:36 +0000 (12:38 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 19 Sep 2016 17:56:03 +0000 (14:56 -0300)
The RPF cropping offset for the chroma planes is incorrectly computed,
it needs to be divided by the horizontal subsampling factor.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/vsp1/vsp1_rpf.c

index 38883891320518c4352ce24645d5da5f9184017a..3d6669dbeacf5ab9aa878b92faa8820216904ffc 100644 (file)
@@ -105,7 +105,8 @@ static void rpf_configure(struct vsp1_entity *entity,
 
        if (format->num_planes > 1) {
                rpf->offsets[1] = crop->top * format->plane_fmt[1].bytesperline
-                               + crop->left * fmtinfo->bpp[1] / 8;
+                               + crop->left / fmtinfo->hsub * fmtinfo->bpp[1]
+                               / 8;
                pstride |= format->plane_fmt[1].bytesperline
                        << VI6_RPF_SRCM_PSTRIDE_C_SHIFT;
        } else {