From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-qt0-f193.google.com ([209.85.216.193]:34652 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752771AbcKHHVb (ORCPT ); Tue, 8 Nov 2016 02:21:31 -0500 Received: by mail-qt0-f193.google.com with SMTP id l20so6854380qta.1 for ; Mon, 07 Nov 2016 23:21:30 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1476466481-24030-9-git-send-email-p.zabel@pengutronix.de> References: <1476466481-24030-1-git-send-email-p.zabel@pengutronix.de> <1476466481-24030-9-git-send-email-p.zabel@pengutronix.de> From: Ying Liu Date: Tue, 8 Nov 2016 15:21:29 +0800 Message-ID: Subject: Re: [PATCH v2 08/21] [media] imx: Add i.MX IPUv3 capture driver To: Philipp Zabel Cc: linux-media@vger.kernel.org, Steve Longerbeam , Marek Vasut , Hans Verkuil , Gary Bisson , kernel@pengutronix.de, Sascha Hauer , Marc Kleine-Budde Content-Type: text/plain; charset=UTF-8 Sender: linux-media-owner@vger.kernel.org List-ID: Hi Philipp, On Sat, Oct 15, 2016 at 1:34 AM, Philipp Zabel wrote: > This driver uses the IDMAC module's double buffering feature to do the > processing of finished frames in the new frame acknowledge (NFACK) > interrupt handler while the next frame is already being captured. This > avoids a race condition between the end of frame interrupt and NFACK for > very short blanking intervals, but causes the driver to need at least > two buffers in flight. The last remaining frame will never be handed out > to userspace until a new one is queued. > It supports interlaced input and allows to translate between sequential > and interlaced field formats using the IDMAC scan order and interlace > offset parameters. > Currently the direct CSI -> SMFC -> IDMAC path is supported. > > Signed-off-by: Sascha Hauer > Signed-off-by: Marc Kleine-Budde > Signed-off-by: Philipp Zabel > --- > Changes since v1: > - Remove v4l2_media_subdev_prepare_stream and v4l2_media_subdev_s_stream, > subdevices will propagate s_stream calls to their upstream subdevices > themselves. > - Fix width/height to CSI output size > - Use colorspace provided by CSI output > - Implement enum/g/s/_input for v4l2-compliance > - Fix ipu_capture_g_parm to use the correct pad > --- > drivers/media/platform/imx/Kconfig | 9 + > drivers/media/platform/imx/Makefile | 1 + > drivers/media/platform/imx/imx-ipu-capture.c | 1015 ++++++++++++++++++++++++++ > drivers/media/platform/imx/imx-ipu.h | 9 + > drivers/media/platform/imx/imx-ipuv3-csi.c | 29 +- > 5 files changed, 1061 insertions(+), 2 deletions(-) > create mode 100644 drivers/media/platform/imx/imx-ipu-capture.c > > diff --git a/drivers/media/platform/imx/Kconfig b/drivers/media/platform/imx/Kconfig > index a88c4f7..69e8648 100644 > --- a/drivers/media/platform/imx/Kconfig > +++ b/drivers/media/platform/imx/Kconfig > @@ -9,6 +9,15 @@ config MEDIA_IMX > config VIDEO_IMX_IPU_COMMON > tristate > > +config VIDEO_IMX_IPU_CAPTURE > + tristate "i.MX5/6 Video Capture driver" > + depends on IMX_IPUV3_CORE && VIDEO_V4L2_SUBDEV_API && MEDIA_IMX > + select VIDEOBUF2_DMA_CONTIG > + select VIDEO_IMX_IPU_COMMON > + select VIDEO_IMX_IPUV3 > + help > + This is a v4l2 video capture driver for the IPUv3 on i.MX5/6. > + > config VIDEO_IMX_IPU_CSI > tristate "i.MX5/6 CMOS Sensor Interface driver" > depends on VIDEO_DEV && IMX_IPUV3_CORE && MEDIA_IMX > diff --git a/drivers/media/platform/imx/Makefile b/drivers/media/platform/imx/Makefile > index 82a3616..919eaa1 100644 > --- a/drivers/media/platform/imx/Makefile > +++ b/drivers/media/platform/imx/Makefile > @@ -1,3 +1,4 @@ > obj-$(CONFIG_MEDIA_IMX) += imx-media.o > obj-$(CONFIG_VIDEO_IMX_IPU_COMMON) += imx-ipu.o > +obj-$(CONFIG_VIDEO_IMX_IPU_CAPTURE) += imx-ipu-capture.o > obj-$(CONFIG_VIDEO_IMX_IPU_CSI) += imx-ipuv3-csi.o > diff --git a/drivers/media/platform/imx/imx-ipu-capture.c b/drivers/media/platform/imx/imx-ipu-capture.c > new file mode 100644 > index 0000000..1308c1e > --- /dev/null > +++ b/drivers/media/platform/imx/imx-ipu-capture.c > @@ -0,0 +1,1015 @@ > +/* > + * i.MX IPUv3 V4L2 Capture Driver > + * > + * Copyright (C) 2016, Pengutronix, Philipp Zabel > + * > + * Based on code > + * Copyright (C) 2006, Pengutronix, Sascha Hauer > + * Copyright (C) 2008, Guennadi Liakhovetski > + * Copyright (C) 2008, Paulius Zaleckas > + * Copyright (C) 2009, Darius Augulis > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include