Commit 9a0e3cd5 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab

media: rkisp1: fix grey format iommu page faults

Currently capturing grey format produces page faults
on both selfpath and mainpath. To support greyscale
we can capture YUV422 planar format and configure the U, V
buffers to the dummy buffer.
Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 5be7f8c9
...@@ -249,7 +249,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { ...@@ -249,7 +249,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
.fourcc = V4L2_PIX_FMT_GREY, .fourcc = V4L2_PIX_FMT_GREY,
.uv_swap = 0, .uv_swap = 0,
.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA, .write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV400, .output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
.mbus = MEDIA_BUS_FMT_YUYV8_2X8, .mbus = MEDIA_BUS_FMT_YUYV8_2X8,
}, },
/* rgb */ /* rgb */
...@@ -631,12 +631,26 @@ static void rkisp1_set_next_buf(struct rkisp1_capture *cap) ...@@ -631,12 +631,26 @@ static void rkisp1_set_next_buf(struct rkisp1_capture *cap)
rkisp1_write(cap->rkisp1, rkisp1_write(cap->rkisp1,
buff_addr[RKISP1_PLANE_Y], buff_addr[RKISP1_PLANE_Y],
cap->config->mi.y_base_ad_init); cap->config->mi.y_base_ad_init);
rkisp1_write(cap->rkisp1, /*
buff_addr[RKISP1_PLANE_CB], * In order to support grey format we capture
cap->config->mi.cb_base_ad_init); * YUV422 planar format from the camera and
rkisp1_write(cap->rkisp1, * set the U and V planes to the dummy buffer
buff_addr[RKISP1_PLANE_CR], */
cap->config->mi.cr_base_ad_init); if (cap->pix.cfg->fourcc == V4L2_PIX_FMT_GREY) {
rkisp1_write(cap->rkisp1,
cap->buf.dummy.dma_addr,
cap->config->mi.cb_base_ad_init);
rkisp1_write(cap->rkisp1,
cap->buf.dummy.dma_addr,
cap->config->mi.cr_base_ad_init);
} else {
rkisp1_write(cap->rkisp1,
buff_addr[RKISP1_PLANE_CB],
cap->config->mi.cb_base_ad_init);
rkisp1_write(cap->rkisp1,
buff_addr[RKISP1_PLANE_CR],
cap->config->mi.cr_base_ad_init);
}
} else { } else {
/* /*
* Use the dummy space allocated by dma_alloc_coherent to * Use the dummy space allocated by dma_alloc_coherent to
......
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