Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp252209ybp; Thu, 3 Oct 2019 13:04:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqcXa6go0nEVB4eBC57yMur48N3rI3j8U06sY4R3wasdZC4JwVo+HKr/cJowzdYxa7RPHD X-Received: by 2002:aa7:cf81:: with SMTP id z1mr11485906edx.224.1570133044542; Thu, 03 Oct 2019 13:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570133044; cv=none; d=google.com; s=arc-20160816; b=Tg8vmAHBbRnMC1p++ZoR+BbfSX+ovw2OJ3OL2Gpj/8QxrAfiQuUOxu7oYuzGHEjgsS cYqp5WT0if8P8gt+cgRbS+WHRB7bOKgZh/lUilMMe8H/ccjP1M6DcuJuIhbCx1B9I8cY QhJQytyf7W0YH0M72kEfZtJVrt+5432K7A/lJhGDds3R9ac/wkLnSIVT+toYEfFx/y8g 86YNMwKtB9Ol7jU9KgTRPO22/YE+qJxfbBRmWexO1ZS3E0PSy6DSvttIWAP25GugbwbJ HjF1BIim2iZuQmawZ476h5ypp+PbltEDanCYsw5AeIX7kdZsPzKDKNLVvFl3bptupUy1 7ufg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NapHy1rPTgTDallxX4g8iFDr+uCGnEf2RFpdBhDGZzo=; b=t1cxa69EzvUvIAlGbKPGKEDf43JUZeR1zWq7r7UwSeWWYo4onZx662drdt4q209uM6 dWti5yQ1+q+ro9XfXhf9tfpr3E0CbQFkDxHfFWaaTX11I9bLYG/v3p+MshVvCp4/s/jb gg3yk0HqVggqxj/+jURgFqUbxCD2YEOQSdQm+Gov3rqbpvGezPv87dy8BxkqMVsuqsqs jkA3bfMqpg9+l9+jVQ9+bqslJH3W/efkInFHounMkJIfyAjkFPyHzts5QJqiyGt+ysQi AfYN47F1FUUSSMWYJpJM8A2qU3vBrJgqkwUX11z/7EfIfJUb5pWcEnpAYiJ/aLf4uBmK kmzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JmRIHokB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si1673576eju.311.2019.10.03.13.03.38; Thu, 03 Oct 2019 13:04:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JmRIHokB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388208AbfJCUAT (ORCPT + 99 others); Thu, 3 Oct 2019 16:00:19 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41544 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732997AbfJCUAT (ORCPT ); Thu, 3 Oct 2019 16:00:19 -0400 Received: by mail-lf1-f68.google.com with SMTP id r2so2768172lfn.8; Thu, 03 Oct 2019 13:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NapHy1rPTgTDallxX4g8iFDr+uCGnEf2RFpdBhDGZzo=; b=JmRIHokBIvo1DJcwBA6wVxzr2NF0vCRfmTDgbNOtuWwY7FsnwL9b5R6EbX0V7Q21B7 MPDWmgF7fyKUPOnKM0ugpIbFYdyuU7tbvcv5WIAaOPFU1eNmGE3azhoc69xYm+ZdaWfe NDBK86Mm35USGQIJ7NGsaXptiRcvSwKIbHX2pkXYK1o/pEbzVR9R6kC2/9nq7TmwQiyB 9kOPa4+fySrly3ceHFupVzH1W63eXj+Bp01gXi+MuqeDTail+9pERNxDIPNgiMi2ima0 YRrTL07sG/Ub7umt16iMAYUA/mJtiT4MSETdZ1W7fOVBFoi94IgoUiZ7juedBezxZDV7 D53A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NapHy1rPTgTDallxX4g8iFDr+uCGnEf2RFpdBhDGZzo=; b=WYF/ZYdZo2kdWEmE4cdiX3YtpL6ay4kghptdB1dotYOt4TKIvpPgf4sHw28Nwim7d+ d+IInQ3I3OQIZszyx1m6dhys5/xZdHjcCyXxYMI/XggDBze1zazBpUJapyl1FnmYsk/c 303xGwWe/I3elS54jcNjk5N/ZvDchxhSDq4jpWe76ZSCVnR1J/7/Ur1DIZmdrZlBQxqz z8HD9vfLNBfGGnXE/8NSiNcQbnhcvQq1qCVBI1Hom+KSO5mM+Y9G+6/bW2zovg6ipxI3 dKa552II8lG0f7Fn/j7JhTnwDu2uX7Hiip+SZaHUBGo7beXAms0ka989cTvZ2qFSnr/x ny9g== X-Gm-Message-State: APjAAAWpZWPqRcpCJfQFez3yvjA07Xg6asdfMT/xwD2c/B/PPMAblpjX MngQNqJbVyfdrqXmNkiGMGjIUIzw2uHR0PkWprA= X-Received: by 2002:a19:f247:: with SMTP id d7mr6543695lfk.191.1570132816333; Thu, 03 Oct 2019 13:00:16 -0700 (PDT) MIME-Version: 1.0 References: <20191003144624.17899-1-daniel@qtec.com> In-Reply-To: <20191003144624.17899-1-daniel@qtec.com> From: Ricardo Ribalda Delgado Date: Thu, 3 Oct 2019 21:59:59 +0200 Message-ID: Subject: Re: [PATCH] media: imx214: Fix stop streaming To: Daniel Gomez Cc: Mauro Carvalho Chehab , linux-media , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ups.... sorry about that. Hopefully it works fine also without the patch, but it needs to be fixed. On Thu, Oct 3, 2019 at 4:46 PM Daniel Gomez wrote: > > Stop video streaming when requested. > > When s_stream is called to stop the video streaming, if/else condition calls > start_streaming function instead of the one for stopping it. > > Fixes: 436190596241 ("media: imx214: Add imx214 camera sensor driver") > Signed-off-by: Daniel Gomez Signed-off-by: Ricardo Ribalda > --- > > You can find some logs before/after running in the hardware. Notice 0x100 > register is for starting/stopping the video streaming from the imx214 sensor. > > * Before patch: > > # media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]' > # media-ctl -d /dev/media0 -V '"imx214 3-001a":0[fmt:SRGGB10/1920x1080],"msm_csiphy0":0[fmt:SRGGB10/1920x1080],"msm_csid0":0[fmt:SRGGB10/1920x1080],"msm_ispif0":0[fmt:SRGGB10/1920x1080],"msm_vfe0_rdi0":0[fmt:SRGGB10/1920x1080]' > # yavta -f SRGGB10P -s 1920x1080 -n 1 --capture=5 /dev/v4l/by-path/platform-a34000.camss-video-index0 > Device /dev/v4l/by-path/platform-a34000.camss-video-index0 opened. > Device `Qualcomm Camera Subsystem' on `platform:a34000.camss' (driver 'qcom-camss') supports video, capture, with mplanes. > Video format set: SRGGB10P (41415270) 1920x1080 field none, 1 planes: > * Stride 2400, buffer size 2592000 > Video format: SRGGB10P (41415270) 1920x1080 field none, 1 planes: > * Stride 2400, buffer size 2592000 > 1 buffers requested. > length: 1 offset: 4093609832 timestamp type/source: mono/EoF > Buffer 0/0 mapped at address 0xffff84b6b000. > 0 (0) [-] none 0 2592000 B 30.682759 30.705111 4.697 fps ts mono/EoF > 1 (0) [-] none 1 2592000 B 30.749391 30.771609 15.008 fps ts mono/EoF > 2 (0) [-] none 2 2592000 B 30.816042 30.838225 15.004 fps ts mono/EoF > 3 (0) [-] none 3 2592000 B 30.882690 30.904992 15.004 fps ts mono/EoF > 4 (0) [-] none 4 2592000 B 30.949333 30.971543 15.005 fps ts mono/EoF > Captured 5 frames in 0.501681 seconds (9.966480 fps, 0.000000 B/s). > 1 buffers released. > # v4l2-dbg -d /dev/v4l-subdev19 -g 0x100 > ioctl: VIDIOC_DBG_G_REGISTER > Register 0x00000100 = 1h (1d 00000001b) > > * After patch: > > # media-ctl -d /dev/media0 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_rdi0":0[1]' > # media-ctl -d /dev/media0 -V '"imx214 3-001a":0[fmt:SRGGB10/1920x1080],"msm_csiphy0":0[fmt:SRGGB10/1920x1080],"msm_csid0":0[fmt:SRGGB10/1920x1080],"msm_ispif0":0[fmt:SRGGB10/1920x1080],"msm_vfe0_rdi0":0[fmt:SRGGB10/1920x1080]' > # yavta -f SRGGB10P -s 1920x1080 -n 1 --capture=5 /dev/v4l/by-path/platform-a34000.camss-video-index0 > Device /dev/v4l/by-path/platform-a34000.camss-video-index0 opened. > Device `Qualcomm Camera Subsystem' on `platform:a34000.camss' (driver 'qcom-camss') supports video, capture, with mplanes. > Video format set: SRGGB10P (41415270) 1920x1080 field none, 1 planes: > * Stride 2400, buffer size 2592000 > Video format: SRGGB10P (41415270) 1920x1080 field none, 1 planes: > * Stride 2400, buffer size 2592000 > 1 buffers requested. > length: 1 offset: 3764913896 timestamp type/source: mono/EoF > Buffer 0/0 mapped at address 0xffffb62f7000. > 0 (0) [-] none 0 2592000 B 31.283473 31.306390 4.697 fps ts mono/EoF > 1 (0) [-] none 1 2592000 B 31.350115 31.372475 15.006 fps ts mono/EoF > 2 (0) [-] none 2 2592000 B 31.416765 31.439728 15.004 fps ts mono/EoF > 3 (0) [-] none 3 2592000 B 31.483410 31.505791 15.005 fps ts mono/EoF > 4 (0) [-] none 4 2592000 B 31.550058 31.573025 15.004 fps ts mono/EoF > Captured 5 frames in 0.502440 seconds (9.951430 fps, 0.000000 B/s). > 1 buffers released. > # v4l2-dbg -d /dev/v4l-subdev19 -g 0x100 > ioctl: VIDIOC_DBG_G_REGISTER > Register 0x00000100 = 0h (0d 00000000b) > > drivers/media/i2c/imx214.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c > index 159a3a604f0e..24659cb0d083 100644 > --- a/drivers/media/i2c/imx214.c > +++ b/drivers/media/i2c/imx214.c > @@ -785,7 +785,7 @@ static int imx214_s_stream(struct v4l2_subdev *subdev, int enable) > if (ret < 0) > goto err_rpm_put; > } else { > - ret = imx214_start_streaming(imx214); > + ret = imx214_stop_streaming(imx214); > if (ret < 0) > goto err_rpm_put; > pm_runtime_put(imx214->dev); > -- > 2.20.1 > -- Ricardo Ribalda