diff options
author | Dafna Hirschfeld <dafna.hirschfeld@collabora.com> | 2020-04-11 18:06:01 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-04-21 17:25:34 +0200 |
commit | d0dd92789f44cb093d1da9a68d40a5f09402462a (patch) | |
tree | 694d3145a4f94090e4fbd3abdb39a91e7dcad9a8 /drivers/staging/media/rkisp1 | |
parent | c6a86569e841259d41db81d3d8f619f205be8217 (diff) | |
download | linux-d0dd92789f44cb093d1da9a68d40a5f09402462a.tar.bz2 |
media: staging: rkisp1: cap: support uv swapped planar formats
Planar formats with the u and v planes swapped can be
supported by swapping the address of the cb and cr buffers.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/rkisp1')
-rw-r--r-- | drivers/staging/media/rkisp1/rkisp1-capture.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index 4c18b081480c..21496fb2c4da 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -738,6 +738,14 @@ static void rkisp1_vb2_buf_queue(struct vb2_buffer *vb) rkisp1_pixfmt_comp_size(pixm, RKISP1_PLANE_CB); } + /* + * uv swap can be supported for planar formats by switching + * the address of cb and cr + */ + if (cap->pix.info->comp_planes == 3 && cap->pix.cfg->uv_swap) + swap(ispbuf->buff_addr[RKISP1_PLANE_CR], + ispbuf->buff_addr[RKISP1_PLANE_CB]); + spin_lock_irqsave(&cap->buf.lock, flags); /* |