From patchwork Wed Jun 22 11:52:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9192555 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0A2CB6075A for ; Wed, 22 Jun 2016 11:54:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB95C28364 for ; Wed, 22 Jun 2016 11:54:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC223283FB; Wed, 22 Jun 2016 11:54:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3F6EB28364 for ; Wed, 22 Jun 2016 11:54:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bFgi6-0000YR-VT; Wed, 22 Jun 2016 11:52:46 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bFgi3-0000Ww-E9 for linux-arm-kernel@lists.infradead.org; Wed, 22 Jun 2016 11:52:44 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 57629823C5; Wed, 22 Jun 2016 13:52:19 +0200 (CEST) Date: Wed, 22 Jun 2016 13:52:18 +0200 From: Pavel Machek To: Laurent Pinchart Subject: Re: camera application for testing (was Re: v4l subdevs without big device) Message-ID: <20160622115218.GA27606@amd> References: <20160428084546.GA9957@amd> <20160429221359.GA29297@amd> <20160501140831.GH26360@valkosipuli.retiisi.org.uk> <1500395.gQ70N9eqVS@avalon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1500395.gQ70N9eqVS@avalon> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160622_045243_655052_97AF0DE9 X-CRM114-Status: GOOD ( 19.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ivo.g.dimitrov.75@gmail.com, linux-media@vger.kernel.org, khilman@kernel.org, tony@atomide.com, mchehab@osg.samsung.com, aaro.koskinen@iki.fi, kernel list , sre@kernel.org, Hans Verkuil , Sakari Ailus , pali.rohar@gmail.com, tuukkat76@gmail.com, linux-omap@vger.kernel.org, patrikbachan@gmail.com, linux-arm-kernel , serge@hallyn.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! > > I think libv4l itself has algorithms to control at least some of these. It > > relies on the image data so the CPU time consumption will be high. > > > > AFAIR Laurent has also worked on implementing some algorithms that use the > > histogram and some of the statistics. Add him to cc list. > > http://git.ideasonboard.org/omap3-isp-live.git > > That's outdated and might not run or compile anymore. The code is > more of a Lets see, it compiles with this hack: index 6f3ffbe..935f41d 100644 Let me investigate some more. > proof of concept implementation, but it could be used as a starting point. > With an infinite amount of free time I'd love to work on an open-source > project for computational cameras, integrating it with libv4l. For the record, I pushed my code to https://gitlab.com/pavelm/fcam-dev Best regards, Pavel --- a/isp/v4l2.c +++ b/isp/v4l2.c @@ -292,7 +292,7 @@ struct v4l2_device *v4l2_open(const char *devname) * driver (>= v3.19) will set both CAPTURE and OUTPUT in the * capabilities field. */ - capabilities = cap.device_caps ? : cap.capabilities; + capabilities = /* cap.device_caps ? : */ cap.capabilities; if (capabilities & V4L2_CAP_VIDEO_CAPTURE) dev->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; I can try to run it, but I guess I'll need kernel with camera support. pavel@n900:/my/omap3-isp-live$ LD_LIBRARY_PATH=isp ./snapshot media_open: Can't open media device /dev/media0 error: unable to open media device /dev/media0 Segmentation fault (core dumped) I tried again on kernel with camera: pavel@n900:/my/omap3-isp-live$ LD_LIBRARY_PATH=isp ./snapshot error: unable to locate sensor. Segmentation fault (core dumped) pavel@n900:/my/omap3-isp-live$ Here's the fix for coredump: diff --git a/isp/subdev.c b/isp/subdev.c index 9b36234..c74514e 100644 --- a/isp/subdev.c +++ b/isp/subdev.c @@ -75,6 +75,8 @@ int v4l2_subdev_open(struct media_entity *entity) void v4l2_subdev_close(struct media_entity *entity) { + if (!entity) + return; if (entity->fd == -1) return;