From patchwork Thu Jun 27 18:55:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020309 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BD3014C0 for ; Thu, 27 Jun 2019 18:57:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E37E26E4A for ; Thu, 27 Jun 2019 18:57:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3CA32851E; Thu, 27 Jun 2019 18:57:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 82B5A26E4A for ; Thu, 27 Jun 2019 18:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbfF0S5I (ORCPT ); Thu, 27 Jun 2019 14:57:08 -0400 Received: from mout.gmx.net ([212.227.15.15]:54605 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbfF0S5H (ORCPT ); Thu, 27 Jun 2019 14:57:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661809; bh=JJVkmfbW6N0NvT9ruDXhbQcny8kYrpPTfEhBaZDhb3M=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=kneeQV6aiwq//qL0SNrWVx6slJXGkEW+5JAbrO95yJvzJEpH3iP84+GHT8p5skE4Y fE1ZprQ7AZPyWj4wu6WPODAhHvWwi4DnHdVDBIao+EE0E8fD+BcQ8gI+Wqn3qWU0k7 F+l6CprxzwWm3zH7Ykhz5cRCWl6bwjPoR+J+OQNo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LZhsq-1iPr4u3QI0-00lUJz; Thu, 27 Jun 2019 20:56:48 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 01/31] staging: bcm2835-camera: Ensure H264 header bytes get a sensible timestamp Date: Thu, 27 Jun 2019 20:55:58 +0200 Message-Id: <1561661788-22744-2-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:WAIkKWpwVdxTM/+coczNlxmlJbV5WdBPgtR/3uHZeto+K08Eclu svQNmXV5h9vW+mdUk9XfNzTa76HYH94DgyrcbG9ysEHKf7Y7q5mwONpBh2f1zxUXNKRDk7J 94I1oiiLSSgAG3KMoByyQOHl1c6eYOj+CEvhHGREnO/EfomE/znzsLsSiUwtvpGEs9f2/+/ AGHU7n95xzI6TFywU3VNg== X-UI-Out-Filterresults: notjunk:1;V03:K0:gswxCD8kVYE=:xiyG4+ypd7rsY7IMwgK+p9 oSpNQ4FmJeADjcHkrPLX37xpNApU771sNLIElrvDrdbt8aFoG94JIIYdsmhS+oiIgUMcVWtU3 cI6IaQndpj+QeBrx9M8iGWR8SnsnzOV1Wf6RItduKoUcmoM1MzYtt0V6liCThgGksM4C/zztN hzHI1gq0BSB4x2KGDQ5ryUbZYU5uj7EXZ60VDCSIkLHZfyFo7dtXPS30G3y4pz4cpRXVSh/40 SnB6X91zO2glqAouKv5FaWM3id8lVEdRKIzODu4KNDf0cggODa+V46K/y815su2KCLoTr06dw ngCgqnMnAMv9B8FsdNeZ/ccFl40Genrwf3zqBVWMVUb4gr1rfCGHDCYNLfUkCMkkfvbvZGlQn wxjMggZ0xdLJZkq6/Js4UY6n5iaoO5vc1btBk9DvTe3vBindkHbRmz9GnkXLUP2tjz7Lv83zg aZ+uKuipihzvA06ef2IdYWUZzvfCUzm8CIsxq3nAKFO3UW6lPhcPmvA3OFcpv+AU9FByZAD95 NugRbunYJdQhAEsJwMwH8fsuTIu+JGz/dpeqkNQd+etIOCIrcXhue+HcwOWV/0xqfhROfNX4o VsXZMMFwIWZIAk49BbUI3CV70OtBxzIYN+yyMEQF0HVFi+Uhcj9BcDUlmOOpfnOao+t/d/QLH UcOvv1heFDn8+BF1laIZoBq2m6m7iNtt1OxKZry0ykprLdrfG54EeDm03oPN3ktaHIoP5AYEA jK6UMwtNFdlzFmj8empbxqG3//mloU0ioeswXeIakZBJHfnlAYVNcMiP/uCzKZ1CPqrQulzkf zF3avInqa/R1xxsu1nHLsDBKj0fLrQQa1RYCiDU1bzvsUq/kcafC38nHYAguVbK6zf8LchGVE 6qmNt0Qk964u2AiR55D8EO8cBJT1VWse867szrgRnkIxAT8TN+Kk4ab4SGs9mVWM+EqInEHjG j4WIfAwqc2woBd8kYGvqTfF7gafKbBi0E9vQsu2xve4hXuvvrQmR+M6pv8ZCX3/uq7QHWG72G C7nnGhX3kAzu+xPncLrChstdqoorQ9UgsyGkmC/fH9cfGaaVS01vTeEhUFzKbicahvx9FX5zu frldOegjUoid+Y= 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 From: Dave Stevenson H264 header come from VC with 0 timestamps, which means they get a strange timestamp when processed with VC/kernel start times, particularly if used with the inline header option. Remember the last frame timestamp and use that if set, or otherwise use the kernel start time. Link: https://github.com/raspberrypi/linux/issues/1836 Signed-off-by: Dave Stevenson --- .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 14 ++++++++++++-- .../staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index dce6e6d..0c04815 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -359,7 +359,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, } } else { if (dev->capture.frame_count) { - if (dev->capture.vc_start_timestamp != -1 && pts) { + if (dev->capture.vc_start_timestamp != -1) { + buf->vb.vb2_buf.timestamp = ktime_get_ns(); + } else if (pts) { ktime_t timestamp; s64 runtime_us = pts - dev->capture.vc_start_timestamp; @@ -372,8 +374,15 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, ktime_to_ns(timestamp)); buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); } else { - buf->vb.vb2_buf.timestamp = ktime_get_ns(); + if (dev->capture.last_timestamp) { + buf->vb.vb2_buf.timestamp = + dev->capture.last_timestamp; + } else { + buf->vb.vb2_buf.timestamp = + ktime_to_ns(dev->capture.kernel_start_ts); + } } + dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); @@ -541,6 +550,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) dev->capture.vc_start_timestamp, parameter_size); dev->capture.kernel_start_ts = ktime_get(); + dev->capture.last_timestamp = 0; /* enable the camera port */ dev->capture.port->cb_ctx = dev; diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index 2b5679e..09273b0 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -90,6 +90,8 @@ struct bm2835_mmal_dev { s64 vc_start_timestamp; /* Kernel start timestamp for streaming */ ktime_t kernel_start_ts; + /* Timestamp of last frame */ + u64 last_timestamp; struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ From patchwork Thu Jun 27 18:55:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C47914C0 for ; Thu, 27 Jun 2019 18:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 247B71FFE6 for ; Thu, 27 Jun 2019 18:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1900026E4A; Thu, 27 Jun 2019 18:57:17 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 BFA91271FD for ; Thu, 27 Jun 2019 18:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726596AbfF0S5P (ORCPT ); Thu, 27 Jun 2019 14:57:15 -0400 Received: from mout.gmx.net ([212.227.15.18]:37311 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbfF0S5O (ORCPT ); Thu, 27 Jun 2019 14:57:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661809; bh=lZmOeAftlgqo1vdHP3EjpsXSMad709JwC3ovNFUjiwQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=YlYRsrJx3moT3XGmZzynd1klvf22rerTxmigVrvdXQWeUPm0hCd/v2PaVgW3NzYLe s2qmVG6OPIS/o3vh+X6K4xiE8QVzr+RzviwTjTZYPAlsXYEBWeEGKgKfEuxyHtldvU DWJc6xDjkUpBtpljK/+sU26VeQzlFWdQtWaGur5k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M9ra4-1hrcBl0tDc-00B3Zb; Thu, 27 Jun 2019 20:56:49 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 02/31] staging: bcm2835-camera: Check the error for REPEAT_SEQ_HEADER Date: Thu, 27 Jun 2019 20:55:59 +0200 Message-Id: <1561661788-22744-3-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:xRoSxi74f4luJ+Wk+0kZTsX3xHfSkTrMrkgOD1IOPvxzVJjunLe uZ+aAlxUHYIg6CvrOviaV/iIGAl9mLUUr3noPuL5j2LLEUogEle+eM280eSTHoYX0PQE3O4 K1AViH65lOMhThZSKZA5BRSUzVHQtv4k4wCA5YvrJsvrbd+0urJdyCWB61pL8szP6DZ/NFx ZrjMX6kZR6umiAFEOP7Eg== X-UI-Out-Filterresults: notjunk:1;V03:K0:L8WFhcwKCGs=:Ys1zgqTPTO+npU8LQsHmfC 1d48g2/7lNUJALcj5MPVIlqzwiV0dJcDISjgjozwjyoJcPdkJ602j+CUQ8DxPRl/VO9j0XPSB tOxdrTQK+Irfqkx1cWFMXNB4H3Bjam6DVLxPD8N4AKp8OY6nlbjzx6gAKMc9Cf6iEm4n2Vckk dDiiLeXYnhaphVOEzjOA5WxGtPSpuROzohdTRHE69Y8BxDvQ/5PVnT8md8hYg2jI1hXBgOQU3 RMRDVeDbCvZ3lWHNgLGKc9xoVckFEojTXTpe++Kww0L93NhtGCCzEcDx2BeHZ2xDVIAkk+NAu 4JTJhHFKr7YzJFJrk2uoWop3R4E/YlZP18tKKx7VFfOM3D4I4yTsOK8qM04RbZ30dutE4AWww LNtrCz+qqYszluUR4WkjXnqtGkk4j/LzOqW4SpI5DFECQ/e7++x22lPJorQpRI3Sy5u32KN+b dlbts5kFLZMr6wsVG3Y3+KLxgHk3pP7VEyDCHKf2tLpZ2NC2QmZteTqS0mpuhbju0z9RyRSW9 gFY8h5Jl1wYWHXWB8dMYONiU6foQbUkbjIm0ioO+G0q7+swx8rKdsIL9ZmZOL+zMbqHXlxVZ+ UNUkpq34PifnperGy9ijc9nX1I07ZsjuGWV9E2NsX8Y4EBf8Pt/D2DCUgiWvVCdMcaeIb68ek FLn0R4kBlMSoRFk38lNN8AKEeO2MLvqLMsN4/QJZQ6B+iKhRFFjJ1JRmAPcHiWCrIUfVm/GYB CzL+oUEq+eu7Di9KxG0C3DqS4H1DIbIQydU7BrVmabeESvALAuwFD4MszV8lXMOkKRCcrhu7d K9iV5xY3TA/0N9ohy1x4z5+xN0UBfLbEanZXKIxn8MAH7TxcLTLb8/Yng3mFiVSPPkUhtuk85 hp/g6vjkKFtF4QjM2I+/3D2gK5jNmeQtXooSfaxfFi0R3stSC569J8GIHS8TwhNZx1m8kkV0d SRTnsJ8FMdJAi6Udk7s99uqNGT7t8wW2bp71FkQ6tEidrnnPB1D9+TRJlxX3L1BZEr5089LJv YRxTp5ARi7MSfalo6ZbNbXawbN7fyYOD7Fe/xbJAycKkP4mMrSZehY9Kj+Eu0ylxvMvLQJGVy +ssb39vGj+6PBo= 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 From: Dave Stevenson When handling for V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER was added the firmware would reject the setting if H264 hadn't already been selected. This was fixed in the firmware at that point, but to enable backwards compatibility the returned error was ignored. That was Dec 2013, so the chances of having a firmware that still has that issue is so close to zero that the workaround can be removed. Link: https://github.com/raspberrypi/linux/pull/2782/ Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/controls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index c251164..133aa6e 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -1124,7 +1124,7 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { 0, 1, NULL, MMAL_PARAMETER_VIDEO_ENCODE_INLINE_HEADER, ctrl_set_video_encode_param_output, - true /* Errors ignored as requires latest firmware to work */ + false }, { V4L2_CID_MPEG_VIDEO_H264_PROFILE, From patchwork Thu Jun 27 18:56:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68F2614C0 for ; Thu, 27 Jun 2019 18:57:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F80128520 for ; Thu, 27 Jun 2019 18:57:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 537062851E; Thu, 27 Jun 2019 18:57:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 EC66A26E4A for ; Thu, 27 Jun 2019 18:57:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726579AbfF0S5N (ORCPT ); Thu, 27 Jun 2019 14:57:13 -0400 Received: from mout.gmx.net ([212.227.15.19]:56599 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbfF0S5M (ORCPT ); Thu, 27 Jun 2019 14:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661809; bh=jFtiONca1hdVFxm/usbMzIOKsZXNfYtIs0InExv49OQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=D2n/GfnRCEz2ywceZA/kKouLEZ8IkCehCjlO5aCmz5+tC8z030yAjvdqyB0woCQeN H09IhGDFTlzXp9AbFu9SJX3i2YwAk1/NGSQ1+j+NCrJwtEvKmh9tgOeu+CTO3Renvy fzrN02XCH8IWytAfITKVaxSZm8rhnIDEreVKRfko= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M92lh-1hqF922WeD-00CQcQ; Thu, 27 Jun 2019 20:56:49 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 03/31] staging: bcm2835-camera: Replace spinlock protecting context_map with mutex Date: Thu, 27 Jun 2019 20:56:00 +0200 Message-Id: <1561661788-22744-4-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:D2AkJfxcnXtCj6sokPxOpiTqs4No+MBrwT2O1aUmi8Tnu7VKWpY ZFyRQTMI7ZkQVPnbVGSo2fbjdP/sTozwpiHjpLkN4cGBYUtit3jU8k6ejuGXndm024u31kq CEMvzZJtgy68BFC4kNFKSOKqeMU56wyUQr1OTrnVo/ptijmkU1vNNLav5iuMGT5yAsO/KKl mOW8FQsL6mvuvLq2Hd5Wg== X-UI-Out-Filterresults: notjunk:1;V03:K0:YoEFoI43RE0=:uqiLpOzWe7CCbDvKSmvf4u hv6fV2QWvbr6aOXQD1uX8MtNNg4lU2dk3lQFsfOA7Meu1Pn79kuJnEe08ilfhnMeQpwzmkbMD TTdRUaCm0ntceexWCPrXahYEgeAzp7TeH2eEL9LHNHdh/Tm1fUupwq2Tzv4tZrBGX1bhRn0Kw V2XOP0rE07+F8dS5YLd5nREB+Z4KqIG5Wny37p62GEK0lfyN/mIBLoq7R6m5IPJ3gPG26ienD hJg9N9oyV4VhrKmTDEb4dCdfhQnIKCD9MWAAzA4jeSvN95bZ+aTRnTNpnRxWSkS4ZfvGUZet5 BernveDdnDGOR3W9W/nN+aH0zZnBITGvFNV0Ctnc0m0GJ3wciwIfZfYKNoV7TRuJKtH9G0dwm Gf1Rsc96auPYWwGGw0qnBeY+nj5yZeSVNJoqfYutoSoYvFtIcwlfDtn6r0+KUH4NHfzYKFXDF +QzjdCKEADgsVpF+w2J/m7pYLj+6NTCE536Qwf2ATTHxjeN2DK8PP0P0xdrtXW6J8ob6UQpzJ aYVIXFUiw/KTdc94/LDrbwix9ehCsdtWfglwLjVEoZRjWe2M7/V9cXSKCAkCjRqqxABbKS//s cFmgH7rLOo45JZQiDU3Ph0c9ZAOdt4tk5rrc4HMK4IA1/Y5OGb272uohTkfZc8+OsuzPsCwdU JTZ+tJW9TKlMxcKqgoBPj2znffLz9ZkBReeFgxacfR8yEY48M6x7mLaybZZbMUyalldj56jGu ugn05DtisHQ3NQtsAe7ExK5Ql4d1snFZKfXg2dipIzUv+ePlv/tsDSd/f4fYHjIr1BFf+ACA5 uUaQHjSfmPBEEXEdt9xoayihczLwsbDSFkPNtooeSWW68mcTdloMXaexBfMYY5RtzssS4KsHI j/hVtzOa97dzujhsSCXqJ3xV+tETDYzIkC3tmmJkMSinxsJOEb8JDuGPRrM9MwZvSRMpHCIO9 Ne0uTNT5KJ/ilJVdNLXLCsqc1DIv1AG/ytGM6zhRVNGmvHB+0EnCoSyHIeMolWrbMaBcvn60x pTdHScginuRG8EVT4wxqihbRRwPjOuAW1o7qExTSK98mJCmGFSJY8gmavl+8/K44NSBb6TYpj BMG0VCs1qIKoKo= 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 From: Dave Stevenson The commit "staging: bcm2835-camera: Replace open-coded idr with a struct idr." replaced an internal implementation of an idr with the standard functions and a spinlock. idr_alloc(GFP_KERNEL) can sleep whilst calling kmem_cache_alloc to allocate the new node, but this is not valid whilst in an atomic context due to the spinlock. There is no need for this to be a spinlock as a standard mutex is sufficient. Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.") Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 16af735..f1bb900 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -161,7 +161,8 @@ struct vchiq_mmal_instance { void *bulk_scratch; struct idr context_map; - spinlock_t context_map_lock; + /* protect accesses to context_map */ + struct mutex context_map_lock; /* component to use next */ int component_idx; @@ -184,10 +185,10 @@ get_msg_context(struct vchiq_mmal_instance *instance) * that when we service the VCHI reply, we can look up what * message is being replied to. */ - spin_lock(&instance->context_map_lock); + mutex_lock(&instance->context_map_lock); handle = idr_alloc(&instance->context_map, msg_context, 0, 0, GFP_KERNEL); - spin_unlock(&instance->context_map_lock); + mutex_unlock(&instance->context_map_lock); if (handle < 0) { kfree(msg_context); @@ -211,9 +212,9 @@ release_msg_context(struct mmal_msg_context *msg_context) { struct vchiq_mmal_instance *instance = msg_context->instance; - spin_lock(&instance->context_map_lock); + mutex_lock(&instance->context_map_lock); idr_remove(&instance->context_map, msg_context->handle); - spin_unlock(&instance->context_map_lock); + mutex_unlock(&instance->context_map_lock); kfree(msg_context); } @@ -1849,7 +1850,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) instance->bulk_scratch = vmalloc(PAGE_SIZE); - spin_lock_init(&instance->context_map_lock); + mutex_init(&instance->context_map_lock); idr_init_base(&instance->context_map, 1); params.callback_param = instance; From patchwork Thu Jun 27 18:56:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 708FF14C0 for ; Thu, 27 Jun 2019 18:57:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6752A1FFE6 for ; Thu, 27 Jun 2019 18:57:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B80027FC0; Thu, 27 Jun 2019 18:57:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 9C6A21FFE6 for ; Thu, 27 Jun 2019 18:57:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726597AbfF0S5Q (ORCPT ); Thu, 27 Jun 2019 14:57:16 -0400 Received: from mout.gmx.net ([212.227.15.15]:34291 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbfF0S5P (ORCPT ); Thu, 27 Jun 2019 14:57:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661810; bh=yz9ARinC93og+5jnEIbXwHj/wwjzpB1P6r189rBFmnA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=JmZdPjvJMhyeNhR2D+BN3g9qLceztN6NcA3URY76jvLgAgzc5l18ROHoTbxjm2skr ZrpZ0f1kyHmjpl7uDjzW+4dw7Uq0+HEUmDHUVvT76YcYfihyoJ45kv5mBSkwkA0yc4 +cfmPBI77doKFgp2vIINtP37cwli/EkomJvLrHS0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Meg8W-1hw21a04DY-00OGyR; Thu, 27 Jun 2019 20:56:50 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 04/31] staging: bcm2835-camera: Do not bulk receive from service thread Date: Thu, 27 Jun 2019 20:56:01 +0200 Message-Id: <1561661788-22744-5-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:IYmTXewCTBPdP7XHifBO0a02+9akpP8FpA6NR/xAJmt0DQgv9h4 9YdL+mb7XEvg0lGA7PqRPs0GjfQNr4mp3qeQ7fRrHNa231WcijKkL6F41PUfLoYgUt9lQDf 33KdXe19iGJMwnoQXX2jqFlA0twde1eyYqdPvBKx2KVoxbWeTZmEVJirnp//gnXZw49496Z m7XRSV5YazjGGRT1MXFmA== X-UI-Out-Filterresults: notjunk:1;V03:K0:X4zk92MyG2g=:f96coLNfkaoQCRIC/4Mc06 pvUb1YcnKh/ulqvDeoshWXjyFNkPVgUsgznngJqQj5fBiuDmGFmBp1E/PPLesUHwr3rEkcdsF mJpVO661a/cM9beCZf1Fb7HAMfKKVBRHNLTIkyX7USej/ICDBU2PRL0pj14vTpZHt9o+wFGSe HjNwtkDsX8Af4U1aoPB3NR9uWsj1J0x/QiHtk6KSBxiRAIQiw1ZiNAaNk64E1ViB0wBpTo2fG UVHspJIZm7xUumaYVcIUkJQJW54XCwyXEeXKun7ZsGzNirKitsyALS4sRwKDvqdHHgKAQC+E1 xawtHHVJUtgCY1NUOk65U8tw5JqlS6m+ikUaLkWAyEv/X1HBeyzlaUDwZv/5LwCkMXmhiV51n nFDHOLAm8uaiUquRASqQ00fGubd4pylsT+MDTqFCGmErQ3DHgPVeloQtTPspmNHAL7xCbAsZa H+C6yVRTDfQkJvNVi3AA+mfJZBl5zi87nXVDZcTJcdXI+fVG4vySZUKdpnnVSbWNEqUD29UK8 DOsC3SseYsGgs3BWM0yVxIqaC8k37jK6nV4i3nFRaybMUBzsvwKdACHxNNt8x/Boi2AAUYt9X 6KWl7F+c/8P59NiE+/gswOIz9uTiTMtsEBhvNIaYz6R9nrJspwnJrbJC9fcafJWqncwGkP+tw yS+AClWrQcdzExS13K7J8qqTZVg02FxzZVfYWAVEYvv4D3NPrvQTfCoASzKgZdb7klf2M6yhj gkXQ+M+9mY6YyGXq6MUm9OT2U4XuVfWJCQzkov54RdhawWS+muB/iQ60ZoZDaqOkOptkKFu0d rQdoWKm7/+W9SaeEVMWLRv9SASxee+knkqSJvcLOnsuxpMF4zn+2uZ4mpBbjqsBv+5uTIODh+ QEguQ4RNv8nXFysL9gbMReI6k+Iy6EHfM/DBnLV7VnGDP1k77nvsLXrj0h5UGVdOJY2T9s2sV 52EvEdPbWskxnrMB+T9GPgo4XHNp8Jlt+lgTywZbVKw/IYmRXNn6StA5woct6NlKD23BJd3qX TebxpQRpJj76jSjL+t0SD5PGE8lrLN59UAG/uTDzFo36bv7lQdAq+12rdRG5XND+vAQu0hWuG 7sVONezGN0qQbI= 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 From: Dave Stevenson vchi_bulk_queue_receive will queue up to a default of 4 bulk receives on a connection before blocking. If called from the VCHI service_callback thread, then that thread is unable to service the VCHI_CALLBACK_BULK_RECEIVED events that would enable the queue call to succeed. Add a workqueue to schedule the call vchi_bulk_queue_receive in an alternate context to avoid the lock up. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/mmal-vchiq.c | 101 ++++++++++++--------- 1 file changed, 59 insertions(+), 42 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index f1bb900..1a343d8 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -117,8 +117,10 @@ struct mmal_msg_context { union { struct { - /* work struct for defered callback - must come first */ + /* work struct for buffer_cb callback */ struct work_struct work; + /* work struct for deferred callback */ + struct work_struct buffer_to_host_work; /* mmal instance */ struct vchiq_mmal_instance *instance; /* mmal port */ @@ -167,6 +169,9 @@ struct vchiq_mmal_instance { /* component to use next */ int component_idx; struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS]; + + /* ordered workqueue to process all bulk operations */ + struct workqueue_struct *bulk_wq; }; static struct mmal_msg_context * @@ -248,7 +253,44 @@ static void buffer_work_cb(struct work_struct *work) msg_context->u.bulk.mmal_flags, msg_context->u.bulk.dts, msg_context->u.bulk.pts); +} +/* workqueue scheduled callback to handle receiving buffers + * + * VCHI will allow up to 4 bulk receives to be scheduled before blocking. + * If we block in the service_callback context then we can't process the + * VCHI_CALLBACK_BULK_RECEIVED message that would otherwise allow the blocked + * vchi_bulk_queue_receive() call to complete. + */ +static void buffer_to_host_work_cb(struct work_struct *work) +{ + struct mmal_msg_context *msg_context = + container_of(work, struct mmal_msg_context, + u.bulk.buffer_to_host_work); + struct vchiq_mmal_instance *instance = msg_context->instance; + unsigned long len = msg_context->u.bulk.buffer_used; + int ret; + + if (!len) + /* Dummy receive to ensure the buffers remain in order */ + len = 8; + /* queue the bulk submission */ + vchi_service_use(instance->handle); + ret = vchi_bulk_queue_receive(instance->handle, + msg_context->u.bulk.buffer->buffer, + /* Actual receive needs to be a multiple + * of 4 bytes + */ + (len + 3) & ~3, + VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE | + VCHI_FLAGS_BLOCK_UNTIL_QUEUED, + msg_context); + + vchi_service_release(instance->handle); + + if (ret != 0) + pr_err("%s: ctx: %p, vchi_bulk_queue_receive failed %d\n", + __func__, msg_context, ret); } /* enqueue a bulk receive for a given message context */ @@ -257,7 +299,6 @@ static int bulk_receive(struct vchiq_mmal_instance *instance, struct mmal_msg_context *msg_context) { unsigned long rd_len; - int ret; rd_len = msg->u.buffer_from_host.buffer_header.length; @@ -293,45 +334,10 @@ static int bulk_receive(struct vchiq_mmal_instance *instance, msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts; - /* queue the bulk submission */ - vchi_service_use(instance->handle); - ret = vchi_bulk_queue_receive(instance->handle, - msg_context->u.bulk.buffer->buffer, - /* Actual receive needs to be a multiple - * of 4 bytes - */ - (rd_len + 3) & ~3, - VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE | - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, - msg_context); - - vchi_service_release(instance->handle); + queue_work(msg_context->instance->bulk_wq, + &msg_context->u.bulk.buffer_to_host_work); - return ret; -} - -/* enque a dummy bulk receive for a given message context */ -static int dummy_bulk_receive(struct vchiq_mmal_instance *instance, - struct mmal_msg_context *msg_context) -{ - int ret; - - /* zero length indicates this was a dummy transfer */ - msg_context->u.bulk.buffer_used = 0; - - /* queue the bulk submission */ - vchi_service_use(instance->handle); - - ret = vchi_bulk_queue_receive(instance->handle, - instance->bulk_scratch, - 8, - VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE | - VCHI_FLAGS_BLOCK_UNTIL_QUEUED, - msg_context); - - vchi_service_release(instance->handle); - - return ret; + return 0; } /* data in message, memcpy from packet into output buffer */ @@ -379,6 +385,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance, /* initialise work structure ready to schedule callback */ INIT_WORK(&msg_context->u.bulk.work, buffer_work_cb); + INIT_WORK(&msg_context->u.bulk.buffer_to_host_work, + buffer_to_host_work_cb); /* prep the buffer from host message */ memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */ @@ -459,7 +467,7 @@ static void buffer_to_host_cb(struct vchiq_mmal_instance *instance, if (msg->u.buffer_from_host.buffer_header.flags & MMAL_BUFFER_HEADER_FLAG_EOS) { msg_context->u.bulk.status = - dummy_bulk_receive(instance, msg_context); + bulk_receive(instance, msg, msg_context); if (msg_context->u.bulk.status == 0) return; /* successful bulk submission, bulk * completion will trigger callback @@ -1793,6 +1801,9 @@ int vchiq_mmal_finalise(struct vchiq_mmal_instance *instance) mutex_unlock(&instance->vchiq_mutex); + flush_workqueue(instance->bulk_wq); + destroy_workqueue(instance->bulk_wq); + vfree(instance->bulk_scratch); idr_destroy(&instance->context_map); @@ -1855,6 +1866,11 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) params.callback_param = instance; + instance->bulk_wq = alloc_ordered_workqueue("mmal-vchiq", + WQ_MEM_RECLAIM); + if (!instance->bulk_wq) + goto err_free; + status = vchi_service_open(vchi_instance, ¶ms, &instance->handle); if (status) { pr_err("Failed to open VCHI service connection (status=%d)\n", @@ -1869,8 +1885,9 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) return 0; err_close_services: - vchi_service_close(instance->handle); + destroy_workqueue(instance->bulk_wq); +err_free: vfree(instance->bulk_scratch); kfree(instance); return -ENODEV; From patchwork Thu Jun 27 18:56:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5199E14C0 for ; Thu, 27 Jun 2019 18:57:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 498512793A for ; Thu, 27 Jun 2019 18:57:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C9FE2851E; Thu, 27 Jun 2019 18:57:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D929126E4A for ; Thu, 27 Jun 2019 18:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbfF0S5J (ORCPT ); Thu, 27 Jun 2019 14:57:09 -0400 Received: from mout.gmx.net ([212.227.15.15]:36441 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbfF0S5I (ORCPT ); Thu, 27 Jun 2019 14:57:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661810; bh=oLnjN52EnE2DOibkkrUsKEoboTm6occkriot7kdGOWc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=RKnMp8hZU20lqiGxc90wHuETi2g7AFvuAAL5zIuDEPG/xvXcauzV4BWngTwdUBrhi 2ttIZA9hw6yppVjT2JG3TZ6Iu21B+AFb9ZuFs7mfUR6RIlhMfbeD9BRsrsm1yGOjsR 1HMbqjQIbe5RyNDaTVFamsu+SeiBK0RqPZZrV2cI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LnwxU-1iDhT01mrA-00fwPr; Thu, 27 Jun 2019 20:56:50 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 05/31] staging: bcm2835-camera: Correctly denote key frames in encoded data Date: Thu, 27 Jun 2019 20:56:02 +0200 Message-Id: <1561661788-22744-6-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:yZ1iRnEdO/zCVfwT0Jup2xWKW1hJcfyIxLMQ6raD3e/K42260gg sJpGrJ9+VGPSRXyTOiZV/d6DuJ4Wf/px0uBMNMxghtmP3CuyqrlKknImVks1Uj/B1hc+vW5 Y0H4pBYw972XKbYWN+acwiqOMebVNZuqnakrfrU5q4IpA0DaKZsOtA320Pef0MDCGSj4PT5 eNUCvM/AZzIoFeXkTllXA== X-UI-Out-Filterresults: notjunk:1;V03:K0:E9CXXj22YFg=:npWE8aj9lMTYCPhz1hA5Io LX0cFJTv2+agRUQfFUqMJEsx2bNaMgp8eGLcRj4ByUfpm3RtOwmfiwUrAfOQg5E14cA4w5lxL rvkkjvv1aT9R0wR7r37gMgTMTK+8SKFu7Lml1T+mba3A9ReUmfh35g8uo9hRhlA+SkzwvCpec WCIcaCPiCvyv6fbxJ+UT7UcZ5OqCiWUvO9Eh8z5LakYDwdLB1s0u7wivt7/+RpvVHTguVlArI qHtAwyVapFpmwpON74e31ClJIZyiYzDWVh2Tgixkbz/R2s6oEOKnji0nTPIYKxNoTShRrhFz1 3xZLANtdfI0kff3F5qrt/Tqp61WmPW7N2R+KDPD48b9PpGRBKttVgQs/1GvAf0jYFMpvVl9Um rfKGHBXXPi3fIC7Q/Xg/dOIUkOSleSfVCARvmU4Vbcxiz8OdGSUM9Okqc+cGa4vAMV+A9zgG+ aYsZVJCDh7IzwqDozUyh0ZkgoWG9YyJ8QaxfmI5fjmFUs418vtSG5eUrJliXZ0QSsk0cTOzO8 2WvnxR4N3XrankAlMpa6Lep8BbGAN/MUyL+Co1dsjG0C/+akbITiLrAo6ozCjvWaMJE458ppP nf5kYjSvf6BQ8J5d7WAsu6isrmrphaRKn/ZJU//IKgJnnkWOsqZVUY5ha/kPTJR/p4VvLGOvq I30ljE6IGwk7710rOPqU92Sdz6WNVID5ieILU+YU4PY8LjwNZqDxh6K0Qs0Ezhav++K7oLKhI AM/2AxEubOPp3eECQlSkllQ7hYDGCM3A3QJK40Y/qfKYY2Y+IBziEY0AXn8tYxK86r92wWN/e ZY1Jcpy8Xfr+tE3uA3hlwmRSzHzY554vX8MunfkpXMuLXEuXsoz66n0QFiKKLx1l3M9JsQ4sG TW0S3L/uOp3P8J97IJuAeBkzg5zYtNYR6ejQJBJvHtPKpMbuxdoCIcPIA94esWW1G53CmUXR9 A1gPI1yqXZPrXFepimiLXJ7paDr3hq2ICSOEwJoPi9T1laDLMIhN6jHBzgNimUg5i1mtz4iZE Owy4H6DzwYUS9H4m8WBTP+jg1iD3dbzHZeHY7wsFwkZ3oAY9e0bN+T20/FMCs4aZCkwdAD+DL ziEj/D0cdINm34= 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 From: Dave Stevenson Forward MMAL key frame flags to the V4L2 buffers. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 0c04815..456b686 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -385,6 +385,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); + if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME) + buf->vb.flags |= V4L2_BUF_FLAG_KEYFRAME; + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS && From patchwork Thu Jun 27 18:56:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020345 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C924A1575 for ; Thu, 27 Jun 2019 18:57:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0DFB26E4A for ; Thu, 27 Jun 2019 18:57:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B55D8285A8; Thu, 27 Jun 2019 18:57:22 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 3D80826E4A for ; Thu, 27 Jun 2019 18:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfF0S5M (ORCPT ); Thu, 27 Jun 2019 14:57:12 -0400 Received: from mout.gmx.net ([212.227.15.15]:44105 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbfF0S5K (ORCPT ); Thu, 27 Jun 2019 14:57:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661811; bh=lUdBNb/xOMYCllKOZYy4V0wd1rtgfpcEo0fxiR8IyK4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=jNLvd5ox/RcG4p+gqkIHiXg45K9W3Dj4ZxkIKsXVGSazZYmRY9A2Xi2h2M8rRyyIl wkhOCVSRxNlg91gN3X8uDpNIvJHrYFrVomK2iNQp9KAUVFQGVDSGKC8YaWeJBj9Jz6 MmzfhUSxNBvgTnhE1EpPxAsxmSIn4DB5zvFCecm0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MDyil-1hmNWX3UOF-00HMIO; Thu, 27 Jun 2019 20:56:50 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 06/31] staging: bcm2835-camera: Return early on errors Date: Thu, 27 Jun 2019 20:56:03 +0200 Message-Id: <1561661788-22744-7-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:2Pe+ZeRMyfwAHl+ea1MX8XyHvhuOqcTh6ymq0RjberPmkWCDDFm heYR+ticlyINVHqyRz4DaE+LasE22v7lQ/7wTHQBbsxxR17DCbqjwSEhxGy1x1zUYP8mP85 K7juUAPczpzPfi0XqaojFoTY/G9h1jT5EF/3MWu0I+wEaj8YQ/QuRi2bS1t+aPlKOxhiwNt hFJj/tKeyE8OnzSqEKTVg== X-UI-Out-Filterresults: notjunk:1;V03:K0:sV+a52IHZ7M=:tj7Urv2CcxzNYOLBRwLoEZ AqMoY4TgtX9aM0dPopTzfqk6Y6STnQuC5nNHHrBhsYI5fa1QbFOJh2Yn9dr74oteca8m85N// 4R005ew2EhxMsCiRjFtbPiCyFhfmYkEKbOxp7rQYfZ1Mhu/5lJl1SKaGZ7c1k5qzFvzNX9xp7 YVUFdsrBOBjh1a1vhjm/jvMRgE66KeL+gCwvKJMWipAmvN+5Y3+vsBKg0ed8Xan9qbOX1tDsS mIkeuwA79Od5xzk8xcd6qPfhXIRCHpRjdQrClvAi0jTZ8l9z1f9eWTLsptgo19JSg4xVueMfy I98zY74dvzgnlf0DECSbPWA3/QxjEFBxwjHApwj4bO31oJdQ9h/x7mUskAlXM9kKQfQNf1Coo ocPE/1d6GHjWoKXtykBN0JTfdH3OwFC07Uv/c3xa9THsbhzxrccrzARkvd/mJG6zLXg3VrOs7 2Ybp9fADHbBMzdJPDzufgPEAUxY26Ix8lWnJL68ku3bDXP9s/qZsWVvotqR77RwgDpctTP3en VZOZJefmg1x4dFHJmbMIcvbmUGuTdQxWFv2GOXANV6BacVvVbXLMU5SuD/F5IwSDyuW3EJh7O mLmA3rUR+dXRZYGOfCNw3jN/cLSJegMIbs2OLKXeinwZcmMZvbS51K7GwbFm60EWeFAx22plC GaZUPs+/6MzzWiyKl2yrKyAzH9QmN95zvkiQCHBtnuoN1ElS6aJA9q6uw/kQr7O4TR8wsx82c yH49XMhBVg+QJA4WiUZo/Ygo5WrCf04ClzC7U3qPMksjqyx6ljwwTqosHrspcCKRUOUEB08HD 4nAZ1FB5xtVBHNfwnO1/PQcDjG4rtVlf/AB79vhuzNrFoP6YLLjwecD2axF36SGsBGdljdJhH bCLvG7kHFrMdKFER19nWGrY7v70y3W2hcoVV1k2DACnN81co21zkcvhSIeP10/zEVgb5bLYta xdiVHVCw8Lca0ad6dW84jbsUEZ/rp4maisyLyuNkY+If4L4OzQhkDeXPQSSuMPjhzLm8Wtazv NZhmK/Wnq/4i8JAkJFviviQnH97Vi8oXaYaQDiIFJvCOGqHNr2RA5418+OzhVEzvcCdTayOLL O145FrnK8b6AkI= 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 From: Dave Stevenson Fix several instances where it is easier to return early on error conditions than handle it as an else clause. As requested by Mauro. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 109 +++++++++++---------- 1 file changed, 58 insertions(+), 51 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 456b686..b597475 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -334,7 +334,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); } return; - } else if (length == 0) { + } + + if (length == 0) { /* stream ended */ if (buf) { /* this should only ever happen if the port is @@ -357,56 +359,59 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, /* signal frame completion */ complete(&dev->capture.frame_cmplt); } - } else { - if (dev->capture.frame_count) { - if (dev->capture.vc_start_timestamp != -1) { - buf->vb.vb2_buf.timestamp = ktime_get_ns(); - } else if (pts) { - ktime_t timestamp; - s64 runtime_us = pts - - dev->capture.vc_start_timestamp; - timestamp = ktime_add_us(dev->capture.kernel_start_ts, - runtime_us); - v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, - "Convert start time %llu and %llu with offset %llu to %llu\n", - ktime_to_ns(dev->capture.kernel_start_ts), - dev->capture.vc_start_timestamp, pts, - ktime_to_ns(timestamp)); - buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); - } else { - if (dev->capture.last_timestamp) { - buf->vb.vb2_buf.timestamp = - dev->capture.last_timestamp; - } else { - buf->vb.vb2_buf.timestamp = - ktime_to_ns(dev->capture.kernel_start_ts); - } - } - dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; + return; + } - vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); - if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME) - buf->vb.flags |= V4L2_BUF_FLAG_KEYFRAME; + if (!dev->capture.frame_count) { + /* signal frame completion */ + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); + complete(&dev->capture.frame_cmplt); + return; + } - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); - if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS && - is_capturing(dev)) { - v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, - "Grab another frame as buffer has EOS"); - vchiq_mmal_port_parameter_set( - instance, - dev->capture.camera_port, - MMAL_PARAMETER_CAPTURE, - &dev->capture.frame_count, - sizeof(dev->capture.frame_count)); - } + if (dev->capture.vc_start_timestamp != -1) { + buf->vb.vb2_buf.timestamp = ktime_get_ns(); + } else if (pts) { + ktime_t timestamp; + s64 runtime_us = pts - + dev->capture.vc_start_timestamp; + timestamp = ktime_add_us(dev->capture.kernel_start_ts, + runtime_us); + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, + "Convert start time %llu and %llu with offset %llu to %llu\n", + ktime_to_ns(dev->capture.kernel_start_ts), + dev->capture.vc_start_timestamp, pts, + ktime_to_ns(timestamp)); + buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); + } else { + if (dev->capture.last_timestamp) { + buf->vb.vb2_buf.timestamp = + dev->capture.last_timestamp; } else { - /* signal frame completion */ - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); - complete(&dev->capture.frame_cmplt); + buf->vb.vb2_buf.timestamp = + ktime_to_ns(dev->capture.kernel_start_ts); } } + dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; + + vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); + if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME) + buf->vb.flags |= V4L2_BUF_FLAG_KEYFRAME; + + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); + + if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS && + is_capturing(dev)) { + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, + "Grab another frame as buffer has EOS"); + vchiq_mmal_port_parameter_set( + instance, + dev->capture.camera_port, + MMAL_PARAMETER_CAPTURE, + &dev->capture.frame_count, + sizeof(dev->capture.frame_count)); + } } static int enable_camera(struct bm2835_mmal_dev *dev) @@ -785,27 +790,29 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on) ret = vchiq_mmal_port_set_format(dev->instance, src); if (ret < 0) - goto error; + return ret; ret = set_overlay_params(dev, dst); if (ret < 0) - goto error; + return ret; - if (enable_camera(dev) < 0) - goto error; + if (enable_camera(dev) < 0) { + ret = -EINVAL; + return ret; + } ret = vchiq_mmal_component_enable( dev->instance, dev->component[MMAL_COMPONENT_PREVIEW]); if (ret < 0) - goto error; + return ret; v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "connecting %p to %p\n", src, dst); ret = vchiq_mmal_port_connect_tunnel(dev->instance, src, dst); if (!ret) ret = vchiq_mmal_port_enable(dev->instance, src, NULL); -error: + return ret; } From patchwork Thu Jun 27 18:56:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020333 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04DAF1580 for ; Thu, 27 Jun 2019 18:57:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F052926E4A for ; Thu, 27 Jun 2019 18:57:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4AB727FC0; Thu, 27 Jun 2019 18:57:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 0298526E4A for ; Thu, 27 Jun 2019 18:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726603AbfF0S5R (ORCPT ); Thu, 27 Jun 2019 14:57:17 -0400 Received: from mout.gmx.net ([212.227.15.19]:48029 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbfF0S5P (ORCPT ); Thu, 27 Jun 2019 14:57:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661811; bh=k2UEBdPcXThZbOhK5It7fEganG4Iv+M4JDEYExz4Arc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=OGx4Tbw/y43jBB3SXYzKOgCdXi7TgB8QtK4qlHpS0lBu8/cGVzg3feaiLShLOcKxn RjdePa1kfltlkFL1KNkQHViViOstm8fZs+l/ITP/lZrCxdODnFPrj3SFDac3/L8Jsy W/5gnZYa2kOWPKk/pg/ryO8mqztXqQdI28eiGrA8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LgZdt-1iIxBW14Zp-00nxIE; Thu, 27 Jun 2019 20:56:51 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 07/31] staging: bcm2835-camera: Remove dead email addresses Date: Thu, 27 Jun 2019 20:56:04 +0200 Message-Id: <1561661788-22744-8-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:G+kKgfFVzVlhR+oT6IRybHEGpRj6R6swZgtBkCia+xNyzsUjV39 c6pALomWDH7aFBtGuFnr9OIC7Or25hpKL2Qtg+na7RcQCxtw4YUtCD4MnZlWjV3coW1ZSQ6 S+A9OV/QP6vrZF0XVCIz4jLQlJsoHo8ZtLNgoRFzcV7o3UpBhx4ucdjmIKXf/MMQps5AIwX G70qd76F8vIFtfvqw6nFQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:qQYJ98g6oYc=:d1q1GINSU4Wm++VBLDNd/i eorzI/ywX3fbqWU9ak99N+986WjUXalUERehv8eNow5Q0rJyOuLeQDNs28kiLgxu6YaP1hO37 V/AWnXCTLSC2rQPCUsZssib/Oxu8FXZK3gX1zMxGWl+ttweaHcS2Y5W91LFhWkSLQ29qTjTkV pZUbesPWPj098WQfBlfsxB5HowmGx/pJcWiCkZOKvOxW9TsOUY5HEuiTMOphjQthNyC3b1+o6 6xC6Zvvm32l9nol7ntcyQyehYtXvizMSssD+uiwe3E2kqiYPdLCkpfDrj/W8CBu/1dzzKO7wb SporIm+zefFvj652QuvvF3oeLWj7fDDh+F1bQjHrUX2a0PO+sWYyoRH//1pLs/eNbiy+EBSpC VppFRRqzZAF97lOhzVor8iTdOOpJ35zOFWrRz1O8PBkjhZ5t2XuzzUrGK9mO3zN6s1k3jNKzT V6Vo3UBAJ7tVtR4DQCtT6F/lTaxfwyVzU3dcmBF4JtpR1WQaoaNUTMlx1qVWDVrMCj2BuZx2i OuTzvilyZ5P/dfLFeFYWTu2wpSK6ksoM37Pe4cV7QdwKBkZL603Oitk8B7SffFSfwHXw7Mbvd 7mzMv6GgJyB1uT6DRmsKKZWu5eAH63oXFKCDLsBUprAXSoV3B15Ak9B3GoXvi5fjvE9pIiYfE QDj33eaf+o94VJmXPMkZltFSHT9va84zCv9AsW9PCVrUln9F20hf/ohdUqVZcSmoh35tdw0v/ IQWhhRVv3fFMpk/XDnRhAN91fENosU6/ArIx5y6hEzrBwh7PJGUN0khAjZ8mF6FJf6DrSRTd+ UK3QU/DNcEZW7+oplCReDT5aH5eVHdxEDdrj3ZnRYviCFYrOQrbpuum+ZFKDoq43qVYyM6EEz 2Oruy5u3VnMyo9ez+n9Q9oCo9pDScoBBZoXHIGXUD2EaKQPuYitGLD+CskXPVyiBfEHp/WzVN OkAjGFPzFIOSzmN9420Gi9NA02c4bKUxzXnOcq79s+o+gFtS7votB7j0VmPrQ8KgYnFBK0PJk /IIw8tR1iuGpr6FwLvEOIg5fARHtjVu3krA1+WnOUd0EO84GeRxFFDVIzZgmd9lb1Zp4pKts9 DzyF+kERUFLGfc= 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 From: Dave Stevenson None of the listed author email addresses were valid. Keep list of authors and the companies they represented. Update my email address. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/controls.c | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-common.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 9 +++++---- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h | 9 +++++---- 12 files changed, 60 insertions(+), 48 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index b597475..814deee 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ #include diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index 09273b0..9833828 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom * * core driver device */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 133aa6e..b142130 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ #include diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h index a20bf27..858bdcd 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-common.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom * * MMAL structures * diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h index 1292035..2be9941 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-encodings.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ #ifndef MMAL_ENCODINGS_H #define MMAL_ENCODINGS_H diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h index ec84556..342c9b6 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-common.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ #ifndef MMAL_MSG_COMMON_H diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h index c9d6fbe..5ea1a1b 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ #ifndef MMAL_MSG_FORMAT_H diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h index 3b3ed79..fe5768d 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ /* MMAL_PORT_TYPE_T */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h index 90793c9..332de57 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ /* all the data structures which serialise the MMAL protocol. note diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h index 184024d..96e987d 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom */ /* common parameters */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 1a343d8..5175e2c 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom * * V4L2 driver MMAL vchiq interface code */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h index 22b839e..0e5a81b 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h @@ -4,10 +4,11 @@ * * Copyright © 2013 Raspberry Pi (Trading) Ltd. * - * Authors: Vincent Sanders - * Dave Stevenson - * Simon Mellor - * Luke Diamand + * Authors: Vincent Sanders @ Collabora + * Dave Stevenson @ Broadcom + * (now dave.stevenson@raspberrypi.org) + * Simon Mellor @ Broadcom + * Luke Diamand @ Broadcom * * MMAL interface to VCHIQ message passing */ From patchwork Thu Jun 27 18:56:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020339 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51EC51575 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 467FD27FC0 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AE3E2851E; Thu, 27 Jun 2019 18:57:21 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 CDFDA27FC0 for ; Thu, 27 Jun 2019 18:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbfF0S5M (ORCPT ); Thu, 27 Jun 2019 14:57:12 -0400 Received: from mout.gmx.net ([212.227.15.18]:52627 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbfF0S5L (ORCPT ); Thu, 27 Jun 2019 14:57:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661812; bh=+Xoux4+s4j5YfHj784XnN033ix9y/7uzXcLlI87QcTo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LH7hBHfikip12OU8QBcgEgaszTr76HWc/YfwfJTo8NpxtrAXcKFLBLVxtzAyrvLaP OAdtZzE3UOjwcNADnR/l/mXCDFhM9yBahX8IqFab1cG7lPsDMjPijDaHbjsGBdUQXV ERSq1NiGDWfsA9Yid2SRHOS22zyz8CEfGHOHIy7c= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M7pI0-1iT9ut2oPA-00vPw3; Thu, 27 Jun 2019 20:56:51 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 08/31] staging: bcm2835-camera: Fix comment style violations. Date: Thu, 27 Jun 2019 20:56:05 +0200 Message-Id: <1561661788-22744-9-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:HEIL2nbb9HRBO7L+QEOZBb9r1MTTwvhZ8lsCOlo/UHeE06nJqom /84bxrXMVRe7icOufelWDT1CGontoXgBUUkj/1v4jai6X3z0VMoosMkMd+Okz9p2W/dJkt3 wz530L++YdwuiIZlUE50dGKSYjtG++VyjcHI+ZYHejc3MFyQtwBP88eRpMlwbhYla2lmUcz YZ+O6p3GaKjWKKkME9AVg== X-UI-Out-Filterresults: notjunk:1;V03:K0:pCyntWeZ/Rs=:bD1ZYN2h0bkABXGfLFMfL5 bn5OwUMgv+Jb8BOYLmM+e1Op5C7q8oiqP5Pgb0JDDN2m8FJ8bexYqTtiAOqDAr7NREha8C05T I+2T68F7m0xYpqkQxGwo0rhstC7fofKnTP5V9iA68UIOWnqmMAKdIUlS7pF2d7yk+0UpQPWrm q3XpTK/ro7sbR7b3G1GSHIVZuBpu9HLEdZLwqa0KBGIlm95j8AHSmFzBI7dfA0OvHrd0OMPxF iGtkm7uWkjCGJHUjprT6TS5jdzzXGi9w1BvY1K5t/c2UF02GunccdAQSGzFDuLxBWZHIKdNL9 n6Np7kcsPTz91OfHkXqblRIwbobFcslDHayisWo+SPkslxL4YoflGtsDtXr7f+3CjPFaLC0a3 licLyi63RoMUIWYrIbhgM9XaVaKQ/DdKAzWqLLuZRO9Davii+GO3ucZCoMXGJ6PBY4/uSPV0b PRRKsmreOxx23EOylCP/HJwd2nd5M998EaRyS52trSqVfmq8TdDO5cO4K2355FVFAyhTOpMjy JwOiCv8eIsrt07sF4Ev3mElQ+bkPU6t0AX/l3fEWcaUqyvcaDT5Ghggtuquz4+C7XuVDIiQmQ 1OWxU64525L33D1675ZupypOi07FvrT1bVHRCoUmVXPCtjI8fFoYuSJsw1isDD6vPNahnc8DK nUmT315NYdidWo2T5sxhc+4BcpVm0YkCuT2iBq+laBDXzSMOT3I3jdHN0CiWaog3U1X+Nh6YU 741nEqABhg4xRc8d/KD8c+DFof8fvst7dKUHsdrLgdYiazGbeAraIjfIhQX3ohurNZ5XlTR45 DMmO1m8Y3RH6AQdCIbUzanbNOjIIuPpgajG0nPyTNRV6h3ELQWIiJejMZJe6H6DzkbR5q6jJu wXvWCWbMZAEJTy8Y3pxPdK9seyOd0HoKmsagFQ/7YnqiImz8VFkszwfZGHXqCSTvYaJ9GKm8j TwgDjGjaWWoC9p2TPmzuoIhh9qtKMNwWLRjrTfc0tlYa73ww6J+LYPZ3Ps7ve/c/kPEwytUnA l+t3G/v7lvpMH6dZGTe2E6ursYnSer+7iIyo72cDceGKk6vjD4awTLwsK7mpd9R56hlumIeHC +kBohx6MgWMbrs= 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 From: Dave Stevenson Fix comment style violations in the header files. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/mmal-msg-format.h | 95 ++++++++------- .../vc04_services/bcm2835-camera/mmal-msg-port.h | 124 +++++++++---------- .../vc04_services/bcm2835-camera/mmal-msg.h | 135 +++++++++++---------- 3 files changed, 185 insertions(+), 169 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h index 5ea1a1b..a118efd 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-format.h @@ -19,22 +19,23 @@ /* MMAL_ES_FORMAT_T */ struct mmal_audio_format { - u32 channels; /**< Number of audio channels */ - u32 sample_rate; /**< Sample rate */ + u32 channels; /* Number of audio channels */ + u32 sample_rate; /* Sample rate */ - u32 bits_per_sample; /**< Bits per sample */ - u32 block_align; /**< Size of a block of data */ + u32 bits_per_sample; /* Bits per sample */ + u32 block_align; /* Size of a block of data */ }; struct mmal_video_format { - u32 width; /**< Width of frame in pixels */ - u32 height; /**< Height of frame in rows of pixels */ - struct mmal_rect crop; /**< Visible region of the frame */ - struct mmal_rational frame_rate; /**< Frame rate */ - struct mmal_rational par; /**< Pixel aspect ratio */ - - /* FourCC specifying the color space of the video stream. See the - * \ref MmalColorSpace "pre-defined color spaces" for some examples. + u32 width; /* Width of frame in pixels */ + u32 height; /* Height of frame in rows of pixels */ + struct mmal_rect crop; /* Visible region of the frame */ + struct mmal_rational frame_rate; /* Frame rate */ + struct mmal_rational par; /* Pixel aspect ratio */ + + /* + * FourCC specifying the color space of the video stream. See the + * MmalColorSpace "pre-defined color spaces" for some examples. */ u32 color_space; }; @@ -50,48 +51,56 @@ union mmal_es_specific_format { struct mmal_subpicture_format subpicture; }; -/** Definition of an elementary stream format (MMAL_ES_FORMAT_T) */ +/* Definition of an elementary stream format (MMAL_ES_FORMAT_T) */ struct mmal_es_format_local { - u32 type; /* enum mmal_es_type */ - - u32 encoding; /* FourCC specifying encoding of the elementary stream.*/ - u32 encoding_variant; /* FourCC specifying the specific - * encoding variant of the elementary - * stream. - */ - - union mmal_es_specific_format *es; /* Type specific - * information for the - * elementary stream - */ - - u32 bitrate; /**< Bitrate in bits per second */ - u32 flags; /**< Flags describing properties of the elementary stream. */ - - u32 extradata_size; /**< Size of the codec specific data */ - u8 *extradata; /**< Codec specific data */ + u32 type; /* enum mmal_es_type */ + + u32 encoding; /* FourCC specifying encoding of the elementary + * stream. + */ + u32 encoding_variant; /* FourCC specifying the specific + * encoding variant of the elementary + * stream. + */ + + union mmal_es_specific_format *es; /* Type specific + * information for the + * elementary stream + */ + + u32 bitrate; /* Bitrate in bits per second */ + u32 flags; /* Flags describing properties of the elementary + * stream. + */ + + u32 extradata_size; /* Size of the codec specific data */ + u8 *extradata; /* Codec specific data */ }; -/** Remote definition of an elementary stream format (MMAL_ES_FORMAT_T) */ +/* Remote definition of an elementary stream format (MMAL_ES_FORMAT_T) */ struct mmal_es_format { - u32 type; /* enum mmal_es_type */ + u32 type; /* enum mmal_es_type */ - u32 encoding; /* FourCC specifying encoding of the elementary stream.*/ - u32 encoding_variant; /* FourCC specifying the specific - * encoding variant of the elementary - * stream. - */ + u32 encoding; /* FourCC specifying encoding of the elementary + * stream. + */ + u32 encoding_variant; /* FourCC specifying the specific + * encoding variant of the elementary + * stream. + */ - u32 es; /* Type specific + u32 es; /* Type specific * information for the * elementary stream */ - u32 bitrate; /**< Bitrate in bits per second */ - u32 flags; /**< Flags describing properties of the elementary stream. */ + u32 bitrate; /* Bitrate in bits per second */ + u32 flags; /* Flags describing properties of the elementary + * stream. + */ - u32 extradata_size; /**< Size of the codec specific data */ - u32 extradata; /**< Codec specific data */ + u32 extradata_size; /* Size of the codec specific data */ + u32 extradata; /* Codec specific data */ }; #endif /* MMAL_MSG_FORMAT_H */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h index fe5768d..3fa3f2a 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg-port.h @@ -13,28 +13,31 @@ /* MMAL_PORT_TYPE_T */ enum mmal_port_type { - MMAL_PORT_TYPE_UNKNOWN = 0, /**< Unknown port type */ - MMAL_PORT_TYPE_CONTROL, /**< Control port */ - MMAL_PORT_TYPE_INPUT, /**< Input port */ - MMAL_PORT_TYPE_OUTPUT, /**< Output port */ - MMAL_PORT_TYPE_CLOCK, /**< Clock port */ + MMAL_PORT_TYPE_UNKNOWN = 0, /* Unknown port type */ + MMAL_PORT_TYPE_CONTROL, /* Control port */ + MMAL_PORT_TYPE_INPUT, /* Input port */ + MMAL_PORT_TYPE_OUTPUT, /* Output port */ + MMAL_PORT_TYPE_CLOCK, /* Clock port */ }; -/** The port is pass-through and doesn't need buffer headers allocated */ +/* The port is pass-through and doesn't need buffer headers allocated */ #define MMAL_PORT_CAPABILITY_PASSTHROUGH 0x01 -/** The port wants to allocate the buffer payloads. +/* + *The port wants to allocate the buffer payloads. * This signals a preference that payload allocation should be done * on this port for efficiency reasons. */ #define MMAL_PORT_CAPABILITY_ALLOCATION 0x02 -/** The port supports format change events. +/* + * The port supports format change events. * This applies to input ports and is used to let the client know * whether the port supports being reconfigured via a format * change event (i.e. without having to disable the port). */ #define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE 0x04 -/* mmal port structure (MMAL_PORT_T) +/* + * mmal port structure (MMAL_PORT_T) * * most elements are informational only, the pointer values for * interogation messages are generally provided as additional @@ -42,50 +45,50 @@ enum mmal_port_type { * buffer_num, buffer_size and userdata parameters are writable. */ struct mmal_port { - u32 priv; /* Private member used by the framework */ - u32 name; /* Port name. Used for debugging purposes (RO) */ - - u32 type; /* Type of the port (RO) enum mmal_port_type */ - u16 index; /* Index of the port in its type list (RO) */ - u16 index_all; /* Index of the port in the list of all ports (RO) */ - - u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */ - u32 format; /* Format of the elementary stream */ - - u32 buffer_num_min; /* Minimum number of buffers the port - * requires (RO). This is set by the - * component. - */ - - u32 buffer_size_min; /* Minimum size of buffers the port - * requires (RO). This is set by the - * component. - */ - - u32 buffer_alignment_min; /* Minimum alignment requirement for - * the buffers (RO). A value of - * zero means no special alignment - * requirements. This is set by the - * component. - */ - - u32 buffer_num_recommended; /* Number of buffers the port - * recommends for optimal - * performance (RO). A value of - * zero means no special - * recommendation. This is set - * by the component. - */ - - u32 buffer_size_recommended; /* Size of buffers the port - * recommends for optimal - * performance (RO). A value of - * zero means no special - * recommendation. This is set - * by the component. - */ - - u32 buffer_num; /* Actual number of buffers the port will use. + u32 priv; /* Private member used by the framework */ + u32 name; /* Port name. Used for debugging purposes (RO) */ + + u32 type; /* Type of the port (RO) enum mmal_port_type */ + u16 index; /* Index of the port in its type list (RO) */ + u16 index_all; /* Index of the port in the list of all ports (RO) */ + + u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */ + u32 format; /* Format of the elementary stream */ + + u32 buffer_num_min; /* Minimum number of buffers the port + * requires (RO). This is set by the + * component. + */ + + u32 buffer_size_min; /* Minimum size of buffers the port + * requires (RO). This is set by the + * component. + */ + + u32 buffer_alignment_min;/* Minimum alignment requirement for + * the buffers (RO). A value of + * zero means no special alignment + * requirements. This is set by the + * component. + */ + + u32 buffer_num_recommended; /* Number of buffers the port + * recommends for optimal + * performance (RO). A value of + * zero means no special + * recommendation. This is set + * by the component. + */ + + u32 buffer_size_recommended; /* Size of buffers the port + * recommends for optimal + * performance (RO). A value of + * zero means no special + * recommendation. This is set + * by the component. + */ + + u32 buffer_num; /* Actual number of buffers the port will use. * This is set by the client. */ @@ -94,14 +97,13 @@ struct mmal_port { * the client. */ - u32 component; /* Component this port belongs to (Read Only) */ - - u32 userdata; /* Field reserved for use by the client */ + u32 component; /* Component this port belongs to (Read Only) */ - u32 capabilities; /* Flags describing the capabilities of a - * port (RO). Bitwise combination of \ref - * portcapabilities "Port capabilities" - * values. - */ + u32 userdata; /* Field reserved for use by the client */ + u32 capabilities; /* Flags describing the capabilities of a + * port (RO). Bitwise combination of \ref + * portcapabilities "Port capabilities" + * values. + */ }; diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h index 332de57..f165ddf 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-msg.h @@ -11,7 +11,8 @@ * Luke Diamand @ Broadcom */ -/* all the data structures which serialise the MMAL protocol. note +/* + * all the data structures which serialise the MMAL protocol. note * these are directly mapped onto the recived message data. * * BEWARE: They seem to *assume* pointers are u32 and that there is no @@ -41,51 +42,51 @@ enum mmal_msg_type { MMAL_MSG_TYPE_SERVICE_CLOSED, MMAL_MSG_TYPE_GET_VERSION, MMAL_MSG_TYPE_COMPONENT_CREATE, - MMAL_MSG_TYPE_COMPONENT_DESTROY, /* 5 */ + MMAL_MSG_TYPE_COMPONENT_DESTROY, /* 5 */ MMAL_MSG_TYPE_COMPONENT_ENABLE, MMAL_MSG_TYPE_COMPONENT_DISABLE, MMAL_MSG_TYPE_PORT_INFO_GET, MMAL_MSG_TYPE_PORT_INFO_SET, - MMAL_MSG_TYPE_PORT_ACTION, /* 10 */ + MMAL_MSG_TYPE_PORT_ACTION, /* 10 */ MMAL_MSG_TYPE_BUFFER_FROM_HOST, MMAL_MSG_TYPE_BUFFER_TO_HOST, MMAL_MSG_TYPE_GET_STATS, MMAL_MSG_TYPE_PORT_PARAMETER_SET, - MMAL_MSG_TYPE_PORT_PARAMETER_GET, /* 15 */ + MMAL_MSG_TYPE_PORT_PARAMETER_GET, /* 15 */ MMAL_MSG_TYPE_EVENT_TO_HOST, MMAL_MSG_TYPE_GET_CORE_STATS_FOR_PORT, MMAL_MSG_TYPE_OPAQUE_ALLOCATOR, MMAL_MSG_TYPE_CONSUME_MEM, - MMAL_MSG_TYPE_LMK, /* 20 */ + MMAL_MSG_TYPE_LMK, /* 20 */ MMAL_MSG_TYPE_OPAQUE_ALLOCATOR_DESC, MMAL_MSG_TYPE_DRM_GET_LHS32, MMAL_MSG_TYPE_DRM_GET_TIME, MMAL_MSG_TYPE_BUFFER_FROM_HOST_ZEROLEN, - MMAL_MSG_TYPE_PORT_FLUSH, /* 25 */ + MMAL_MSG_TYPE_PORT_FLUSH, /* 25 */ MMAL_MSG_TYPE_HOST_LOG, MMAL_MSG_TYPE_MSG_LAST }; /* port action request messages differ depending on the action type */ enum mmal_msg_port_action_type { - MMAL_MSG_PORT_ACTION_TYPE_UNKNOWN = 0, /* Unknown action */ - MMAL_MSG_PORT_ACTION_TYPE_ENABLE, /* Enable a port */ - MMAL_MSG_PORT_ACTION_TYPE_DISABLE, /* Disable a port */ - MMAL_MSG_PORT_ACTION_TYPE_FLUSH, /* Flush a port */ - MMAL_MSG_PORT_ACTION_TYPE_CONNECT, /* Connect ports */ - MMAL_MSG_PORT_ACTION_TYPE_DISCONNECT, /* Disconnect ports */ + MMAL_MSG_PORT_ACTION_TYPE_UNKNOWN = 0, /* Unknown action */ + MMAL_MSG_PORT_ACTION_TYPE_ENABLE, /* Enable a port */ + MMAL_MSG_PORT_ACTION_TYPE_DISABLE, /* Disable a port */ + MMAL_MSG_PORT_ACTION_TYPE_FLUSH, /* Flush a port */ + MMAL_MSG_PORT_ACTION_TYPE_CONNECT, /* Connect ports */ + MMAL_MSG_PORT_ACTION_TYPE_DISCONNECT, /* Disconnect ports */ MMAL_MSG_PORT_ACTION_TYPE_SET_REQUIREMENTS, /* Set buffer requirements*/ }; struct mmal_msg_header { u32 magic; - u32 type; /** enum mmal_msg_type */ + u32 type; /* enum mmal_msg_type */ /* Opaque handle to the control service */ u32 control_service; - u32 context; /** a u32 per message context */ - u32 status; /** The status of the vchiq operation */ + u32 context; /* a u32 per message context */ + u32 status; /* The status of the vchiq operation */ u32 padding; }; @@ -99,9 +100,9 @@ struct mmal_msg_version { /* request to VC to create component */ struct mmal_msg_component_create { - u32 client_component; /* component context */ + u32 client_component; /* component context */ char name[128]; - u32 pid; /* For debug */ + u32 pid; /* For debug */ }; /* reply from VC to component creation request */ @@ -121,7 +122,7 @@ struct mmal_msg_component_destroy { }; struct mmal_msg_component_destroy_reply { - u32 status; /** The component destruction status */ + u32 status; /* The component destruction status */ }; /* request and reply to VC to enable a component */ @@ -130,7 +131,7 @@ struct mmal_msg_component_enable { }; struct mmal_msg_component_enable_reply { - u32 status; /** The component enable status */ + u32 status; /* The component enable status */ }; /* request and reply to VC to disable a component */ @@ -139,7 +140,7 @@ struct mmal_msg_component_disable { }; struct mmal_msg_component_disable_reply { - u32 status; /** The component disable status */ + u32 status; /* The component disable status */ }; /* request to VC to get port information */ @@ -151,12 +152,12 @@ struct mmal_msg_port_info_get { /* reply from VC to get port info request */ struct mmal_msg_port_info_get_reply { - u32 status; /** enum mmal_msg_status */ - u32 component_handle; /* component handle port is associated with */ - u32 port_type; /* enum mmal_msg_port_type */ - u32 port_index; /* port indexed in query */ - s32 found; /* unused */ - u32 port_handle; /**< Handle to use for this port */ + u32 status; /* enum mmal_msg_status */ + u32 component_handle; /* component handle port is associated with */ + u32 port_type; /* enum mmal_msg_port_type */ + u32 port_index; /* port indexed in query */ + s32 found; /* unused */ + u32 port_handle; /* Handle to use for this port */ struct mmal_port port; struct mmal_es_format format; /* elementary stream format */ union mmal_es_specific_format es; /* es type specific data */ @@ -166,8 +167,8 @@ struct mmal_msg_port_info_get_reply { /* request to VC to set port information */ struct mmal_msg_port_info_set { u32 component_handle; - u32 port_type; /* enum mmal_msg_port_type */ - u32 port_index; /* port indexed in query */ + u32 port_type; /* enum mmal_msg_port_type */ + u32 port_index; /* port indexed in query */ struct mmal_port port; struct mmal_es_format format; union mmal_es_specific_format es; @@ -177,11 +178,11 @@ struct mmal_msg_port_info_set { /* reply from VC to port info set request */ struct mmal_msg_port_info_set_reply { u32 status; - u32 component_handle; /* component handle port is associated with */ - u32 port_type; /* enum mmal_msg_port_type */ - u32 index; /* port indexed in query */ - s32 found; /* unused */ - u32 port_handle; /**< Handle to use for this port */ + u32 component_handle; /* component handle port is associated with */ + u32 port_type; /* enum mmal_msg_port_type */ + u32 index; /* port indexed in query */ + s32 found; /* unused */ + u32 port_handle; /* Handle to use for this port */ struct mmal_port port; struct mmal_es_format format; union mmal_es_specific_format es; @@ -192,7 +193,7 @@ struct mmal_msg_port_info_set_reply { struct mmal_msg_port_action_port { u32 component_handle; u32 port_handle; - u32 action; /* enum mmal_msg_port_action_type */ + u32 action; /* enum mmal_msg_port_action_type */ struct mmal_port port; }; @@ -200,50 +201,53 @@ struct mmal_msg_port_action_port { struct mmal_msg_port_action_handle { u32 component_handle; u32 port_handle; - u32 action; /* enum mmal_msg_port_action_type */ + u32 action; /* enum mmal_msg_port_action_type */ u32 connect_component_handle; u32 connect_port_handle; }; struct mmal_msg_port_action_reply { - u32 status; /** The port action operation status */ + u32 status; /* The port action operation status */ }; /* MMAL buffer transfer */ -/** Size of space reserved in a buffer message for short messages. */ +/* Size of space reserved in a buffer message for short messages. */ #define MMAL_VC_SHORT_DATA 128 -/** Signals that the current payload is the end of the stream of data */ +/* Signals that the current payload is the end of the stream of data */ #define MMAL_BUFFER_HEADER_FLAG_EOS BIT(0) -/** Signals that the start of the current payload starts a frame */ +/* Signals that the start of the current payload starts a frame */ #define MMAL_BUFFER_HEADER_FLAG_FRAME_START BIT(1) -/** Signals that the end of the current payload ends a frame */ +/* Signals that the end of the current payload ends a frame */ #define MMAL_BUFFER_HEADER_FLAG_FRAME_END BIT(2) -/** Signals that the current payload contains only complete frames (>1) */ +/* Signals that the current payload contains only complete frames (>1) */ #define MMAL_BUFFER_HEADER_FLAG_FRAME \ (MMAL_BUFFER_HEADER_FLAG_FRAME_START|MMAL_BUFFER_HEADER_FLAG_FRAME_END) -/** Signals that the current payload is a keyframe (i.e. self decodable) */ +/* Signals that the current payload is a keyframe (i.e. self decodable) */ #define MMAL_BUFFER_HEADER_FLAG_KEYFRAME BIT(3) -/** Signals a discontinuity in the stream of data (e.g. after a seek). +/* + * Signals a discontinuity in the stream of data (e.g. after a seek). * Can be used for instance by a decoder to reset its state */ #define MMAL_BUFFER_HEADER_FLAG_DISCONTINUITY BIT(4) -/** Signals a buffer containing some kind of config data for the component +/* + * Signals a buffer containing some kind of config data for the component * (e.g. codec config data) */ #define MMAL_BUFFER_HEADER_FLAG_CONFIG BIT(5) -/** Signals an encrypted payload */ +/* Signals an encrypted payload */ #define MMAL_BUFFER_HEADER_FLAG_ENCRYPTED BIT(6) -/** Signals a buffer containing side information */ +/* Signals a buffer containing side information */ #define MMAL_BUFFER_HEADER_FLAG_CODECSIDEINFO BIT(7) -/** Signals a buffer which is the snapshot/postview image from a stills +/* + * Signals a buffer which is the snapshot/postview image from a stills * capture */ #define MMAL_BUFFER_HEADER_FLAGS_SNAPSHOT BIT(8) -/** Signals a buffer which contains data known to be corrupted */ +/* Signals a buffer which contains data known to be corrupted */ #define MMAL_BUFFER_HEADER_FLAG_CORRUPTED BIT(9) -/** Signals that a buffer failed to be transmitted */ +/* Signals that a buffer failed to be transmitted */ #define MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED BIT(10) struct mmal_driver_buffer { @@ -255,8 +259,8 @@ struct mmal_driver_buffer { /* buffer header */ struct mmal_buffer_header { - u32 next; /* next header */ - u32 priv; /* framework private data */ + u32 next; /* next header */ + u32 priv; /* framework private data */ u32 cmd; u32 data; u32 alloc_size; @@ -281,7 +285,8 @@ struct mmal_buffer_header_type_specific { }; struct mmal_msg_buffer_from_host { - /* The front 32 bytes of the buffer header are copied + /* + *The front 32 bytes of the buffer header are copied * back to us in the reply to allow for context. This * area is used to store two mmal_driver_buffer structures to * allow for multiple concurrent service users. @@ -296,7 +301,7 @@ struct mmal_msg_buffer_from_host { s32 is_zero_copy; s32 has_reference; - /** allows short data to be xfered in control message */ + /* allows short data to be xfered in control message */ u32 payload_in_message; u8 short_data[MMAL_VC_SHORT_DATA]; }; @@ -306,10 +311,10 @@ struct mmal_msg_buffer_from_host { #define MMAL_WORKER_PORT_PARAMETER_SPACE 96 struct mmal_msg_port_parameter_set { - u32 component_handle; /* component */ - u32 port_handle; /* port */ - u32 id; /* Parameter ID */ - u32 size; /* Parameter size */ + u32 component_handle; /* component */ + u32 port_handle; /* port */ + u32 id; /* Parameter ID */ + u32 size; /* Parameter size */ u32 value[MMAL_WORKER_PORT_PARAMETER_SPACE]; }; @@ -322,16 +327,16 @@ struct mmal_msg_port_parameter_set_reply { /* port parameter getting */ struct mmal_msg_port_parameter_get { - u32 component_handle; /* component */ - u32 port_handle; /* port */ - u32 id; /* Parameter ID */ - u32 size; /* Parameter size */ + u32 component_handle; /* component */ + u32 port_handle; /* port */ + u32 id; /* Parameter ID */ + u32 size; /* Parameter size */ }; struct mmal_msg_port_parameter_get_reply { - u32 status; /* Status of mmal_port_parameter_get call */ - u32 id; /* Parameter ID */ - u32 size; /* Parameter size */ + u32 status; /* Status of mmal_port_parameter_get call */ + u32 id; /* Parameter ID */ + u32 size; /* Parameter size */ u32 value[MMAL_WORKER_PORT_PARAMETER_SPACE]; }; @@ -339,7 +344,7 @@ struct mmal_msg_port_parameter_get_reply { #define MMAL_WORKER_EVENT_SPACE 256 struct mmal_msg_event_to_host { - u32 client_component; /* component context */ + u32 client_component; /* component context */ u32 port_type; u32 port_num; From patchwork Thu Jun 27 18:56:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF0161580 for ; Thu, 27 Jun 2019 18:57:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D72652793A for ; Thu, 27 Jun 2019 18:57:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB8202857D; Thu, 27 Jun 2019 18:57:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 5CBD82793A for ; Thu, 27 Jun 2019 18:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726583AbfF0S5N (ORCPT ); Thu, 27 Jun 2019 14:57:13 -0400 Received: from mout.gmx.net ([212.227.15.18]:55115 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726542AbfF0S5M (ORCPT ); Thu, 27 Jun 2019 14:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661812; bh=zPuVzIwG7oo6cIYjOb93FcXMzly3ELJRL6cmztU+WNQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=QV+WwnWKRTyIriZCQ+RvGKG3Dk4Ujo/cTOatzw3+eObUwolddk6UFqRI68CCuZh68 EtFRxZrNkce4RXtVono1p7emYHfCY3T/ZVLcZmNHKljxzEFAhD3U1qrS3fzUs50ZC4 qXIBpl9yOiFL/bPKaX9CLwpUznVXkaxuJ3+QfOm0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LqQzp-1iBDQT0OLR-00e1fu; Thu, 27 Jun 2019 20:56:52 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 09/31] staging: bcm2835-camera: Fix spacing around operators Date: Thu, 27 Jun 2019 20:56:06 +0200 Message-Id: <1561661788-22744-10-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:NT/Mec+cri+fykMHmyqvjkqXqGn5VJZ3ZEojfBcXBu9tYhF80KD cxSUBLNchH7OlDk2+f4Sxn7aEI/dT2OGsYchfsIO6TzjWFiRJ6og4GVj5dr/7QaVNBjbNW5 ZBaTcThWYAqN24Xx4K5b0MwHVCliVoxHGD/G3Khnh9YIZ9VSMs/krXArkb+OYXpyu8EDWJL 6HZCL8HnPLIaJAm+DpWbw== X-UI-Out-Filterresults: notjunk:1;V03:K0:X0KZXUA+KFQ=:FYJv15bP809Y5HZebAIlBR RpL5SdtC0AqGskMrZ53Qkt23k2Lnp18M96ruYUSDW2E+OhJvB1nB4tCdQ8Qc6Vz+wFjHc9Fmt 7Yvoq32rqjUYg9s1t19fdHOfJEQHqwd2yio9p7Mx4rBB0lhesrhZnfxG162V2NZKOwJ5EFD6G yd/L30f/4p7b/Hij+c6T8+JfgnKUCvMdLubFhM1F6I2JUz539b7cqAGeiuJm9p/UcMxrEvGXm crEqRfTEGvaBK98Dhg4lhiAOPIGg+weksyBsqSRIpstUffnYBeaAQTXtlDaLi/CS7IjVyLY7R 4LpmAdlcZChIbdD/nhD7WLflAtSUQjoPNhlkZxPhss821iX+eFQXSuwvd3rwWOAJ8eH3WBmJe qMfYUMUk000IsvmYBuPJlfCNIApp88IAd1VaojqvIFBaqGwtR/da8z84VeRE5c++IfPcoTbpH fx49obV8vpHNySJdDTPd+VScc+Eg+Ro50oI42w/BI6IYFF3wK9tMh2WoYZyxDcKhAhXxvjWgF PQeEJ/qwpc9JaTkZL8AwfuBAEL2czSvUVeDrvSyM2+X9sct0PcEOKZbjAMC3bJw9+a2xQjoRQ 9zqpZgGAq/zhzkqhgxBKBU9ojET1fIEGmitEA28qnqiKwfyn2b0sGLJcwD1i7MlCs2GcKyLOs 5BpqGdcnqL6ZwVoxcnoJmgcVhxyKgKSoXVYg0VPxalDIMjKYxKOdTLGEo/hrpOS7xw1bT6s/u iT6P5HQJLKdAHGx2N/8AGzSeGfbIXT+sKMnbj6HfHm5leHmViWVGkGbx0NWL9URTzMBAf+YUq P5Jcn1TpwmmN53XeQugyxKY9P4FKHQ3HEWmoV+lNBu2F1MQ8951HRCP82Xsq3/bHpYOREnNzl sw18VKXn8KKMQz+z0BAxXiR+af0zmhSzxCnQQ6rwXH74pKRwUWWoNpEC3NA34gmG/2Ytt854n 4FH7TFJF58OtMhAk1vPlnbFOIrXNa1uLrxVdpXiBPbw2dzs+iQtHKIVRrs2HnRnEtbgXjey/J wnNq++idhSp9e2egKIthRjboJrvvvPssXEZcdF6vwfgei3cnaWYA7VqhzoSnWsYOGHQ6ayWeX riTNMArq39kUkY= 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 From: Dave Stevenson Fix checkpatch warnings over spaces around operators. Many were around operations that can be replaced with the BIT(x) macro, so replace with that where appropriate. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/controls.c | 32 +++++++++++----------- .../vc04_services/bcm2835-camera/mmal-msg.h | 3 +- .../vc04_services/bcm2835-camera/mmal-parameters.h | 12 ++++---- 3 files changed, 24 insertions(+), 23 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index b142130..e79e7cd 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -1130,10 +1130,10 @@ static const struct bm2835_mmal_v4l2_ctrl v4l2_ctrls[V4L2_CTRL_COUNT] = { { V4L2_CID_MPEG_VIDEO_H264_PROFILE, MMAL_CONTROL_TYPE_STD_MENU, - ~((1<1) */ #define MMAL_BUFFER_HEADER_FLAG_FRAME \ - (MMAL_BUFFER_HEADER_FLAG_FRAME_START|MMAL_BUFFER_HEADER_FLAG_FRAME_END) + (MMAL_BUFFER_HEADER_FLAG_FRAME_START | \ + MMAL_BUFFER_HEADER_FLAG_FRAME_END) /* Signals that the current payload is a keyframe (i.e. self decodable) */ #define MMAL_BUFFER_HEADER_FLAG_KEYFRAME BIT(3) /* diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h index 96e987d..6d21594 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-parameters.h @@ -23,17 +23,17 @@ #define __MMAL_PARAMETERS_H /** Common parameter ID group, used with many types of component. */ -#define MMAL_PARAMETER_GROUP_COMMON (0<<16) +#define MMAL_PARAMETER_GROUP_COMMON (0 << 16) /** Camera-specific parameter ID group. */ -#define MMAL_PARAMETER_GROUP_CAMERA (1<<16) +#define MMAL_PARAMETER_GROUP_CAMERA (1 << 16) /** Video-specific parameter ID group. */ -#define MMAL_PARAMETER_GROUP_VIDEO (2<<16) +#define MMAL_PARAMETER_GROUP_VIDEO (2 << 16) /** Audio-specific parameter ID group. */ -#define MMAL_PARAMETER_GROUP_AUDIO (3<<16) +#define MMAL_PARAMETER_GROUP_AUDIO (3 << 16) /** Clock-specific parameter ID group. */ -#define MMAL_PARAMETER_GROUP_CLOCK (4<<16) +#define MMAL_PARAMETER_GROUP_CLOCK (4 << 16) /** Miracast-specific parameter ID group. */ -#define MMAL_PARAMETER_GROUP_MIRACAST (5<<16) +#define MMAL_PARAMETER_GROUP_MIRACAST (5 << 16) /* Common parameters */ enum mmal_parameter_common_type { From patchwork Thu Jun 27 18:56:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 812F514C0 for ; Thu, 27 Jun 2019 18:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 748E11FFE6 for ; Thu, 27 Jun 2019 18:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67EA427FC0; Thu, 27 Jun 2019 18:57:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D19F71FFE6 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbfF0S5U (ORCPT ); Thu, 27 Jun 2019 14:57:20 -0400 Received: from mout.gmx.net ([212.227.15.15]:47873 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726606AbfF0S5U (ORCPT ); Thu, 27 Jun 2019 14:57:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661812; bh=sHAArv7aTA1gYYdUzr/Wg7yqIZekpkzvu/aFSlylfxc=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=MVTr5HzY3ZyeVMlLVrzCfYmTfRTpC2/ZBYJQwAKNN0M97JVJcKnvsHtfd0MNjj5+o mni3KkA2FfruiC/87hAIZonCBKbSAqVxfx+oTn/i4QSPisqD1LzdBQNgAw7YFWv3zX R+feeC6OT3OUS7OfI/ypTntVRXYyUXezax2nI4yk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lw285-1icpU924zt-017oWc; Thu, 27 Jun 2019 20:56:52 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 10/31] staging: bcm2835-camera: Reduce length of enum names Date: Thu, 27 Jun 2019 20:56:07 +0200 Message-Id: <1561661788-22744-11-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:z1+7PMipwPHKd6Dz6+DCi0WAepEVkOa92+QAaQR8hRP1ApBrApP euTNiBoUvDKl/OE0oNc0GV7ohIUQGes01EzUeE7R/8IP06jrhOhkIZO+uw8fw5mklR/LMQ0 7RRmuyVYME885X3FlPfzQePb3ym99I1GG9u5EWQNH/444GbvWfT9/bVEXCp55A3tnq79wep cVlZWqSrcR+iAoF+cwf5w== X-UI-Out-Filterresults: notjunk:1;V03:K0:QiaTQv4Xfmc=:zb4MzAm1cAhImH706h9nVO J1WhAeON0W4pXV/BR1rfwLQaVSjuzx0pDZg79St7FYVYAHF0IliQ7PqpVGgdxDxYn6F7HtrnL CyXeVqOyeVAkR8pasCwTDSoK/AbQWtLEO7GzDl8hJ9Dn45vXvihfcGkJKN3gJ9pC65IWoCeV0 MGIiiY7RZJaiTWIerqzOCnvDEodRljBacOD74/zh0pwA+kD4+4amm7U1XN0HMht9qljHBCQzj 3w5o01KSvccjoZkQw2bzHaxIn9+pQIiYejd/wiG6/mlVEOethTETSgkVDgWKUnRwFQ7OvLcYj m94/ptzSFqfmdrkqFSiEnR+DjVdiqfJID418cqeJja8HdvOI+kvHEKgdrxMAatJWDR7wIRwk9 A0ylaC+GmG6EdqeXtkPjPivvfkbWZh+JD+IOR4Hs6tK798dE1MQqaCGytx+Z+RCmyi08RCHUG BuMWN3AOtoXisl41HVOeUne6Ar+13KGV6ULVs6kBLHh8FWja8y39PvgPXX9xxqt4FN7s6FcBG VxWqGGhu1udjA08cB3loWxv/MqPUgxGGSj4X3yfdkPT6ePLDqLpzGcOqXUQ0gZg9sKmhUlGQ8 +CuJkZgBsJCrltT0zRdoQs/o713n8qjhRvoFwu/1/6snJUDWGirpHaPhz+VWZKsox5WJ+OpXJ Fbv34jUxeIFDKeIhBzEx5eBdwpMGI0dk6C1ko5AoX8Dg9X2mhLUmkL40F8moTINkWRZTy5mOh RUmZHcWAWB0ecYSkTDd+xKq/WtbJee180U4KWaXVNmYpF+jD+GFQfpwTisHR0hheQYMcvVOaE H3kUUP8RfkyP3zNx5kAVIC4d4wsPIFPsoEJVTrMZCirBaXwG4mX74W2/jEvprBEs1/X8T79P7 VUf7Xtndlt1Q4PfSKQcMTAwCeLPdcgLTgKfjWHXbvv5A8jFfjM6gYSOwxWgZE2Runzvb8VuIj l3IqADS5p8+hpxVQMNXo3mdJmK32hQm7Wf0D1nSE56iWzxi6sCeQwCMNvtC1+uoLa0RhgpGt3 BBMXr3DvOuTN1XNZi2mc3hzjWVorD/2m2WNuBqbU0vUXNvhVvORrctMTW43Ewff12nVoi87tc C6/DTi6661i7IM= 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 From: Dave Stevenson We have numerous lines over 80 chars, or oddly split. Many of these are due to using long enum names such as MMAL_COMPONENT_CAMERA. Reduce the length of these enum names. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 156 +++++++++++---------- .../vc04_services/bcm2835-camera/bcm2835-camera.h | 20 +-- .../vc04_services/bcm2835-camera/controls.c | 47 +++---- 3 files changed, 111 insertions(+), 112 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 814deee..23f7754 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -80,7 +80,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_I420, .depth = 12, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 1, .remove_padding = 1, }, { @@ -89,7 +89,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_YUYV, .depth = 16, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 2, .remove_padding = 0, }, { @@ -98,7 +98,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_RGB24, .depth = 24, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 3, .remove_padding = 0, }, { @@ -107,7 +107,7 @@ static struct mmal_fmt formats[] = { .flags = V4L2_FMT_FLAG_COMPRESSED, .mmal = MMAL_ENCODING_JPEG, .depth = 8, - .mmal_component = MMAL_COMPONENT_IMAGE_ENCODE, + .mmal_component = COMP_IMAGE_ENCODE, .ybbp = 0, .remove_padding = 0, }, { @@ -116,7 +116,7 @@ static struct mmal_fmt formats[] = { .flags = V4L2_FMT_FLAG_COMPRESSED, .mmal = MMAL_ENCODING_H264, .depth = 8, - .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE, + .mmal_component = COMP_VIDEO_ENCODE, .ybbp = 0, .remove_padding = 0, }, { @@ -125,7 +125,7 @@ static struct mmal_fmt formats[] = { .flags = V4L2_FMT_FLAG_COMPRESSED, .mmal = MMAL_ENCODING_MJPEG, .depth = 8, - .mmal_component = MMAL_COMPONENT_VIDEO_ENCODE, + .mmal_component = COMP_VIDEO_ENCODE, .ybbp = 0, .remove_padding = 0, }, { @@ -134,7 +134,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_YVYU, .depth = 16, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 2, .remove_padding = 0, }, { @@ -143,7 +143,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_VYUY, .depth = 16, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 2, .remove_padding = 0, }, { @@ -152,7 +152,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_UYVY, .depth = 16, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 2, .remove_padding = 0, }, { @@ -161,7 +161,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_NV12, .depth = 12, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 1, .remove_padding = 1, }, { @@ -170,7 +170,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_BGR24, .depth = 24, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 3, .remove_padding = 0, }, { @@ -179,7 +179,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_YV12, .depth = 12, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 1, .remove_padding = 1, }, { @@ -188,7 +188,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_NV21, .depth = 12, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 1, .remove_padding = 1, }, { @@ -197,7 +197,7 @@ static struct mmal_fmt formats[] = { .flags = 0, .mmal = MMAL_ENCODING_BGRA, .depth = 32, - .mmal_component = MMAL_COMPONENT_CAMERA, + .mmal_component = COMP_CAMERA, .ybbp = 4, .remove_padding = 0, }, @@ -313,7 +313,7 @@ static void buffer_cleanup(struct vb2_buffer *vb) static inline bool is_capturing(struct bm2835_mmal_dev *dev) { return dev->capture.camera_port == - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE]; } static void buffer_cb(struct vchiq_mmal_instance *instance, @@ -422,7 +422,7 @@ static int enable_camera(struct bm2835_mmal_dev *dev) if (!dev->camera_use_count) { ret = vchiq_mmal_port_parameter_set( dev->instance, - &dev->component[MMAL_COMPONENT_CAMERA]->control, + &dev->component[COMP_CAMERA]->control, MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num, sizeof(dev->camera_num)); if (ret < 0) { @@ -433,7 +433,7 @@ static int enable_camera(struct bm2835_mmal_dev *dev) ret = vchiq_mmal_component_enable( dev->instance, - dev->component[MMAL_COMPONENT_CAMERA]); + dev->component[COMP_CAMERA]); if (ret < 0) { v4l2_err(&dev->v4l2_dev, "Failed enabling camera, ret %d\n", ret); @@ -465,7 +465,7 @@ static int disable_camera(struct bm2835_mmal_dev *dev) ret = vchiq_mmal_component_disable( dev->instance, - dev->component[MMAL_COMPONENT_CAMERA]); + dev->component[COMP_CAMERA]); if (ret < 0) { v4l2_err(&dev->v4l2_dev, "Failed disabling camera, ret %d\n", ret); @@ -473,7 +473,7 @@ static int disable_camera(struct bm2835_mmal_dev *dev) } vchiq_mmal_port_parameter_set( dev->instance, - &dev->component[MMAL_COMPONENT_CAMERA]->control, + &dev->component[COMP_CAMERA]->control, MMAL_PARAMETER_CAMERA_NUM, &i, sizeof(i)); } @@ -525,7 +525,7 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) /* if the preview is not already running, wait for a few frames for AGC * to settle down. */ - if (!dev->component[MMAL_COMPONENT_PREVIEW]->enabled) + if (!dev->component[COMP_PREVIEW]->enabled) msleep(300); /* enable the connection from camera to encoder (if applicable) */ @@ -748,9 +748,9 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *priv, vidioc_try_fmt_vid_overlay(file, priv, f); dev->overlay = f->fmt.win; - if (dev->component[MMAL_COMPONENT_PREVIEW]->enabled) { + if (dev->component[COMP_PREVIEW]->enabled) { set_overlay_params(dev, - &dev->component[MMAL_COMPONENT_PREVIEW]->input[0]); + &dev->component[COMP_PREVIEW]->input[0]); } return 0; @@ -763,12 +763,12 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on) struct vchiq_mmal_port *src; struct vchiq_mmal_port *dst; - if ((on && dev->component[MMAL_COMPONENT_PREVIEW]->enabled) || - (!on && !dev->component[MMAL_COMPONENT_PREVIEW]->enabled)) + if ((on && dev->component[COMP_PREVIEW]->enabled) || + (!on && !dev->component[COMP_PREVIEW]->enabled)) return 0; /* already in requested state */ src = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW]; if (!on) { /* disconnect preview ports and disable component */ @@ -780,14 +780,14 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on) if (ret >= 0) ret = vchiq_mmal_component_disable( dev->instance, - dev->component[MMAL_COMPONENT_PREVIEW]); + dev->component[COMP_PREVIEW]); disable_camera(dev); return ret; } /* set preview port format and connect it to output */ - dst = &dev->component[MMAL_COMPONENT_PREVIEW]->input[0]; + dst = &dev->component[COMP_PREVIEW]->input[0]; ret = vchiq_mmal_port_set_format(dev->instance, src); if (ret < 0) @@ -804,7 +804,7 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on) ret = vchiq_mmal_component_enable( dev->instance, - dev->component[MMAL_COMPONENT_PREVIEW]); + dev->component[COMP_PREVIEW]); if (ret < 0) return ret; @@ -825,7 +825,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh, */ struct bm2835_mmal_dev *dev = video_drvdata(file); struct vchiq_mmal_port *preview_port = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW]; a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY | V4L2_FBUF_CAP_GLOBAL_ALPHA; @@ -1023,27 +1023,29 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, } /* format dependent port setup */ switch (mfmt->mmal_component) { - case MMAL_COMPONENT_CAMERA: + case COMP_CAMERA: /* Make a further decision on port based on resolution */ if (f->fmt.pix.width <= max_video_width && f->fmt.pix.height <= max_video_height) camera_port = port = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]; + &dev->component[COMP_CAMERA]-> + output[CAM_PORT_VIDEO]; else camera_port = port = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE]; + &dev->component[COMP_CAMERA]-> + output[CAM_PORT_CAPTURE]; break; - case MMAL_COMPONENT_IMAGE_ENCODE: - encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE]; - port = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0]; + case COMP_IMAGE_ENCODE: + encode_component = dev->component[COMP_IMAGE_ENCODE]; + port = &dev->component[COMP_IMAGE_ENCODE]->output[0]; camera_port = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE]; break; - case MMAL_COMPONENT_VIDEO_ENCODE: - encode_component = dev->component[MMAL_COMPONENT_VIDEO_ENCODE]; - port = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; + case COMP_VIDEO_ENCODE: + encode_component = dev->component[COMP_VIDEO_ENCODE]; + port = &dev->component[COMP_VIDEO_ENCODE]->output[0]; camera_port = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO]; break; default: break; @@ -1083,13 +1085,13 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ret = vchiq_mmal_port_set_format(dev->instance, camera_port); - if (!ret && - camera_port == - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]) { + if (!ret + && camera_port == + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO]) { bool overlay_enabled = - !!dev->component[MMAL_COMPONENT_PREVIEW]->enabled; + !!dev->component[COMP_PREVIEW]->enabled; struct vchiq_mmal_port *preview_port = - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW]; /* Preview and encode ports need to match on resolution */ if (overlay_enabled) { /* Need to disable the overlay before we can update @@ -1120,7 +1122,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, ret = vchiq_mmal_port_connect_tunnel( dev->instance, preview_port, - &dev->component[MMAL_COMPONENT_PREVIEW]->input[0]); + &dev->component[COMP_PREVIEW]->input[0]); if (!ret) ret = vchiq_mmal_port_enable(dev->instance, preview_port, @@ -1174,11 +1176,11 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, port->format.encoding_variant = 0; /* Set any encoding specific parameters */ switch (mfmt->mmal_component) { - case MMAL_COMPONENT_VIDEO_ENCODE: + case COMP_VIDEO_ENCODE: port->format.bitrate = dev->capture.encode_bitrate; break; - case MMAL_COMPONENT_IMAGE_ENCODE: + case COMP_IMAGE_ENCODE: /* Could set EXIF parameters here */ break; default: @@ -1549,14 +1551,14 @@ static int mmal_init(struct bm2835_mmal_dev *dev) /* get the camera component ready */ ret = vchiq_mmal_component_init(dev->instance, "ril.camera", - &dev->component[MMAL_COMPONENT_CAMERA]); + &dev->component[COMP_CAMERA]); if (ret < 0) goto unreg_mmal; - camera = dev->component[MMAL_COMPONENT_CAMERA]; - if (camera->outputs < MMAL_CAMERA_PORT_COUNT) { + camera = dev->component[COMP_CAMERA]; + if (camera->outputs < CAM_PORT_COUNT) { v4l2_err(&dev->v4l2_dev, "%s: too few camera outputs %d needed %d\n", - __func__, camera->outputs, MMAL_CAMERA_PORT_COUNT); + __func__, camera->outputs, CAM_PORT_COUNT); ret = -EINVAL; goto unreg_camera; } @@ -1578,7 +1580,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev) dev->rgb_bgr_swapped = true; param_size = sizeof(supported_encodings); ret = vchiq_mmal_port_parameter_get(dev->instance, - &camera->output[MMAL_CAMERA_PORT_CAPTURE], + &camera->output[CAM_PORT_CAPTURE], MMAL_PARAMETER_SUPPORTED_ENCODINGS, &supported_encodings, ¶m_size); @@ -1599,7 +1601,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev) } } } - format = &camera->output[MMAL_CAMERA_PORT_PREVIEW].format; + format = &camera->output[CAM_PORT_PREVIEW].format; format->encoding = MMAL_ENCODING_OPAQUE; format->encoding_variant = MMAL_ENCODING_I420; @@ -1613,7 +1615,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev) format->es->video.frame_rate.num = 0; /* Rely on fps_range */ format->es->video.frame_rate.den = 1; - format = &camera->output[MMAL_CAMERA_PORT_VIDEO].format; + format = &camera->output[CAM_PORT_VIDEO].format; format->encoding = MMAL_ENCODING_OPAQUE; format->encoding_variant = MMAL_ENCODING_I420; @@ -1627,7 +1629,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev) format->es->video.frame_rate.num = 0; /* Rely on fps_range */ format->es->video.frame_rate.den = 1; - format = &camera->output[MMAL_CAMERA_PORT_CAPTURE].format; + format = &camera->output[CAM_PORT_CAPTURE].format; format->encoding = MMAL_ENCODING_OPAQUE; @@ -1651,49 +1653,49 @@ static int mmal_init(struct bm2835_mmal_dev *dev) /* get the preview component ready */ ret = vchiq_mmal_component_init( dev->instance, "ril.video_render", - &dev->component[MMAL_COMPONENT_PREVIEW]); + &dev->component[COMP_PREVIEW]); if (ret < 0) goto unreg_camera; - if (dev->component[MMAL_COMPONENT_PREVIEW]->inputs < 1) { + if (dev->component[COMP_PREVIEW]->inputs < 1) { ret = -EINVAL; v4l2_err(&dev->v4l2_dev, "%s: too few input ports %d needed %d\n", - __func__, dev->component[MMAL_COMPONENT_PREVIEW]->inputs, 1); + __func__, dev->component[COMP_PREVIEW]->inputs, 1); goto unreg_preview; } /* get the image encoder component ready */ ret = vchiq_mmal_component_init( dev->instance, "ril.image_encode", - &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]); + &dev->component[COMP_IMAGE_ENCODE]); if (ret < 0) goto unreg_preview; - if (dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs < 1) { + if (dev->component[COMP_IMAGE_ENCODE]->inputs < 1) { ret = -EINVAL; v4l2_err(&dev->v4l2_dev, "%s: too few input ports %d needed %d\n", - __func__, dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs, + __func__, dev->component[COMP_IMAGE_ENCODE]->inputs, 1); goto unreg_image_encoder; } /* get the video encoder component ready */ ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode", - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]); + &dev->component[COMP_VIDEO_ENCODE]); if (ret < 0) goto unreg_image_encoder; - if (dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs < 1) { + if (dev->component[COMP_VIDEO_ENCODE]->inputs < 1) { ret = -EINVAL; v4l2_err(&dev->v4l2_dev, "%s: too few input ports %d needed %d\n", - __func__, dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs, + __func__, dev->component[COMP_VIDEO_ENCODE]->inputs, 1); goto unreg_vid_encoder; } { struct vchiq_mmal_port *encoder_port = - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; + &dev->component[COMP_VIDEO_ENCODE]->output[0]; encoder_port->format.encoding = MMAL_ENCODING_H264; ret = vchiq_mmal_port_set_format(dev->instance, encoder_port); @@ -1704,12 +1706,12 @@ static int mmal_init(struct bm2835_mmal_dev *dev) vchiq_mmal_port_parameter_set( dev->instance, - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->control, + &dev->component[COMP_VIDEO_ENCODE]->control, MMAL_PARAMETER_VIDEO_IMMUTABLE_INPUT, &enable, sizeof(enable)); vchiq_mmal_port_parameter_set(dev->instance, - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->control, + &dev->component[COMP_VIDEO_ENCODE]->control, MMAL_PARAMETER_MINIMISE_FRAGMENTATION, &enable, sizeof(enable)); @@ -1727,23 +1729,23 @@ static int mmal_init(struct bm2835_mmal_dev *dev) pr_err("Cleanup: Destroy video encoder\n"); vchiq_mmal_component_finalise( dev->instance, - dev->component[MMAL_COMPONENT_VIDEO_ENCODE]); + dev->component[COMP_VIDEO_ENCODE]); unreg_image_encoder: pr_err("Cleanup: Destroy image encoder\n"); vchiq_mmal_component_finalise( dev->instance, - dev->component[MMAL_COMPONENT_IMAGE_ENCODE]); + dev->component[COMP_IMAGE_ENCODE]); unreg_preview: pr_err("Cleanup: Destroy video render\n"); vchiq_mmal_component_finalise(dev->instance, - dev->component[MMAL_COMPONENT_PREVIEW]); + dev->component[COMP_PREVIEW]); unreg_camera: pr_err("Cleanup: Destroy camera\n"); vchiq_mmal_component_finalise(dev->instance, - dev->component[MMAL_COMPONENT_CAMERA]); + dev->component[COMP_CAMERA]); unreg_mmal: vchiq_mmal_finalise(dev->instance); @@ -1799,19 +1801,19 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev) dev->capture.encode_component); } vchiq_mmal_component_disable(dev->instance, - dev->component[MMAL_COMPONENT_CAMERA]); + dev->component[COMP_CAMERA]); vchiq_mmal_component_finalise(dev->instance, - dev->component[MMAL_COMPONENT_VIDEO_ENCODE]); + dev->component[COMP_VIDEO_ENCODE]); vchiq_mmal_component_finalise(dev->instance, - dev->component[MMAL_COMPONENT_IMAGE_ENCODE]); + dev->component[COMP_IMAGE_ENCODE]); vchiq_mmal_component_finalise(dev->instance, - dev->component[MMAL_COMPONENT_PREVIEW]); + dev->component[COMP_PREVIEW]); vchiq_mmal_component_finalise(dev->instance, - dev->component[MMAL_COMPONENT_CAMERA]); + dev->component[COMP_CAMERA]); v4l2_ctrl_handler_free(&dev->ctrl_handler); diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index 9833828..b8a466e 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -16,18 +16,18 @@ #define V4L2_CTRL_COUNT 29 /* number of v4l controls */ enum { - MMAL_COMPONENT_CAMERA = 0, - MMAL_COMPONENT_PREVIEW, - MMAL_COMPONENT_IMAGE_ENCODE, - MMAL_COMPONENT_VIDEO_ENCODE, - MMAL_COMPONENT_COUNT + COMP_CAMERA = 0, + COMP_PREVIEW, + COMP_IMAGE_ENCODE, + COMP_VIDEO_ENCODE, + COMP_COUNT }; enum { - MMAL_CAMERA_PORT_PREVIEW = 0, - MMAL_CAMERA_PORT_VIDEO, - MMAL_CAMERA_PORT_CAPTURE, - MMAL_CAMERA_PORT_COUNT + CAM_PORT_PREVIEW = 0, + CAM_PORT_VIDEO, + CAM_PORT_CAPTURE, + CAM_PORT_COUNT }; #define PREVIEW_LAYER 2 @@ -61,7 +61,7 @@ struct bm2835_mmal_dev { /* allocated mmal instance and components */ struct vchiq_mmal_instance *instance; - struct vchiq_mmal_component *component[MMAL_COMPONENT_COUNT]; + struct vchiq_mmal_component *component[COMP_COUNT]; int camera_use_count; struct v4l2_window overlay; diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index e79e7cd..b3d7029 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -177,7 +177,7 @@ static int ctrl_set_rational(struct bm2835_mmal_dev *dev, struct mmal_parameter_rational rational_value; struct vchiq_mmal_port *control; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; rational_value.num = ctrl->val; rational_value.den = 100; @@ -195,7 +195,7 @@ static int ctrl_set_value(struct bm2835_mmal_dev *dev, u32 u32_value; struct vchiq_mmal_port *control; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; u32_value = ctrl->val; @@ -220,7 +220,7 @@ static int ctrl_set_iso(struct bm2835_mmal_dev *dev, dev->manual_iso_enabled = (ctrl->val == V4L2_ISO_SENSITIVITY_MANUAL); - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; if (dev->manual_iso_enabled) u32_value = dev->iso; @@ -239,7 +239,7 @@ static int ctrl_set_value_ev(struct bm2835_mmal_dev *dev, s32 s32_value; struct vchiq_mmal_port *control; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; s32_value = (ctrl->val - 12) * 2; /* Convert from index to 1/6ths */ @@ -256,7 +256,7 @@ static int ctrl_set_rotate(struct bm2835_mmal_dev *dev, u32 u32_value; struct vchiq_mmal_component *camera; - camera = dev->component[MMAL_COMPONENT_CAMERA]; + camera = dev->component[COMP_CAMERA]; u32_value = ((ctrl->val % 360) / 90) * 90; @@ -290,7 +290,7 @@ static int ctrl_set_flip(struct bm2835_mmal_dev *dev, else dev->vflip = ctrl->val; - camera = dev->component[MMAL_COMPONENT_CAMERA]; + camera = dev->component[COMP_CAMERA]; if (dev->hflip && dev->vflip) u32_value = MMAL_PARAM_MIRROR_BOTH; @@ -327,7 +327,7 @@ static int ctrl_set_exposure(struct bm2835_mmal_dev *dev, struct vchiq_mmal_port *control; int ret = 0; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; if (mmal_ctrl->mmal_id == MMAL_PARAMETER_SHUTTER_SPEED) { /* V4L2 is in 100usec increments. @@ -402,7 +402,7 @@ static int ctrl_set_metering_mode(struct bm2835_mmal_dev *dev, struct vchiq_mmal_port *control; u32 u32_value = dev->metering_mode; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; return vchiq_mmal_port_parameter_set(dev->instance, control, mmal_ctrl->mmal_id, @@ -418,7 +418,7 @@ static int ctrl_set_flicker_avoidance(struct bm2835_mmal_dev *dev, u32 u32_value; struct vchiq_mmal_port *control; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; switch (ctrl->val) { case V4L2_CID_POWER_LINE_FREQUENCY_DISABLED: @@ -447,7 +447,7 @@ static int ctrl_set_awb_mode(struct bm2835_mmal_dev *dev, u32 u32_value; struct vchiq_mmal_port *control; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; switch (ctrl->val) { case V4L2_WHITE_BALANCE_MANUAL: @@ -503,7 +503,7 @@ static int ctrl_set_awb_gains(struct bm2835_mmal_dev *dev, struct vchiq_mmal_port *control; struct mmal_parameter_awbgains gains; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; if (ctrl->id == V4L2_CID_RED_BALANCE) dev->red_gain = ctrl->val; @@ -551,7 +551,7 @@ static int ctrl_set_image_effect(struct bm2835_mmal_dev *dev, v4l2_to_mmal_effects_values[i].v; } - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; ret = vchiq_mmal_port_parameter_set( dev->instance, control, @@ -584,7 +584,7 @@ static int ctrl_set_colfx(struct bm2835_mmal_dev *dev, int ret; struct vchiq_mmal_port *control; - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; dev->colourfx.enable = (ctrl->val & 0xff00) >> 8; dev->colourfx.enable = ctrl->val & 0xff; @@ -610,7 +610,7 @@ static int ctrl_set_bitrate(struct bm2835_mmal_dev *dev, dev->capture.encode_bitrate = ctrl->val; - encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; + encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0]; ret = vchiq_mmal_port_parameter_set(dev->instance, encoder_out, mmal_ctrl->mmal_id, &ctrl->val, @@ -636,7 +636,7 @@ static int ctrl_set_bitrate_mode(struct bm2835_mmal_dev *dev, u32 bitrate_mode; struct vchiq_mmal_port *encoder_out; - encoder_out = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; + encoder_out = &dev->component[COMP_VIDEO_ENCODE]->output[0]; dev->capture.encode_bitrate_mode = ctrl->val; switch (ctrl->val) { @@ -663,7 +663,7 @@ static int ctrl_set_image_encode_output(struct bm2835_mmal_dev *dev, u32 u32_value; struct vchiq_mmal_port *jpeg_out; - jpeg_out = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0]; + jpeg_out = &dev->component[COMP_IMAGE_ENCODE]->output[0]; u32_value = ctrl->val; @@ -679,7 +679,7 @@ static int ctrl_set_video_encode_param_output(struct bm2835_mmal_dev *dev, u32 u32_value; struct vchiq_mmal_port *vid_enc_ctl; - vid_enc_ctl = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0]; + vid_enc_ctl = &dev->component[COMP_VIDEO_ENCODE]->output[0]; u32_value = ctrl->val; @@ -792,7 +792,7 @@ static int ctrl_set_video_encode_profile_level(struct bm2835_mmal_dev *dev, } ret = vchiq_mmal_port_parameter_set(dev->instance, - &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0], + &dev->component[COMP_VIDEO_ENCODE]->output[0], mmal_ctrl->mmal_id, ¶m, sizeof(param)); } @@ -810,7 +810,7 @@ static int ctrl_set_scene_mode(struct bm2835_mmal_dev *dev, v4l2_dbg(0, bcm2835_v4l2_debug, &dev->v4l2_dev, "scene mode selected %d, was %d\n", ctrl->val, dev->scene_mode); - control = &dev->component[MMAL_COMPONENT_CAMERA]->control; + control = &dev->component[COMP_CAMERA]->control; if (ctrl->val == dev->scene_mode) return 0; @@ -1228,18 +1228,15 @@ int set_framerate_params(struct bm2835_mmal_dev *dev) fps_range.fps_high.den); ret = vchiq_mmal_port_parameter_set(dev->instance, - &dev->component[MMAL_COMPONENT_CAMERA]-> - output[MMAL_CAMERA_PORT_PREVIEW], + &dev->component[COMP_CAMERA]->output[CAM_PORT_PREVIEW], MMAL_PARAMETER_FPS_RANGE, &fps_range, sizeof(fps_range)); ret += vchiq_mmal_port_parameter_set(dev->instance, - &dev->component[MMAL_COMPONENT_CAMERA]-> - output[MMAL_CAMERA_PORT_VIDEO], + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO], MMAL_PARAMETER_FPS_RANGE, &fps_range, sizeof(fps_range)); ret += vchiq_mmal_port_parameter_set(dev->instance, - &dev->component[MMAL_COMPONENT_CAMERA]-> - output[MMAL_CAMERA_PORT_CAPTURE], + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE], MMAL_PARAMETER_FPS_RANGE, &fps_range, sizeof(fps_range)); if (ret) From patchwork Thu Jun 27 18:56:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35CC41580 for ; Thu, 27 Jun 2019 18:57:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DA4526E4A for ; Thu, 27 Jun 2019 18:57:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21F6227FC0; Thu, 27 Jun 2019 18:57:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B526C2857D for ; Thu, 27 Jun 2019 18:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbfF0S5L (ORCPT ); Thu, 27 Jun 2019 14:57:11 -0400 Received: from mout.gmx.net ([212.227.15.19]:54297 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726542AbfF0S5K (ORCPT ); Thu, 27 Jun 2019 14:57:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661813; bh=zd1aDqSMaJmqIjJkz0CA2ASLC5e7tiVGocbpMQusOGE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=ZPNO9H8nR7gvoiXsL8VemBcF2ud11Z3PwuvDYhqijQ40c8NtELe7WkNAjgxinHdvm 8rmfwQhUqIcBJiME1yQu5VrFAzYY+efkN34PBNqwyYHEhCPtY7UN2513Jg2bbveWi6 51OC/ZHGl5zx+8r4VOPH8skthBa5CBAZN6nmfkrU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MFuWk-1hkRiE3rMc-00EtK9; Thu, 27 Jun 2019 20:56:53 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 11/31] staging: bcm2835-camera: Fix multiple line dereference errors Date: Thu, 27 Jun 2019 20:56:08 +0200 Message-Id: <1561661788-22744-12-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:PtIPEvvPTgzUk75vIog7SPhxn5Ru3GkyhRLJtUQw/cZpO6M41Lr hz9+bdTPs/+Q3URY7A5KhkKy5qRTJW1CwhLRzSLzVo/M1UARv/tXSiuD+qR3Pnl3ADHtvh/ Rr9u+pfrAlzuItwHmnAYLo7giHTEaW0u+y7uPrHdvp5B4/d3GNFCRT9fnnRkEj7gQUrX39V prAXM5JGs6kPGNJCAwS2g== X-UI-Out-Filterresults: notjunk:1;V03:K0:TooMdflaKKQ=:7hA9iBw2Jtc6Jig0lYMhEL mg4gXWLOf+r5undL/OAlXkVeUe4V/gN0GuhRPZGm2lPV72Gj3jSi075aiyhuIYlcP66pAJPF4 ADoFVwg7NJAaM8OaYvHKDiRONXzbmElj4Ptyexg7QYFqqN57ai83rqdclwb9ONRj/DIoLk4Lm FR5IjzDZhqTTP3ceYNQNoqJ4nu2fGhzXqCm6YaqtrfWdAymqwnKnREL6lnsLYxR35nyZfSSBx umLc6ZQfXXqyg+ZvUi9T8IHihCfmg+WOrEJP/Xzr350aJC965Ne+i3dNycwajsA9uhj6xFUP9 jv6oc94vweQ0aqQknVD6MUAJfVRcvXsqeqdkjcCLCRHuRQGYCApa5ZN2RUAy5SqSQAbWGR/Am LTkCtcBKRfWbkelqVBmVuhI00X8aSFqJ0CA8bdJhIbWWz7JYbyKeY15ksOn2GDfZd7x6b9uF2 nIgcdMRK+yc+zfUmP/pI2cqtdmYGrkuUsfHV1xsepGlRVrAP8BBEgo4U2TMwJTzw+hSeNoc5+ WI2DxPPZq4BhE/dmdlISVtizhvJODtE5EOkwwwE1wswSvDF2WBwEWoJcuu5K/gj9NThCEqErJ 0mfo0IWFY8sGG/q0dyHkBi5tHesv03OB9UpX+oOjbAovM9wG4afqZm2CwIRQM9ViS8xfLZVz2 IqusSr9W0AwSjlLRrnsE2HKzhNMKjPLkkHidJBwEFJ5gluHBPWqN0g1hPT5kJWh3gM53tyHH+ YS8179xn2YZNGA3EZM/2ObU4hcGfSuCqvrmOVl9YHZ9mqsORtfT7hXIQZHAzDLK7g7aAtXBwL 46lQYJCNkLAqmmDmd9EBLzPTQE4YuMPv5jGFzphlZTjObj/hOKVht76ungpMh7sWFy8dBz9O3 fq3oI/PaDk1YgGo7QinUz5axF7Fm+AzIYj8+FOD+GkdpKZkKO79f2cZ9+a96+TDQUNWLg4MW/ 1jwOV+BRwQdcL2eK3jBVSl3o5Kb1X3sxiSzA/Kc9MHZ1NeSQ2mJ7LZCXWWukpgitz6Xql1pRS xF7kxdIPJGhleptE05+0P6t5G/nKYP5kXi8ydG9gXQ2jgwaT1LX1pCc+IfygOkLwfemAMc62g MfgnO3mT7fvLe4= 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 From: Dave Stevenson Fix checkpatch errors "Avoid multiple line dereference" Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 23f7754..bde3548 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -1028,12 +1028,10 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, if (f->fmt.pix.width <= max_video_width && f->fmt.pix.height <= max_video_height) camera_port = port = - &dev->component[COMP_CAMERA]-> - output[CAM_PORT_VIDEO]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO]; else camera_port = port = - &dev->component[COMP_CAMERA]-> - output[CAM_PORT_CAPTURE]; + &dev->component[COMP_CAMERA]->output[CAM_PORT_CAPTURE]; break; case COMP_IMAGE_ENCODE: encode_component = dev->component[COMP_IMAGE_ENCODE]; @@ -1224,9 +1222,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev, port->current_buffer.size); port->current_buffer.size = (f->fmt.pix.sizeimage < - (100 << 10)) - ? (100 << 10) - : f->fmt.pix.sizeimage; + (100 << 10)) ? + (100 << 10) : f->fmt.pix.sizeimage; } v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, From patchwork Thu Jun 27 18:56:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020325 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BC141908 for ; Thu, 27 Jun 2019 18:57:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3220126E4A for ; Thu, 27 Jun 2019 18:57:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2647B2793A; Thu, 27 Jun 2019 18:57:15 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B18A62851E for ; Thu, 27 Jun 2019 18:57:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726586AbfF0S5N (ORCPT ); Thu, 27 Jun 2019 14:57:13 -0400 Received: from mout.gmx.net ([212.227.15.15]:55643 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbfF0S5M (ORCPT ); Thu, 27 Jun 2019 14:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661813; bh=y9U91GGxjVzyJQpb1plbYIEJEQmZ+InsHm6KQ2qTC64=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=OfiHhM+ZsYHf1e67o0JonceiUwMajz6I1biGNnKCIzTUWlhpKtvFAbS0jL7jMIeEC kdMGRk2dXpquInZbyq6Op51eFzFPpy37nIaUcUQoCDSVNKFyyBIYeQcS3/EPAFxGBT o98cKSygwS9c4BHXO3TEOOF/cjRurA0wz/Qf1Cy8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M1msU-1iaKvX1H6Q-00tm2j; Thu, 27 Jun 2019 20:56:53 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 12/31] staging: bcm2835-camera: Fix brace style issues. Date: Thu, 27 Jun 2019 20:56:09 +0200 Message-Id: <1561661788-22744-13-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:qVIKql/T/zw8kAu25TQYjRoKyLK87blKkEMQxwagdJRaqd3HSNg nnBxoYrPsVk+jLPDEdhmy+rNpT9ASf7hytS4IN8naiT4ma0wSIOLg0851yvLvoGvkEdJtlW oNAI6pBO2Jn10Hh0YCRGjyKwmLgX5Ncb4Zsm5ob3Tg4d+jo8kWpq/xfgZcXATzcm1K+p3EO L0TthjF9lznuR17YGuEYA== X-UI-Out-Filterresults: notjunk:1;V03:K0:YI/u3WTu1tU=:KE6ESASlgMx3wbH0VlbqbU pI4QSiGkGMmyL4rGdwxG9C9nl03vnI60JEeXXaFFvUiot6U4cl6yzgegf25+05osESNv0qZDj PJtIbOu9GykDcvDyzIy5vTy1mHbrazirRPRndDdLaKxws9GM1S9svKDQ8gtynd+Lt4/itEf4F 9iQmf85+j9NyVi6pCHGCxnlLe3TPRjRCvWh5AyCfYUj+1O4nTXaZwbm0g40Niz9ASStGSzljc dlaFPYG63IHNSJ7Qn3iLE7YvnoFVWWOJ3TDYA0RbZUNYKOYNri2i5xGYp9EoRfKi2lg0OS9q7 P09fH+XSiqpu/H6GDJzQUwA9qS8Dj0m0eedW72TvAsmeU0YiCjWhSmshY0lGhax+pkhtngin+ be2MVOMMda4obbkRuNeuoyfcFB6qbuQWDDceuJ9PHtpMfFCmkRIEiSEYg5JRAS0xOj4npA00V iRp3YpmMqien3Hk9PECAeBazpYNvhLGNMrzJBx/YhDWfwt/aKUj7L4d7k0vy7Hq87aGusUSfX rXGNsC7xOukSFPwyML/kvPForYajCkEIXLz6CkUYm1RKBfKy0dUDLp1gq14DpnKTtUDV8Wqtg mUVOBmrN5t5fSPVaV9S44rBENi/lJ103GWwNb4sMTDWbGgDdOUsBYCE1KoGxrXfxWwpmacYmT SuuXLg27Hw9zMne/WVYo5GtYoZiE96De0dXZyKQGzWP1qhCsIQYAUGjrSZOAYBcWzqzCRIguF 23XvTPcI3087KAJQRqud4J24HhUF6kPSRfqj0uSwRVhmNhJUWBtX/1Ua1ZyxKTL4Saul85D/A BnPV4eWx00K+sOGoeXPbYfDnIuSEguM5eoD160GKoxDc2sB4bWVe5DxWeKrt5++IQ2Vfbtj/J zi1dKZzFhXn9lCQYJnwonJtVsIUhV8sP5xf6c8RS32G0TNEC95rDLJkkIM4Tfx2BV4mAUMfWK gQPLjH4ReDT+/cJQ+2T/BYg91IemiTyBUZkdLOmvsRsQLdYYID6IxayR41UrjaJI9TgqsQBU8 2OBVhAid9BQapWdOUAE3WXbO/P1DNLki/5Kl7cUOX0iWffsAkYVBiTgpCTnu8wiydNoTIoaLW 5ZfB964EfOUYrQ= 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 From: Dave Stevenson Fix mismatched or missing brace issues flagged by checkpatch. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 3 ++- drivers/staging/vc04_services/bcm2835-camera/controls.c | 3 ++- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index bde3548..c1f6141 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -553,10 +553,11 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) /* Flag to indicate just to rely on kernel timestamps */ dev->capture.vc_start_timestamp = -1; - } else + } else { v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "Start time %lld size %d\n", dev->capture.vc_start_timestamp, parameter_size); + } dev->capture.kernel_start_ts = ktime_get(); dev->capture.last_timestamp = 0; diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index b3d7029..1a7588d 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -407,8 +407,9 @@ static int ctrl_set_metering_mode(struct bm2835_mmal_dev *dev, return vchiq_mmal_port_parameter_set(dev->instance, control, mmal_ctrl->mmal_id, &u32_value, sizeof(u32_value)); - } else + } else { return 0; + } } static int ctrl_set_flicker_avoidance(struct bm2835_mmal_dev *dev, diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 5175e2c..73cb295 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -1262,9 +1262,10 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, memcpy(value, &rmsg->u.port_parameter_get_reply.value, *value_size); *value_size = rmsg->u.port_parameter_get_reply.size; - } else + } else { memcpy(value, &rmsg->u.port_parameter_get_reply.value, rmsg->u.port_parameter_get_reply.size); + } pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, ret, port->component->handle, port->handle, parameter_id); From patchwork Thu Jun 27 18:56:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020317 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0F191580 for ; Thu, 27 Jun 2019 18:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9868426E4A for ; Thu, 27 Jun 2019 18:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C9DA2851E; Thu, 27 Jun 2019 18:57:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 428C126E4A for ; Thu, 27 Jun 2019 18:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbfF0S5L (ORCPT ); Thu, 27 Jun 2019 14:57:11 -0400 Received: from mout.gmx.net ([212.227.15.19]:37617 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726508AbfF0S5J (ORCPT ); Thu, 27 Jun 2019 14:57:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661813; bh=mXNl+XXx/SsyPzhdlqC9YK8bVtXP03p3JkGORVWAcMU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=F1G90QyPe2SlNW9KATuDq78b4ejdA75HEYki9j29jVwkYnk7mM7YpNZSPUNWjgKQf XU7X1Cm8A2oKhufAy2VTzLCbJkkE+PIa5OSDmOB+uDMkOjWHYUrLPUbQiUvp2DnoG0 yanTaZx2+SbpGjN1KRs1Q4x4LEaahMi6yCzagEus= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M23zf-1ia3oM2tX1-00u39s; Thu, 27 Jun 2019 20:56:53 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 13/31] staging: bcm2835-camera: Fix missing lines between items Date: Thu, 27 Jun 2019 20:56:10 +0200 Message-Id: <1561661788-22744-14-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:uTPgukxSV32JLw6V83fULGu7PQ5Wfy7OdHFGDQDF8sVHhzCMHkV 7+/C3Bu7dmc/gSJ5AzgFDPXPceKNKWICryuJj8h3QoRiHKt92p0pxnAAW+2WZJzbrLHcmRx YI1aildOO5SRfw21/ln58U1I39yUN82+xpx8kzqWdNCr7gOJ4fUZSGmamLn4I5IS0+7YaZS 0jTYHyU5AHee8t8czJoAQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:k88a5ZznIWI=:3xAviE5pDVLgLsTht3p8Pm UXuv8KLqXQ1NlQGuoMoGEEzmoSLRmAlV0sjt+aytKWYfPnm+Ws/PMfUCnDIgSPO8Y4IBdyM7Q v7XFDGOohM9FTMXFcLH4pZKIcVGPotXoiI2IrG3iiu3bACBfTAq/Q/TM9A8UwSY16YwQfuQqn eTB6ZFd3gvARF2iALvS6pA2gBBAq3lPVXxpYQ44w/Ic/rcxctrqkUyrLriV+Z4rqG20KDlyAO VkX9uFXmaTtxb34tjNEgcgubB2wleAFZ4Pw/5+lNQe1Q4CqBX5CVMS0Ubcz2hqfJxYD1ilqRO E8cEBrqxRbjeHMKc5Qdgz7SfFZcldpHgnghmDNjaIX6j6lrh3cs7xLj6qzXkU/rFFUns+xeGn 0zKZDEq/1vf4GdD3EG7yVytVlJZsuyu/TUrr8Fkp/OWf3u6+SLyr10HTo4aPjC+UPNwu5MKOe LeoWrpwuNsBFM3QheCdHCPQdppHf22HGg73a1bcRvJ7qNU6BaR5UzcKw+qOqYZHt9xb9w5k6w CRwY4eoPZLYrK3cCc30iKpo10c6LHi3LR3SnLx5gMxpkRRN4I0AwA3oGaD4HeyUZy3ZkuJ85Z yaGeCoFbBXnmVda/4DcNnyFi0hwLFf8diTbCUT6WrK1FnxLINzD4OqB2qEcIh4xekyvlAQIqk rc+rsFz+zpkoVwKYE8OfQVDXLH0uhlWe6IgHeJ5mMqo/8NUx+263Nlp9X3JM5yO8B5F7dmpM1 OzZFhPhqLsg85SOyAGFzEIxcqSoZPb9uHJyL8t3cbUV/QLp1glfKNZzvzi5rWX+2EQvxDipOA 0+mZw6G3Q4sSgyj8euMDHETO4kxkVNHmJB7fLm/prZRL8FCt2ISHoCaeSdELiy74/oNZqiBMg oxkRdszjMyPgpKH0njzfEmT5T+32qpGz01STdOK8/TfT7owaWqG4SyoFhqzx0aI0lYUWMgqnU R99WeTJmQpUJckwiaesZYY2Djd3qhZxvHWi8G2W15QouwH5KLhgDLQNvYbyU1s2Be0Qn4kKiz nMhRnAM/7Z6JEXrrbp221DjRUT2Xuk5Ifnv7vrJ7RTORIyX0dzQsL+n2vWu8+BJhvymgNygN2 oLh7kJAVzFTkd0= 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 From: Dave Stevenson Fix checkpatch errors for missing blank lines after variable or structure declarations. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index b8a466e..bbfe8fe 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -130,6 +130,7 @@ int set_framerate_params(struct bm2835_mmal_dev *dev); (pix_fmt)->pixelformat, (pix_fmt)->bytesperline, \ (pix_fmt)->sizeimage, (pix_fmt)->colorspace, (pix_fmt)->priv); \ } + #define v4l2_dump_win_format(level, debug, dev, win_fmt, desc) \ { \ v4l2_dbg(level, debug, dev, \ From patchwork Thu Jun 27 18:56:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D17CA1575 for ; Thu, 27 Jun 2019 18:57:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8A9A26E4A for ; Thu, 27 Jun 2019 18:57:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC80B2851E; Thu, 27 Jun 2019 18:57:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 486F226E4A for ; Thu, 27 Jun 2019 18:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726550AbfF0S5J (ORCPT ); Thu, 27 Jun 2019 14:57:09 -0400 Received: from mout.gmx.net ([212.227.15.15]:33181 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726384AbfF0S5I (ORCPT ); Thu, 27 Jun 2019 14:57:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661814; bh=6yyNYjNdpgKg7E/zAo5FWADNmpxPjFqRJ+mJmyC1l0c=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=AVVLZPUynjHOdQMO0u08fDH45K+4YFXl46L5ybKeoGNDTUiAdIy/So5k8twBARh34 ms6wt0zD8Yp8qgqHQQMmITcOoYDe6MSI4wqy7jMm8fGYYmbovNKdTUQApkRnWnVRLb ZaUvPO7gOWikwCN64gYpCYN9jyBTCHaA1swixm98= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LqzEB-1iBlen0KkV-00eZdg; Thu, 27 Jun 2019 20:56:54 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 14/31] staging: bcm2835-camera: Fix open parenthesis alignment Date: Thu, 27 Jun 2019 20:56:11 +0200 Message-Id: <1561661788-22744-15-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:cm57Kybh944S3Ry/3EX1RIW/9ppOOAAKQoy8qsO8RVkwZwhIkkF +Mjq6hhoPRP/y3e23jyWDdin0AD09Uhu8jUULj9LcjwnfNWwBh4xRnLxkeDYMD3uMNCW7QY EkpgST8matgY2k9Fhn3HhSGHtqdzwxpuCRmLV++MV8jxeMIzv3xnwIboOFwPSvdGleJ/Kpa hcjI64zHRqYZHRWxu3GhA== X-UI-Out-Filterresults: notjunk:1;V03:K0:K4riwYgziVQ=:CGtiItQWia5m0pf0ULoT7a dQYL3VQX4Oct0noUkiHar7672l27g6R/AhsU2jfH8g/1hDllC5xpXzIT12Kbs11mjJzpMJpGT EpMU6fZxZbYSV1pqu6r+JV0tXSaLjLT4eGQjd0uUYqJgcii3Mo+VpljeUV6zDyDo9b6AoSrnN 81qN5mVLvaHG8eqWrD8gVHuhAUbCETAFVR9ejySK6nJKMndcxf+xBmL5rJ596wXoBG4vX/4Pc jxKdbCcX9N9gmtouYt08nwhCh9DCRzBXoQP/BK6xplH4YiUTWWhc1UwkMhCy8hjxRrccY77TF YlKUBJGAjmfetWECLdTfirwBO22owT5uBA9iQguQbA+SMUvAGBnqUoWfTqrZO8PY44C4zC/e1 1MN+MmihpVHf12u7aRYqCF78k4KQ5Ziru4R/4iL5El3+9QlmiLvj1fToI6xKNcbe2N0FN59U6 NkH7ocQa0kVhsE3ImdbDv+PqvQ+umfFLm1fnR8UlZVPziuIV4L/qiR0+/MN4nOalJeRRRs8yj MXV1+PzVyAPcQbugPiGuGNPQ2hksJ4Ag7qdS/X9WdqQGgCeFYKVNQZADgrrBmbEzVAcJqiFA2 IPKomRxZv9C02vRw7+3PSsKbk1v4mMrEIAARaFs26D2os8xooUe4pKjqg/e/wlvGHfmxCc3b1 /Z1rL4XU9/fi9tnz9ybj9FIMrpToQgTXYYmQLgmncF/64BFOT0YY7USFknxm8RZGRtbxRX/dg 02zwWAhup4zQ5g659n3yFv5XVEpWemX6KK9qkJz6qPDfNs7Bz9RGqQ1UOQKBFJ1WLx75lkHSP zA/tTn/42uEkLd0B3Y6TOxXDmWfFBADY2rJFNRoGp9QsAS+yZd2ISLEbofjL2ICJo/4tYvo+1 7NozfQF+WGOrCKzAMCIOc4CWcgFoeLVTLdn0A8ji1zeQyF0rLjfSYR+yOI5YzSR4+RxHO5EKu MOKoC1ZpHZtrQ0ZSo58V8r8e5lHVHfMYfCEX/l2JLxgrLEnDCYs4eAjvG+A4K3gSX3NSKaOL5 wJIeW1+DR8bjgZ9Z6wC3z3oOQGXzRNYUWeLoa5utcIVpyB2sbyTgVonZuyFBfiwGkRjZfmwS1 AyGWVvZU3NJO+k= 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 From: Dave Stevenson Fix checkpatch "Alignment should match open parenthesis" errors. Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 9 ++++---- .../vc04_services/bcm2835-camera/controls.c | 25 ++++++++++++++-------- .../vc04_services/bcm2835-camera/mmal-vchiq.c | 2 +- .../vc04_services/bcm2835-camera/mmal-vchiq.h | 6 +++--- 4 files changed, 24 insertions(+), 18 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index c1f6141..4968782 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -568,8 +568,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb); if (ret) { v4l2_err(&dev->v4l2_dev, - "Failed to enable capture port - error %d. Disabling camera port again\n", - ret); + "Failed to enable capture port - error %d. Disabling camera port again\n", + ret); vchiq_mmal_port_disable(dev->instance, dev->capture.camera_port); @@ -961,8 +961,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, f->fmt.pix.bytesperline = (f->fmt.pix.bytesperline + align_mask) & ~align_mask; v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, - "Not removing padding, so bytes/line = %d, " - "(align_mask %d)\n", + "Not removing padding, so bytes/line = %d, (align_mask %d)\n", f->fmt.pix.bytesperline, align_mask); } @@ -1308,7 +1307,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, } static int vidioc_enum_framesizes(struct file *file, void *fh, - struct v4l2_frmsizeenum *fsize) + struct v4l2_frmsizeenum *fsize) { struct bm2835_mmal_dev *dev = video_drvdata(file); static const struct v4l2_frmsize_stepwise sizes = { diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 1a7588d..bc2f3f4 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -1260,9 +1260,12 @@ int bm2835_mmal_init_controls(struct bm2835_mmal_dev *dev, switch (ctrl->type) { case MMAL_CONTROL_TYPE_STD: - dev->ctrls[c] = v4l2_ctrl_new_std(hdl, - &bm2835_mmal_ctrl_ops, ctrl->id, - ctrl->min, ctrl->max, ctrl->step, ctrl->def); + dev->ctrls[c] = + v4l2_ctrl_new_std(hdl, + &bm2835_mmal_ctrl_ops, + ctrl->id, ctrl->min, + ctrl->max, ctrl->step, + ctrl->def); break; case MMAL_CONTROL_TYPE_STD_MENU: @@ -1286,16 +1289,20 @@ int bm2835_mmal_init_controls(struct bm2835_mmal_dev *dev, mask = ~mask; } - dev->ctrls[c] = v4l2_ctrl_new_std_menu(hdl, - &bm2835_mmal_ctrl_ops, ctrl->id, - ctrl->max, mask, ctrl->def); + dev->ctrls[c] = + v4l2_ctrl_new_std_menu(hdl, + &bm2835_mmal_ctrl_ops, + ctrl->id, ctrl->max, + mask, ctrl->def); break; } case MMAL_CONTROL_TYPE_INT_MENU: - dev->ctrls[c] = v4l2_ctrl_new_int_menu(hdl, - &bm2835_mmal_ctrl_ops, ctrl->id, - ctrl->max, ctrl->def, ctrl->imenu); + dev->ctrls[c] = + v4l2_ctrl_new_int_menu(hdl, + &bm2835_mmal_ctrl_ops, + ctrl->id, ctrl->max, + ctrl->def, ctrl->imenu); break; case MMAL_CONTROL_TYPE_CLUSTER: diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 73cb295..0b95723 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -645,7 +645,7 @@ static int send_synchronous_mmal_msg(struct vchiq_mmal_instance *instance, if (payload_len > (MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header))) { pr_err("payload length %d exceeds max:%d\n", payload_len, - (int)(MMAL_MSG_MAX_SIZE - + (int)(MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header))); return -EINVAL; } diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h index 0e5a81b..3498555 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h @@ -128,7 +128,7 @@ int vchiq_mmal_port_enable( * disable a port will dequeue any pending buffers */ int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance, - struct vchiq_mmal_port *port); + struct vchiq_mmal_port *port); int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance, struct vchiq_mmal_port *port, @@ -146,8 +146,8 @@ int vchiq_mmal_port_set_format(struct vchiq_mmal_instance *instance, struct vchiq_mmal_port *port); int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance, - struct vchiq_mmal_port *src, - struct vchiq_mmal_port *dst); + struct vchiq_mmal_port *src, + struct vchiq_mmal_port *dst); int vchiq_mmal_version(struct vchiq_mmal_instance *instance, u32 *major_out, From patchwork Thu Jun 27 18:56:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 308171575 for ; Thu, 27 Jun 2019 18:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2853626E4A for ; Thu, 27 Jun 2019 18:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C9BB2851E; Thu, 27 Jun 2019 18:57:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A2A8D26E4A for ; Thu, 27 Jun 2019 18:57:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbfF0S5K (ORCPT ); Thu, 27 Jun 2019 14:57:10 -0400 Received: from mout.gmx.net ([212.227.15.18]:50015 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726480AbfF0S5J (ORCPT ); Thu, 27 Jun 2019 14:57:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661814; bh=6ZFvvnoUoNYJ167DymQmDLXQrXXbVJGmoz5xkFUFkxo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=c/706gY0UgJYyKs8+M9mLDm95snT8ou0/+k7AY02/q20EFG8UvMBWwXxdHm8kiaLO nQQUwGTgzB1cK93HERpct22ndA0KGxjcN94dsH4SbYVDv2JRzbgcCUDJtzlD0n73dl mEsw6OEmBzhpYD6vXrYNrZi3eHpeeJB1VrCHWQsk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MexFh-1hvkuV23UP-00OY5a; Thu, 27 Jun 2019 20:56:54 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 15/31] staging: bcm2835-camera: Ensure all buffers are returned on disable Date: Thu, 27 Jun 2019 20:56:12 +0200 Message-Id: <1561661788-22744-16-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:O5HYnB3cVymPrHoiHasYk5no3ykdniffUN7zAl1Rg8DafcpG+T4 bMmsrtIPQWVMTk6RRq7LYJc2xvruBTi45jIn/zlwKzmn66kZyPE8CQH/Quots59VbICXMDG mGu+nBwhKtD4bnr7xQhkBu8YRzu0RArdoKdnmFkBx+C7LNRROAJl2bNW/B7zdoKYAgcHe4X ofyLC947wtCBd9WRF2v/Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:9s8AdhaoNL8=:3lw3QTv8BeSWT/9P/JphVY rwMfz8IiukzeYAHGgsC8dO7EvdYBP6MiZMtCsmT8V+aWwzPEWB/yofwLfIYBD+yX+MdGrqIAd Vbt6ngCRtAZomwSXU2rxk9yLlM9gC4gC8WHN3Zg9d5whYlPYWQuyghpUe1uEkLlKKFjBsJE9d q/bM3HWaNhMqx8vdXD1U66T3/bWy5EO7as+hyMLsVm0d99jc+1GaV2M1X7F3CoJoEpzJUiCmN 23yBEVfaf3VXY9iefmcjsCF3W+4+SJvTDvthy/FtnqRWc1Zq9vDre3swZewFDV6d2IXOxbzzo iGfa3rxLjzbdbe/NlUS5xDUXVejEt/TXs9TZaU9l3Rrwe7UwbYFpYmaKxVNvtoYzeuDUzlewS ZqidhVs21joVa20WJWOSAtayfgEwK1djFVXO00/CUlVtPZ5uS6k7iwxpM9JGUuKOzSIWckYG+ aQmFmaceFI9BV9waZgQZV2+GlgFW7gqqdlBo9B5uODBKdlF4v512UTsktfQjnL/WvKCREh+CZ 0ZCbf/6lg0V4feJilrmP4DzWc4mcZ1BR6huHNorWXBVlYssYku5rF59jDtmSphUntaCdtMY+4 a5SyHT2hlesoBmSSyGsrR6Gqid8hKwPQtBk0mU7ac29s2uWTdjyO5dnS2FKEEEWhHsJfyNTgf UWGhO8CyFdslm2abEoj4Ne0IQPUYZ7FUaimyYktzAqeFO8Zz19+AA5qklHdA+zUva8lPBDMe1 wXA5CDX72f8HCNABtWP3/0yDHGyZvBkqRC/77GfX9NJkOysA1u0uTT1YEdjTqTUGqYWQIKVMp 174QzoPb3Mr6BfRgRVyEGXSFWQv7CBJNJauVYhWFz4LxhdiAbgM3GZKO67iHc8RcqXTKlQqLl ep6U0EHC6v+YzfdaU+sSsFgaTwvxPF8HTwdaR+PdgM3E/uWnlBvnFeN18xb/NYrr4FNU5/rK8 H8RGYrQxmn9QhNFC7NSL2qFK9nkNzkoh+kOIg7v5cB1BzX/vzO+/r7q6APWHn5Oo3OUyXF/dH mSH1B0nGyk+gceokqYh4aJcslHTT3ZB6BmeznLX+eRjA8epAa6sXxZ752CswN8VDrMFtx6Tvr 0K5MiHbDdhCLjU= 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 From: Dave Stevenson With the recent change to match MMAL and V4L2 buffers there is a need to wait for all MMAL buffers to be returned during stop_streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 22 ++++++++++++++++------ .../vc04_services/bcm2835-camera/mmal-vchiq.c | 4 ++++ .../vc04_services/bcm2835-camera/mmal-vchiq.h | 3 +++ 3 files changed, 23 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 4968782..36eb4d6 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -595,6 +595,7 @@ static void stop_streaming(struct vb2_queue *vq) int ret; unsigned long timeout; struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); + struct vchiq_mmal_port *port = dev->capture.port; v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "%s: dev:%p\n", __func__, dev); @@ -618,12 +619,6 @@ static void stop_streaming(struct vb2_queue *vq) &dev->capture.frame_count, sizeof(dev->capture.frame_count)); - /* wait for last frame to complete */ - timeout = wait_for_completion_timeout(&dev->capture.frame_cmplt, HZ); - if (timeout == 0) - v4l2_err(&dev->v4l2_dev, - "timed out waiting for frame completion\n"); - v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "disabling connection\n"); @@ -638,6 +633,21 @@ static void stop_streaming(struct vb2_queue *vq) ret); } + /* wait for all buffers to be returned */ + while (atomic_read(&port->buffers_with_vpu)) { + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, + "%s: Waiting for buffers to be returned - %d outstanding\n", + __func__, atomic_read(&port->buffers_with_vpu)); + timeout = wait_for_completion_timeout(&dev->capture.frame_cmplt, + HZ); + if (timeout == 0) { + v4l2_err(&dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n", + __func__, + atomic_read(&port->buffers_with_vpu)); + break; + } + } + if (disable_camera(dev) < 0) v4l2_err(&dev->v4l2_dev, "Failed to disable camera\n"); } diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 0b95723..4d63176 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -246,6 +246,8 @@ static void buffer_work_cb(struct work_struct *work) struct mmal_msg_context *msg_context = container_of(work, struct mmal_msg_context, u.bulk.work); + atomic_dec(&msg_context->u.bulk.port->buffers_with_vpu); + msg_context->u.bulk.port->buffer_cb(msg_context->u.bulk.instance, msg_context->u.bulk.port, msg_context->u.bulk.status, @@ -389,6 +391,8 @@ buffer_from_host(struct vchiq_mmal_instance *instance, INIT_WORK(&msg_context->u.bulk.buffer_to_host_work, buffer_to_host_work_cb); + atomic_inc(&port->buffers_with_vpu); + /* prep the buffer from host message */ memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h index 3498555..1750ff0 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h @@ -72,6 +72,9 @@ struct vchiq_mmal_port { struct list_head buffers; /* lock to serialise adding and removing buffers from list */ spinlock_t slock; + + /* Count of buffers the VPU has yet to return */ + atomic_t buffers_with_vpu; /* callback on buffer completion */ vchiq_mmal_buffer_cb buffer_cb; /* callback context */ From patchwork Thu Jun 27 18:56:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 681A614C0 for ; Thu, 27 Jun 2019 18:57:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F6131FFE6 for ; Thu, 27 Jun 2019 18:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53D2B2793A; Thu, 27 Jun 2019 18:57: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 03DC31FFE6 for ; Thu, 27 Jun 2019 18:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726590AbfF0S5P (ORCPT ); Thu, 27 Jun 2019 14:57:15 -0400 Received: from mout.gmx.net ([212.227.15.19]:41329 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfF0S5M (ORCPT ); Thu, 27 Jun 2019 14:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661815; bh=8zy/CF8eq6vCciU1LYPKVRt1nppxuwPwBxjk8BgMHCI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=OiMdz/sG7vnUhoMUouJV7XUASaR917O5b29ggMTZrpM+aNhu4zax4rINDSp1y5TAz i73CVq6TdG04Vx5YZSOzXzYS2SsMH5lDzBi7z046mTd0HStJHXmvlGxnvoc+3rmmyv qsF0nftIgZhok+qENMZFTeZ8EdX9Qze76+0MUf4o= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LqQzp-1iBDQV3k81-00e1fu; Thu, 27 Jun 2019 20:56:55 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 16/31] staging: bcm2835-camera: Remove check of the number of buffers supplied Date: Thu, 27 Jun 2019 20:56:13 +0200 Message-Id: <1561661788-22744-17-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:B9slWFuCxy+02ZPi3VQFLXOYRQyTHeed6m6D9LbksOSlspD/mcl lUiQc25qvasefDg65qcaQ4JyNgnfNb6utBdEqNMz5Kzd/Q5lZzxp737BxT27weFFSOXQH8K H3kBji/p3t46KVOYuclYZ/FXqCcavbNEGml1l++aU24MR314GHcc/gKlgd4dKOxCIB9uDTA LlfQvA2olDokT3FAdW8Bg== X-UI-Out-Filterresults: notjunk:1;V03:K0:5Pe78/5ZErA=:j2IiReNY+mN7+vbsSSS1nD W0M8UFWxE99aSvM1mQtYylv0ZqO8Bhhs7ASsoNj8EdRZrV09dgGG5/YsHtS5DFJKTQom41q3t wzShstS/BBmS4GuVEZ5G91nVVpHSzHbhwmKCaHYE9czAPaUYT2GOs8SeOyBZiptZA2liOecuu A7rWaOg7aGGpWmC1bRq4A9Z2rw0n0AsrJQHW+l7/Ove6FFA+yIiuzqgCSydbylxx98k+9JZYI MB/3jFzOGm/Y8gegBJGRC1Qix5QxO+y3+9ouQeK7/BBsoUJbTtqUpWAj5en15m0myHxj7gyIT yQbOfSSZ6afFE84vnpzepG+7hFOos65n7HC+lBM3bbI4bRAnT4i7w4graVTpfxEaFYlie4IlA iRZU9X/eoWJrSt9CLjWf0CDRBi7EaI8PtNFoHmPwNUduFgPaN6wRcvOxGE3iUeXkQA01gb/rk dsiUKzI7DrULjuDwCynjpk7KtoXuFakpeRS5eN3R6fOKISyG0kd7MTyYEF+Mho/zd8w8nI7Er ioMyD7GyIzLdj1yXeZFeDbbIZI64BZI/jfxtQDMEuScxjptD7ZNl5qpIRlI+gMtPWguRprbvB F+UG9mPl62t3FXSUBna7JNbBUZTltuSrxY5vEynldZW7UewjaIwxwBwZZXxq7KJqDskDNdwYZ t7O2cCrOcAOROHIAG4LeUcfTu+P2RvqHKcrnIXpREj4EnX+UnpaOmwrp9Wt4epgtsS7VZ5onk KZFrf1n/A4bNlpW58xTMhx1fd1TYB1e9lKYUbr7f2eHpAeNxcc9fYeiqbjcp+IntRAhh5f5oL hLD1+ub2aJxtBIFoCmQVXgYLclnLrxFXPEUaeajF4B+OvS7OCabTflKlJZWehemcz0iiBjIy6 FgjJ4b3oliDcmKb5nnelSUgzMWYyP0Vcu487X6qho+2aHIIh9x/7dRwvT7dqvdp+IUwy0HEL4 ZIckcSqwQgbKofrC6zcjZtyjkXG65ijIkHFriSxhcVifpieV/WO5nPT6a4aQnsVTWZe8u8j+m fNKO9fqRzU/w4ew3oTmJkcSk0hsSLyfhIH49Pza4kLDBki5IBrCUC8tWATdTh8Na3Ff+TcUq7 7YoYkTGzEldgU8= 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 From: Dave Stevenson Before commit "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping" there was a need to ensure that there were sufficient buffers supplied from the user to cover those being sent to the VPU (always 1). Now the buffers are linked 1:1 between MMAL and V4L2, therefore there is no need for that check, and indeed it is wrong as there is no need to submit all the buffers before starting streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 10 ---------- 1 file changed, 10 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 4d63176..59eb812 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -1338,16 +1338,6 @@ static int port_enable(struct vchiq_mmal_instance *instance, if (port->enabled) return 0; - /* ensure there are enough buffers queued to cover the buffer headers */ - if (port->buffer_cb) { - hdr_count = 0; - list_for_each(buf_head, &port->buffers) { - hdr_count++; - } - if (hdr_count < port->current_buffer.num) - return -ENOSPC; - } - ret = port_action_port(instance, port, MMAL_MSG_PORT_ACTION_TYPE_ENABLE); if (ret) From patchwork Thu Jun 27 18:56:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F27F1580 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 827131FFE6 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7651E28520; Thu, 27 Jun 2019 18:57:21 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 0EA1A1FFE6 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbfF0S5T (ORCPT ); Thu, 27 Jun 2019 14:57:19 -0400 Received: from mout.gmx.net ([212.227.15.15]:57695 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbfF0S5R (ORCPT ); Thu, 27 Jun 2019 14:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661815; bh=xwevpd3UAGKeJbtFyF2EvwHUvugWto7ZUSOWbHEHbAQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=NABCt/6lAnSpd6iJn0ZVtz5xgpg1DEss5JEA5sRnjmvUFvMY4hXMLfnn5D87Dd6Ur z1xR/Likh8ZIrYbYxUkdg84vPf4yp86+qIkkIyVXn6y/GavT4jhHKqe0yvHu8smDut zHXwOPVn7d3b4EiTyBdWYUHmLYUhXZzPp8aEKmX4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LptId-1iAfj61ApT-00ffZM; Thu, 27 Jun 2019 20:56:55 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 17/31] staging: bcm2835-camera: Handle empty EOS buffers whilst streaming Date: Thu, 27 Jun 2019 20:56:14 +0200 Message-Id: <1561661788-22744-18-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:ad5ZMW8ssO/JOMcoPglsVFDcUUPcE+j5mOD1h+5+S9QIq6KEEez +F/fWmiSF+kapuxSEKTXwOWP5Se38WYc1OtY1VYgSI/FFD40vMUGeLCNa1azj7bAomoZj9i ZdL3oFS1FFj/SLqKJ6BrZGxkaIWpSWrKgy3HzHc1yAAybwsdbBx/Bv2SxIJNTzm69yC855G vw2YzvmY+GvrpiH2v8K1A== X-UI-Out-Filterresults: notjunk:1;V03:K0:EzprZ/Xai+o=:JLVbiZUaBS2wNJFY7emiS3 wa4Qw/7oJzJPaQIfxATEnsvicsrWhLst2rFDsI+Qt2HmAe4DoXqipaldNRzgkTiIgw+gLDcQG p/EmD0/gCAG9isV/wW2LtKuizm370kYQzXLIViLiwLNzHSpLA0/J/JdRT8DUAz0uIlY3Adz4k 1f2RnIo9Vn+DSO0PrFHa9EPlL1Xj4gXHxgxLc1Sv2rmlkdaogyVCB2D+iScFeNzyKtSezjZaj lkljxY+gqtDipKML/kfU1mC9zcASE/Qo6oJe204B6DqTVh1x6IErP7uKSq3zK80SVLl+RfaVj GFPNU5oeZ1LRummQPXI2kqN9Z6vxrKfANDomTXX8WxErVAsDoiyyYRHbdB9H6wZXJXwmhYD9s d5eEEllnydaa6fa4MsJVOkoEKldON1qUpR3uRLDxme39F7D5/M4rlMn1yo9RMxUEtbdBeZkLK XAZWprC0bc6iqk/cAfVBZRiBL7Ki7uXbxgJ/Tqn5/fscjFEMap1ppV0+FtaTBMTY93OSZdN0T /t62yRzSC+BhrWVUW5VzUHsTQ+IlOCjCX/AzhSlrjxyayxpEKlqB5R0HYwm7/OhE5ONOn4fxR 4/bnbXGhScCzxheEJU62NRybJeBfcpcVL7QO9RmGX8mej87sl2FVwatHf+MxuN0gnmxbQOQnx RBfbJ0ShmyorMVLmQwpH/NDt3TzsM8vUo33VARhpCEahvhGO2zLTXOGrg+Q8oyIjLycNABpWc ZEFdIJG7Lr1eBxfLIceE2zcJKbZ7VAZzNWlierSTs4AoMNItTv4IUvTFmJIq3IvMiMvxlwEpd VY/PYFZj+9taP8/F23iEP6PUAcdpwNopjPOIQxuZvmZz+tlmXqBz+JoCJltTOd82nhyltZw7I iN3qenf/lk2rsqo6IPiLWWq7t5DHKILKpJMZPhg8u7fkjbrNL5Zpv6Of3wUxi//pvNfVJCLpd /+EPDi47fs4Sa77OAVUlwJOPEKXIfKTtK1vLM1/dPwJpxjm/K4UrsBdqpsAiv9ZTY8SL03QY1 PI/qP+g9iqMPNeOZtOpimOlPfdfSAYw3dTQuZVbLGKMBHWj6zzDbRY/OGziYNHZiltmHAuRzj u+wYfJZyBYPA9E= 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 From: Dave Stevenson The change to mapping V4L2 to MMAL buffers 1:1 didn't handle the condition we get with raw pixel buffers (eg YUV and RGB) direct from the camera's stills port. That sends the pixel buffer and then an empty buffer with the EOS flag set. The EOS buffer wasn't handled and returned an error up the stack. Handle the condition correctly by returning it to the component if streaming, or returning with an error if stopping streaming. Fixes: 938416707071 ("staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping") Signed-off-by: Dave Stevenson --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 21 ++++++++++++--------- .../vc04_services/bcm2835-camera/mmal-vchiq.c | 5 +++-- 2 files changed, 15 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 36eb4d6..f2e951c 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -339,16 +339,13 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, if (length == 0) { /* stream ended */ - if (buf) { - /* this should only ever happen if the port is - * disabled and there are buffers still queued + if (dev->capture.frame_count) { + /* empty buffer whilst capturing - expected to be an + * EOS, so grab another frame */ - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); - pr_debug("Empty buffer"); - } else if (dev->capture.frame_count) { - /* grab another frame */ if (is_capturing(dev)) { - pr_debug("Grab another frame"); + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, + "Grab another frame"); vchiq_mmal_port_parameter_set( instance, dev->capture.camera_port, @@ -356,8 +353,14 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, &dev->capture.frame_count, sizeof(dev->capture.frame_count)); } + if (vchiq_mmal_submit_buffer(instance, port, buf)) + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, + "Failed to return EOS buffer"); } else { - /* signal frame completion */ + /* stopping streaming. + * return buffer, and signal frame completion + */ + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); complete(&dev->capture.frame_cmplt); } return; diff --git a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c index 59eb812..d0f7b67 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c @@ -332,8 +332,6 @@ static int bulk_receive(struct vchiq_mmal_instance *instance, /* store length */ msg_context->u.bulk.buffer_used = rd_len; - msg_context->u.bulk.mmal_flags = - msg->u.buffer_from_host.buffer_header.flags; msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts; msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts; @@ -461,6 +459,9 @@ static void buffer_to_host_cb(struct vchiq_mmal_instance *instance, return; } + msg_context->u.bulk.mmal_flags = + msg->u.buffer_from_host.buffer_header.flags; + if (msg->h.status != MMAL_MSG_STATUS_SUCCESS) { /* message reception had an error */ pr_warn("error %d in reply\n", msg->h.status); From patchwork Thu Jun 27 18:56:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F20C14C0 for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93BCE2793A for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8827F285A8; Thu, 27 Jun 2019 18:57:21 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2F1B92793A for ; Thu, 27 Jun 2019 18:57:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726619AbfF0S5T (ORCPT ); Thu, 27 Jun 2019 14:57:19 -0400 Received: from mout.gmx.net ([212.227.15.15]:38093 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfF0S5R (ORCPT ); Thu, 27 Jun 2019 14:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661815; bh=CxR7qSbQJEaTRwxTiS+9LyZFjaKPowlzspE7tanqC4o=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Pai7wbgycEoUg5qAS6HYlSD/ehYwSGEWsLpBVwiL2vYbs2SUgRAf/mvvIG1YeojoC InlMtIcI9wv2WuW1tOAXgahRoHOjmoOwK+toSBDunI/bffWKltwDNkGeXTXzts5nFp QnFFxfUQA+Q4deVBYSthIRhSfFWgTeK7HA4qK0k0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MgcTf-1ht0Hg2sy7-00O07w; Thu, 27 Jun 2019 20:56:55 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 18/31] staging: bcm2835-camera: Set sequence number correctly Date: Thu, 27 Jun 2019 20:56:15 +0200 Message-Id: <1561661788-22744-19-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:uglTV20dj89zG+7dc69VnabOIsvQyrYIv6qLM7blISuaYJWxuhz 9njdmJ+t/4DkTqLssoOh56a7uaO872TVNVSzzECWQKF0YX6njhk42XhLpXCDcP8uIU5zzuB X6EDxNHPcSI3+qK58uzHanyRITAW1bwqMwAhZZoUOfFiP0wxHZ5ZlrrnbLAVWJAKeCayEsy T3Ws5NxW40gK9NyMmmZ2A== X-UI-Out-Filterresults: notjunk:1;V03:K0:9h9q/Aa03ak=:xIVl/nRJKGM6dJxwREUv+8 g87d2J8v35Vt8bnrGRUY9OFqWPBZPh6+ehE1KNyQEyxx/Q1f6Nmo9oE0kCCG0mpUgpuxnFi1X v6yAjUE74rywqEjaRThq0H4rMIS2dIswJ4ggc5VKeV8JgaAwS4OFd9U1k5X5Nwt/+Wgxm7M8c jsNGPRSPVlyaseZfU9tbrhShkIZvrIc8ifDMHgqZrjXeTYru0gserP/sfHYpv9S3O4QlhJYG/ IG3lkvVDv98ZwtiCu6r4JTToXSb85RsgfgTpJAi0fAbZBcE3nSkVkcX32VEesrSTZOnYHWU69 HZLjH3MraQMqOvgWNVqpTTE3PvGTkegZnrbV6IcVpKVwcROVZ+1vyZ3019Gu1f2GN5VUNAkDi aXdD6hbxc/i7FjFD+QGBiTGNVV1G4/0d3zquQz/ykJnJHspHf4Cl5DG9tufY/7CldD+2oiEmU CgU9F0EcaCowEj8DpnCUeO6XI3Slf8ndTRfCURlZ7qF9KoFjiPU2l6Ltb8q5bhAOyVePt7KWr 4hHrhUE5Dj1KS437cccjJS4buKfxe/F6rY7uZb594dmBCIWsyvuofc3TGoXXHmcCU0Qzm1wBK 7+DRtqwYuYSGVfbaO3JSbEn0Phuf8YYG9qDtnfQgq1w93fMaN1olbOwrRClGm82zqspkBi+tS 9Q6HX6okdn5X+nb4eGHJZAtEjzF6Y0u655wfy+LGHppZdt+jy7mMRGtITdjrfJ1Gv2EqxQGHC kmHKmBIbq3ty9Mc2ZfX1+V/qLA9iKZkFdqyKRHutWQmtExbeSZfYB+A7WsfTiJuSkHLCMv0BZ L5Zag5enKZHA8WlvZSnm9cUkrMxJf6Vm9ct2N/8qLLynBhffZNRJV0zGn8iWwBF7EZzOJ53y0 JgtQtMIymJ4SIdF8F9qsbhdYoYrw0RWScF6sVTMmDA6UfYm+1FTGGHEcAeBehEbeBT3Egh10/ 74zJOMDMZdBN4rpcki6SvWq7larnVURMhfHqnUv6iBCfKQT6D/iMaU0s6TVcQ93ZEz1Tq1LSF YxkKzHc4H0hgRUjbLMwB58I24PdTIV5GuuBTGgxoyz5MHTd2LeyrZFKgniMKfJMhSjebZCmO7 7RDxhKcpyiM/wo= 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 From: Dave Stevenson Set the sequence number in vb2_v4l2_buffer mainly so the latest v4l2-ctl reports the frame rate correctly. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 4 ++++ drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h | 2 ++ 2 files changed, 6 insertions(+) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index f2e951c..9967df9 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -398,6 +398,7 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, } } dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp; + buf->vb.sequence = dev->capture.sequence++; vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length); if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_KEYFRAME) @@ -525,6 +526,9 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count) /* enable frame capture */ dev->capture.frame_count = 1; + /* reset sequence number */ + dev->capture.sequence = 0; + /* if the preview is not already running, wait for a few frames for AGC * to settle down. */ diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h index bbfe8fe..c821513 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -93,6 +93,8 @@ struct bm2835_mmal_dev { ktime_t kernel_start_ts; /* Timestamp of last frame */ u64 last_timestamp; + /* Sequence number of last buffer */ + u32 sequence; struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ From patchwork Thu Jun 27 18:56:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11020337 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD0711575 for ; Thu, 27 Jun 2019 18:57:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4A911FFE6 for ; Thu, 27 Jun 2019 18:57:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B91D82793A; Thu, 27 Jun 2019 18:57:19 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 65E151FFE6 for ; Thu, 27 Jun 2019 18:57:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726617AbfF0S5S (ORCPT ); Thu, 27 Jun 2019 14:57:18 -0400 Received: from mout.gmx.net ([212.227.15.19]:57645 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbfF0S5Q (ORCPT ); Thu, 27 Jun 2019 14:57:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561661816; bh=To7r9Iz4rUasrDMcLbYaTnJm0paSV59R928kdzaH15c=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Eqey5sHrRLAzyiJ01OE6yL3ppSt1FcYXzB6RfFx64URL3NX45K6EDOGBlUPqCazGC lrDbf5mI6nwFA9aOU/pLY7E1T5nzdAx9KFMXyvrhEtwpOw3nO2CM1+T0Rw+kUK7MUz 2sPXa7CXpKVBcwATLXsmgfMQrGJXToKCwrQKQyCQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MGBdv-1hkAbH0NOB-00FARI; Thu, 27 Jun 2019 20:56:56 +0200 From: Stefan Wahren To: Eric Anholt , Greg Kroah-Hartman , Dave Stevenson , Hans Verkuil , Mauro Carvalho Chehab Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org, linux-media@vger.kernel.org Subject: [PATCH 19/31] staging: bcm2835-camera: Ensure timestamps never go backwards. Date: Thu, 27 Jun 2019 20:56:16 +0200 Message-Id: <1561661788-22744-20-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> References: <1561661788-22744-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:DiwyDx4wevMKzeWB2UlF1MZfZbyv3QEeiXD796J0bJwPbdVH/ek ctM557d2Y+BqPzZKjGQs3xAh3ukDjRC2XsDxVYg6UsmGZZxjCuxapiT7oeAz9bZqhboCLWA Se58s3lK3hZw2wgngI1oA3Nx/mz6FyblzsM/QlufHWoz94zBu8/r0+z+X/AfOX7ZRDgH/NK /qX+oDB1ar8lFYcJT2kGw== X-UI-Out-Filterresults: notjunk:1;V03:K0:tW9pxrt97h8=:iJMdFfIppg66aRF8YX96Sp 552WG4My6NvYayu2ZdNWSfhmmkyBPOlq2SL0wyBeeegYc4AZ085PuFswuJzXW2ZDmRaEC7eiy iMfctYAvKtMHvXISeWo/MfOt3jK3G98W/6MoAeRyhwzCvOqt6vMV0Z4OtPX60r6Wr6UM2816e 4Qtlo6NvtGC4dD5VwSUHE2T29xXLgCjgqPEsORV/O+Jx4vDAwXZKLOKeuiyTbJR+vV8EcFLsr JuwtqI3Tlu9JQYhcUXCLqFhYBQTVxwY9rCPKbFjTOopi/E6zRsjNqLa6/DSZQwvukQZsNKLu9 QwhEjOtympUEugjm783ZGEYB3oRBlrhZjM2EeOIqnHs8bxON2YIqLsdwaPTSkP3jmsPUKIsUU cFGbMTS1lU2n93GcAFNhjfGRF0fFEypDXmGCCdRg3o5VPPnvTTCw55Oguzc4YNAR4VDN7gOmm YmvDpbho7CBLZp3m0+ExsAeVuVRC3TDC6uy4dqNOeckGerSkDBQdLY1VaAMggsQoE6OKjOQxd GWIfbDwhvbxWzDe1lEo7KhJ0D4vxnvI9LQ0JVAfjOM08SPE8PcJhXA/A2ho4neSfV0Kx9C2mx rP2C3DjHFOVUvnryORLydeLpXJGKVc7ULOrx7bdS2S/3ceAFXCwdyJhVgX10qevc+RVjpCGkJ eYIjUjHqsI0MI/EZ+YHoeqU6SchFAbMmkBeEC68BHgGURSwTIzt77edgU5qwBixB5YUzlz9hx t364yVHpXFgCsdyYDAEgTYP9W/TY1dbgXJQ5d1dDX/ou+iiNfaQJ+5S5nm6amB1OK35t811t8 U9fgO4XCWlnGONw5VbUHwKMFtrObfW1j4mmGyoufcLegpPq/lsCoPlSh7DuabN0sQaibwpcRX AxdAW7tJXlPLmZqiButAMf5nXIjQ5m5R4BQFB/849U/QokBty8RE8P6aD7tvFdTUG60Czt4DC wWIu7pojgO9lb29x3qKVmu/F5H6FUt2543JBuCqiQ2pGTSl85/YbTkn0bN0J64HryQlP3ls2/ uQV56jR1WH8053A5uJtALprvOeHnHc8UxZbQGSB8SMPJs5vAXqln9jt6Hh3NQ4xligNLRm0p5 w43b9HdKbTdL6A= 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 From: Dave Stevenson There is an awkward situation with H264 header bytes. Currently they are returned with a PTS of 0 because they aren't associated with a timestamped frame to encode. These are handled by either returning the timestamp of the last buffer to have been received, or in the case of the first buffer the timestamp taken at start_streaming. This results in a race where the current frame may have started before we take the start time, which results in the first encoded frame having an earlier timestamp than the header bytes. Ensure that we never return a negative delta to the user by checking against the previous timestamp. Signed-off-by: Dave Stevenson --- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.7.4 diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index 9967df9..6205793 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -387,6 +387,11 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, ktime_to_ns(dev->capture.kernel_start_ts), dev->capture.vc_start_timestamp, pts, ktime_to_ns(timestamp)); + if (timestamp < dev->capture.last_timestamp) { + v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, + "Negative delta - using last time\n"); + timestamp = dev->capture.last_timestamp; + } buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp); } else { if (dev->capture.last_timestamp) {