Commit 857161fc authored by Takanari Hayama's avatar Takanari Hayama Committed by Mauro Carvalho Chehab

[media] v4l: vsp1: Reset VSP1 RPF source address

Source address of VSP1 RPF needs to be reset whenever crop offsets are
recalculated.

This correctly reflects a crop setting even VIDIOC_QBUF is called
before VIDIOC_STREAMON is called.
Signed-off-by: default avatarTakanari Hayama <taki@igel.co.jp>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 32d17597
...@@ -106,11 +106,22 @@ static int rpf_s_stream(struct v4l2_subdev *subdev, int enable) ...@@ -106,11 +106,22 @@ static int rpf_s_stream(struct v4l2_subdev *subdev, int enable)
+ crop->left * fmtinfo->bpp[0] / 8; + crop->left * fmtinfo->bpp[0] / 8;
pstride = format->plane_fmt[0].bytesperline pstride = format->plane_fmt[0].bytesperline
<< VI6_RPF_SRCM_PSTRIDE_Y_SHIFT; << VI6_RPF_SRCM_PSTRIDE_Y_SHIFT;
vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y,
rpf->buf_addr[0] + rpf->offsets[0]);
if (format->num_planes > 1) { if (format->num_planes > 1) {
rpf->offsets[1] = crop->top * format->plane_fmt[1].bytesperline rpf->offsets[1] = crop->top * format->plane_fmt[1].bytesperline
+ crop->left * fmtinfo->bpp[1] / 8; + crop->left * fmtinfo->bpp[1] / 8;
pstride |= format->plane_fmt[1].bytesperline pstride |= format->plane_fmt[1].bytesperline
<< VI6_RPF_SRCM_PSTRIDE_C_SHIFT; << VI6_RPF_SRCM_PSTRIDE_C_SHIFT;
vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C0,
rpf->buf_addr[1] + rpf->offsets[1]);
if (format->num_planes > 2)
vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_C1,
rpf->buf_addr[2] + rpf->offsets[1]);
} }
vsp1_rpf_write(rpf, VI6_RPF_SRCM_PSTRIDE, pstride); vsp1_rpf_write(rpf, VI6_RPF_SRCM_PSTRIDE, pstride);
...@@ -179,6 +190,13 @@ static void rpf_vdev_queue(struct vsp1_video *video, ...@@ -179,6 +190,13 @@ static void rpf_vdev_queue(struct vsp1_video *video,
struct vsp1_video_buffer *buf) struct vsp1_video_buffer *buf)
{ {
struct vsp1_rwpf *rpf = container_of(video, struct vsp1_rwpf, video); struct vsp1_rwpf *rpf = container_of(video, struct vsp1_rwpf, video);
unsigned int i;
for (i = 0; i < 3; ++i)
rpf->buf_addr[i] = buf->addr[i];
if (!vsp1_entity_is_streaming(&rpf->entity))
return;
vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y, vsp1_rpf_write(rpf, VI6_RPF_SRCM_ADDR_Y,
buf->addr[0] + rpf->offsets[0]); buf->addr[0] + rpf->offsets[0]);
......
...@@ -39,6 +39,7 @@ struct vsp1_rwpf { ...@@ -39,6 +39,7 @@ struct vsp1_rwpf {
struct v4l2_rect crop; struct v4l2_rect crop;
unsigned int offsets[2]; unsigned int offsets[2];
dma_addr_t buf_addr[3];
}; };
static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev) static inline struct vsp1_rwpf *to_rwpf(struct v4l2_subdev *subdev)
......
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