From patchwork Fri Jun 17 19:01:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9184785 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 D4521608A2 for ; Fri, 17 Jun 2016 19:01:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB1E327F54 for ; Fri, 17 Jun 2016 19:01:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FE4C28327; Fri, 17 Jun 2016 19:01:51 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D67727F54 for ; Fri, 17 Jun 2016 19:01:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbcFQTBt (ORCPT ); Fri, 17 Jun 2016 15:01:49 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34148 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbcFQTBs (ORCPT ); Fri, 17 Jun 2016 15:01:48 -0400 Received: by mail-pa0-f68.google.com with SMTP id us13so6278095pab.1 for ; Fri, 17 Jun 2016 12:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to; bh=yiO48fGfmnazaQ8rhPY5VIL8vgjoM1waXqpxr/j0zt8=; b=bJXmHU2qVe/IStsruDvLhCE+r9SHbGq3cc+YKNp2QRokYa6xIX4rTvraYhCd1brzqP fin0kUkf+vnKUCqH4xTQZCeNkhN4ooRA1BSrvoXtBCAzns2Ywf2kl0SfvFqjubLEy9XM ye1YK50SeHkMSsFVA/en0WaIJltZJtWgEu08oJ7wuRPMQjLJp5jAZe9cXBa969PXy3qW gsCG5V6tqe28D3442Zy/Z++0ZJ5lAE35UIk6WCKtTiU/HWbG6K5+ZlivF8WfjELUzVSG OpPLIzJgicTWmqVnxKbnhtKSJ7UR5898nMc+SFCKdMom9Cs0696O7KUKIqkmZeJy964L nzvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to; bh=yiO48fGfmnazaQ8rhPY5VIL8vgjoM1waXqpxr/j0zt8=; b=m4hLbING80o+Y2lmmUgwy2kxLfR4AsTwWvVWb2CMbXmA9RDswNyBUptDc/jIdo0mO8 v5W3eSdY3/xY28Fgox3AIj2ohrBgaKk7KI9BYecEidpwyS2LTWsAAvEdpC2TUaYNenx5 Y/O6Y9/qA2B0EfKFidDqZ1cHLHmiCb/zSYinJc1LR9wqGNDnZ4dyDOhxbzBqDZqpzvmt JnB/1JSVb93NjPa9M6F/qQ3UYT1fALUlLy3tTFAxjhOVKqN4pNOdFPdlZt4fiz2GIBTP jD381Xn13hOWAr2Wxh+nQEur7FLp095vR5h8K2WM4Cz0rbSNWQOOjqcPHofTvWhCRyhz rZ1A== X-Gm-Message-State: ALyK8tK3nESfKWPMOvWNTcibpM6GsrwVeuJovMx7gvNIFGwkIDlMhTyaQtqW/gyI7ZwgRQ== X-Received: by 10.66.248.65 with SMTP id yk1mr3995207pac.56.1466190102872; Fri, 17 Jun 2016 12:01:42 -0700 (PDT) Received: from [192.168.1.54] (c-98-234-136-200.hsd1.ca.comcast.net. [98.234.136.200]) by smtp.gmail.com with ESMTPSA id s86sm70049980pfi.69.2016.06.17.12.01.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Jun 2016 12:01:42 -0700 (PDT) From: Steve Longerbeam Subject: Re: [19/38] ARM: dts: imx6-sabrelite: add video capture ports and connections To: Gary Bisson , Steve Longerbeam References: <1465944574-15745-20-git-send-email-steve_longerbeam@mentor.com> <20160616083231.GA6548@t450s.lan> <20160617151814.GA16378@t450s.lan> Cc: linux-media@vger.kernel.org, Jack Mitchell Message-ID: <57644915.3010006@gmail.com> Date: Fri, 17 Jun 2016 12:01:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160617151814.GA16378@t450s.lan> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 06/17/2016 08:18 AM, Gary Bisson wrote: > Steve, All, > > On Thu, Jun 16, 2016 at 10:32:31AM +0200, Gary Bisson wrote: >> Steve, All, >> >> On Tue, Jun 14, 2016 at 03:49:15PM -0700, Steve Longerbeam wrote: >>> Defines the host video capture device node and an OV5642 camera sensor >>> node on i2c2. The host capture device connects to the OV5642 via the >>> parallel-bus mux input on the ipu1_csi0_mux. >>> >>> Note there is a pin conflict with GPIO6. This pin functions as a power >>> input pin to the OV5642, but ENET requires it to wake-up the ARM cores >>> on normal RX and TX packet done events (see 6261c4c8). So by default, >>> capture is disabled, enable by uncommenting __OV5642_CAPTURE__ macro. >>> Ethernet will still work just not quite as well. >> Actually the following patch fixes this issue and has already been >> applied on Shawn's tree: >> https://patchwork.kernel.org/patch/9153523/ >> >> Also, this follow-up patch declared the HW workaround for SabreLite: >> https://patchwork.kernel.org/patch/9153525/ >> >> So ideally, once those two patches land on your base tree, you could get >> rid of the #define and remove the HW workaround declaration. >> >> Finally, I'll test the series on Sabre-Lite this week. > I've applied this series on top of Shawn tree (for-next branch) in order > not to worry about the GPIO6 workaround. > > Although the camera seems to get enumerated properly, I can't seem to > get anything from it. See log: > http://pastebin.com/xnw1ujUq Hi Gary, the driver does not implement vidioc_cropcap, it has switched to the new selection APIs and v4l2src should be using vidioc_g_selection instead of vidioc_cropcap. > > In your cover letter, you said that you have not run through > v4l2-compliance. How have you tested the capture? I use v4l2-ctl, and have used v4l2src in the past, but that was before switching to the selection APIs. Try the attached hack that adds vidioc_cropcap back in, and see how far you get on SabreLite with v4l2src. I tried the following on SabreAuto: gst-launch-1.0 v4l2src io_mode=4 ! "video/x-raw,format=RGB16,width=640,height=480" ! fbdevsink > > Also, why isn't the OV5640 MIPI camera declared on the SabreLite device > tree? See Jack Mitchell's patch at http://ix.io/TTg. Thanks Jack! I will work on incorporating it. Steve Tested-by: Gary Bisson diff --git a/drivers/staging/media/imx/capture/imx-camif.c b/drivers/staging/media/imx/capture/imx-camif.c index 9c247e0..2c51bc7 100644 --- a/drivers/staging/media/imx/capture/imx-camif.c +++ b/drivers/staging/media/imx/capture/imx-camif.c @@ -1561,6 +1561,23 @@ static int vidioc_s_parm(struct file *file, void *fh, return v4l2_subdev_call(dev->sensor->sd, video, s_parm, a); } +static int vidioc_cropcap(struct file *file, void *priv, + struct v4l2_cropcap *cropcap) +{ + struct imxcam_ctx *ctx = file2ctx(file); + struct imxcam_dev *dev = ctx->dev; + + if (cropcap->type != V4L2_BUF_TYPE_VIDEO_CAPTURE && + cropcap->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) + return -EINVAL; + + cropcap->bounds = dev->crop_bounds; + cropcap->defrect = dev->crop_defrect; + cropcap->pixelaspect.numerator = 1; + cropcap->pixelaspect.denominator = 1; + return 0; +} + static int vidioc_g_selection(struct file *file, void *priv, struct v4l2_selection *sel) { @@ -1794,6 +1811,7 @@ static const struct v4l2_ioctl_ops imxcam_ioctl_ops = { .vidioc_g_parm = vidioc_g_parm, .vidioc_s_parm = vidioc_s_parm, + .vidioc_cropcap = vidioc_cropcap, .vidioc_g_selection = vidioc_g_selection, .vidioc_s_selection = vidioc_s_selection,