media: rockchip: cif: fix the bug that dummpy buffer size is error

Change-Id: I8826e3452a3bd460b331a1adfceebffb6469a1a2
Signed-off-by: Xu Hongfei <xuhf@rock-chips.com>
This commit is contained in:
Xu Hongfei
2019-07-08 15:48:41 +08:00
committed by Tao Huang
parent d685f55605
commit 1716bf4200
2 changed files with 12 additions and 0 deletions

View File

@@ -943,6 +943,7 @@ static void rkcif_buf_queue(struct vb2_buffer *vb)
static int rkcif_create_dummy_buf(struct rkcif_stream *stream)
{
u32 fourcc;
struct rkcif_dummy_buffer *dummy_buf = &stream->dummy_buf;
struct rkcif_device *dev = stream->cifdev;
@@ -951,6 +952,16 @@ static int rkcif_create_dummy_buf(struct rkcif_stream *stream)
stream->pixm.height,
stream->pixm.plane_fmt[1].sizeimage,
stream->pixm.plane_fmt[2].sizeimage);
/*
* rk cif don't support output yuyv fmt data
* if user request yuyv fmt, the input mode must be RAW8
* and the width is double Because the real input fmt is
* yuyv
*/
fourcc = stream->cif_fmt_out->fourcc;
if (fourcc == V4L2_PIX_FMT_YUYV || fourcc == V4L2_PIX_FMT_YVYU ||
fourcc == V4L2_PIX_FMT_UYVY || fourcc == V4L2_PIX_FMT_VYUY)
dummy_buf->size *= 2;
dummy_buf->vaddr = dma_alloc_coherent(dev->dev, dummy_buf->size,
&dummy_buf->dma_addr,

View File

@@ -18,6 +18,7 @@
*3. Support cif works with mipi channel for rk3288
*4. Support switching between oneframe and pingpong for cif
*5. Support sampling raw data for cif
*6. fix the bug that dummpy buffer size is error
*/
#define RKCIF_DRIVER_VERSION KERNEL_VERSION(0, 1, 0x2)