From patchwork Sat Jun 29 12:13: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: 11023869 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 16CC814F6 for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 043572881E for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB8AE287FB; Sat, 29 Jun 2019 12:14:37 +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 5263D287FB for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbfF2MOf (ORCPT ); Sat, 29 Jun 2019 08:14:35 -0400 Received: from mout.gmx.net ([212.227.17.21]:35505 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbfF2MOf (ORCPT ); Sat, 29 Jun 2019 08:14:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810445; bh=zHE1SAFCsIAD5cnmVInCnyPS/jtZB3P6kyZA/ddYnsY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=NIlyFeqI6+azaUctC9gXYrfj1LV5ePh2QNfII5UevbcaXA+Mr1fjLI564p/7qBgrX f1cHmTFzcAjJpCF7iBZzHUqW0HHNq8B/c8FIeXA4lHcRFKYPyspJlgM6CiAHGOYMhi eXSHJ1oqL3vzjo7S0DvYcrilL1JwGnxx/urR+vBk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M5tzh-1iVa2X3c9h-00xsmR; Sat, 29 Jun 2019 14:14:04 +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, Stefan Wahren Subject: [PATCH V2 01/29] staging: bcm2835-camera: Check the error for REPEAT_SEQ_HEADER Date: Sat, 29 Jun 2019 14:13:16 +0200 Message-Id: <1561810410-8829-2-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:3in6uZLTp+rEkuSmOzoEoeteDWMTZ5q7niOWNVOuFVnkYiqRT21 JFR1IOWjc1BvnIbOH8H8A0HnTJaqy0lUIT/aTU4QEMpq2aI7UQCTX4KlEn8TawymmXvpb+v DP31/Tom34aVSlToKwukFAV61xft+FnZ43DUhIWt5Y2Oz2KaaHR+WiT/Bnp7MiuxiYbbS11 8QJpg/BtDDTlGy+vvucEQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Agt0BPubglA=:2DQ1hO8GU9eQh3j0ufWSvn CYEuiGkZnHsWnOfrO9+SsW2JLKk6+erLB/11feNtKm1VpCML0vAo7t1Djxz8D4jKigfpcZyCv D60ad4kpp5ew3kIehJG3uGRd4HyejoW1QG9+e4TnsfPxaQTtzXT7byCCd+W8Lo4/4Y9WMra+i fwwH7kysQC55z/UD38EvdbNiOq/JbpGzkeH+5a3/9uTZt9em3hXrIkUx5kIHuN8AFw89yNfOr GJvVYBMjh/GvHst3bl7JSVrbt7f05+qRyEpHC/fogA4Z1nenuXwk/kluqlvD1uaqGYRRDWqDh /GKz3hO5MJlt5lNDDIjBMSsS5tkgzOaTHk4mPVujUL/HYozqozMcH43lwx+3jijte1uYTja1o AWaTk/dujEjVScUKI/MtEFWfNPw6FMLvQ5fWv2B+/OS+MuucOwMGuQAy68LYN/0xgYTvjlE/w Yk9y50bHPVf1sK/SvIxXobau6BDeBUOkQ+UVwR2FhtXWbgaOv+eaVXHYFEm/IgADKrdkS9GXi uWGOQp/3gbne/eWAoKKiGP3AzCdz+2HHRDUoWep4evf88tY9ZP7gqAxhKZs2ghmXZhfvWcOTE WGc86PFyLnkiGWw21yQswQbEwJwifWsnEqZSujeXcSYZXYK2yuqCgc+xVqlYgvRdZV/xaenP/ 4GVPtrC54MX8G9v3oLAbKS/onPLKwDJL271WnFCB/8AwFeGC9IlOZKEEHaJ4h0dtKGiH0C5B7 Gw1PVgU92CqtqEkqY9PboHwonwK5FkZb0DMz/iYWBlpeYOkxl4qHlYH4EJOz/XOXVdxrQEC28 BPPUO6p5UxpSQWdyfbwP5fuigCe7gu8Se2udzZKqPIeuORjOazL93eGMaoo3hVT5LFAkXbob7 rTHnJ2qkW3iFJy+iEF+HFjn4FM8d4EOP8WhwlN2ZmIi29slChdswmvJDUSn7Can992bj14ROQ DkW7fLOfZhsOx08VdCVz5+JwmUuK/JfbE6NlLmOLwMuYLnBS39ywm5m7d5L7hLWTVGDP2oR52 R3ZhvwxFMucSnrBOeOUcT0o0eGGNPbpkkuPFdmK7SDlnMTW4k876EBaFprnep6uQwSLJZldZo c56QRiLT+r+Bc0= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 Sat Jun 29 12:13:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023863 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 2E77D14F6 for ; Sat, 29 Jun 2019 12:14:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E5FA287F5 for ; Sat, 29 Jun 2019 12:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1207828825; Sat, 29 Jun 2019 12:14:37 +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 8587C28833 for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727025AbfF2MOc (ORCPT ); Sat, 29 Jun 2019 08:14:32 -0400 Received: from mout.gmx.net ([212.227.17.21]:39173 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfF2MOc (ORCPT ); Sat, 29 Jun 2019 08:14:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810445; bh=fL2+AI98j8bIYBwN2CiIF9PN7Bc2vnixmlYqMuIDlao=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=A4ErE7VB5/vRVwUyDfddYINa+liW3u5mZfMjL+JzWNgBQuSW+yj9ScgmDz6LVOADS UKT+Fonv/CR3DINhObNHhqA5MUTU/F0FeIF5EaEnvYf1LqyjEAdLufzdjE+zLa2wda QMhGVTCG5B09TEVN68rAA+MbfiegnDklXW2Ysb5g= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mb8HX-1i06pq1FwB-00KiTJ; Sat, 29 Jun 2019 14:14:05 +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, Stefan Wahren Subject: [PATCH V2 02/29] staging: bcm2835-camera: Replace spinlock protecting context_map with mutex Date: Sat, 29 Jun 2019 14:13:17 +0200 Message-Id: <1561810410-8829-3-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:BqPhO65rcNnqQtgYuhpJKHix52bqJyO4dyUafgpRYICvlwQuxw5 oKUAAST17Z2Xq28lb8OIDSpRKKloIbfqiNcGkN7v5wGB6Ztb7kyzBoUy/PK9gTbfCEOYYhE xj6mzji8vPjxJJP11KspOlmTI22GjctRUcjmW2209H9h05c7n2dDlhVY+ldisMTZLtnQMRO g75rZ4Yf0bD4rX0QQtq2A== X-UI-Out-Filterresults: notjunk:1;V03:K0:P9Ad1yr2X78=:ZdQxY67sLVi9AnBy6PbcGQ 6nsc9UydiYzpzYIgGi6HO+euckaAGS+/1mIrYUNhRial7uPZTXfliUT94FC60aImsV1WMc8lh jstzRlm2XSRafrMRsVCgQh2QWgar2VwoKjnjyuXGiZ8mur1emnl4rs4tDbxg3GQwTJI6eLkiW px3TmJynMH6h4Y7E/Qz3W1gNWdQG8qs3/h7VBuT6+vWqjJfgeuh10lJZ/v7Bn0fTQ2gYZu2Jr FYdD+JbV/jwRX/EdySNJg7pTWrBjU0GTXw5STz/9iQlLfFnKuYl49ilvknSGGDZpoSA/jVtld rCH5oXUGBZTc1dl1HzUvWqFvRDTGIOEJSZBcpxjitTnfXW1QKOx6kFXRqX3BMm/8WPoZZCdcl bfU5F+MdckGHNLq6+HQ9/sqq7//uhS4yUXYLzofiK8eArrsxpaWsk43Wbh2PrUDQhSpQFb/AH sUAqiD+OuH2KLVW4VYAtSXIDxQQm/jm4f0iMS6V5t/iX4eisMVcxpmbPl4FznqMDFjvAwmFsf VVO1OL2ZOXftATO4N0nXW4IRPLNBqBCHJDsKajf5xe3P97ERR4FD2y6+CQCMSSsURtYgIW/HM zSbGUT+bp4i3vmwRfvkfGPlBb7dAtQY3FKcY8Q4p+fsVQHjYg94PMPdakGLRAz3x0MFcYkW/9 MaX6YGJqnzuD+9L6odUBoPqegqvNHAclkz5aEbF3gkKBJbxvhSlZre4EoWLqV8t0ldeWidg2t srT38TflRmIt0fUPSBmZ094byrImCl6J3qU9aWfNVP2jKOxvrGhdE4rZwsWQa8tERiRbSspdJ fbauY0eEySUh+ka+T/4hy7SwutgI+AInZ78pJjdahK+UAxnq5PyaJypRUKoceElInhvqfWCKr 8ll1U7H1dU/un1aNK/K3ON2ExrStBldRRXFPm8Ry6rWk4Qid7psyyPa79lB2nUaHtfhk/WN/R s1xxsdJAJ9ZmRl+M1tap17JM+96gdVjm7VdXINPoQptnNRTu8UfYDMK3duJ0I12XoTbfKANrN RhaTRAMHtiVlo4ZJ0afCPoi1SD0zpaTEGm74KfKnvGZBu4f4ZJIxJl6MVSy3r8mjqtjFnaHBV o7/J2iHCDPisIo= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 Sat Jun 29 12:13:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023861 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 DC7241800 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C838A28825 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B41FD2886E; Sat, 29 Jun 2019 12:14:36 +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 C55DA2883A for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727035AbfF2MOd (ORCPT ); Sat, 29 Jun 2019 08:14:33 -0400 Received: from mout.gmx.net ([212.227.17.22]:44173 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727017AbfF2MOc (ORCPT ); Sat, 29 Jun 2019 08:14:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810445; bh=ECVOnFevgWF424uv7F5vu9dk7W5YSvOe7Tz+YVxftMU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=BlErDyj1ehXXTJzRT1gp+bQpWgzLPt9Pre5lvMoyJTJIoqezpbbjVNARuG74XYMAl YqqCiwD2sZyi1O83je4OulSIolziIpp0XzYd++enXj3Q8h6P0cZuu4hGBpFgeq9F2J 7RGoVh+tRn0Px/oEwx8xupUrJiQcyGcYqrCUHaHA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lu7ty-1ifExH32CE-011Vvo; Sat, 29 Jun 2019 14:14:05 +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, Stefan Wahren Subject: [PATCH V2 03/29] staging: bcm2835-camera: Do not bulk receive from service thread Date: Sat, 29 Jun 2019 14:13:18 +0200 Message-Id: <1561810410-8829-4-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:vhA/UTTX7d4Rfy8PJzKLcID82/sPDB08aEhYv4i1G0mxQA5gRv4 QoZHcVGOyB7y4dzzRbml7z6YvhF/3YYEQ/HfrgB26NydLBn8S2u7krcmJfB6wnT8ndov4iG DkzVtp1aRlmtX01A/etJ/8zT0J9u+lAjo8GE22E0Z0EuAqr6qdHIz+86LD0jWKY1rNTqVTG vqTCd6mvcDRZrpKxZFhzQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:KPhfDolOGus=:U0TXf92BNgzdw5NclVku4l krf6nD6FRr3epcE9H+oAzH0qr9TPCbx8ELCIlOdeg37tsk4lcUPj8e8o73dJyvLf2+j9OkBKZ tXKLnuyNEnKyZnTMF6Ym85vltu4OiAGKwJ1yGp9Lg8cHSOHwzE0Y9H5Ks07hkHbaiXZrzYVM8 JfyJIpBjgua93LeefR+aKurrP4GpzuvOmuHh2DEhwsAYa1aWj8gwQS57OfgLqbv+Y1HS4xFuX 4x9vKuXDZjq16xNqsrMYCgl/FxSXYFW2fKe4UpUypMFNf4+oJHpXQqChnVfOmAKOTMXjlO1Tl S4nQKiTScoqyWgi3ytNIzoxMwZ2VaDhaE+PFgByrbmvCJ9KPgsCbB3zofk+RoA5b1i6NNk0qm UtbOPq8988wCAZ8ft95g+0FU3DzxuKLK6Pmv/3x3i+kO/JGee8KIdSEjk6MYn7kgXt5nLMqii uW122fv5wzlo/vDZoMGSSH8KuiaunDcbYtdxfIQZpFGU+0Yw3DdapOwIrxA9rMFKzlk0A8LoL Pm5aIbFe9yD1iduwTopXbOv2EbYIZBmZQ3eJD23YsEf5l8u58p1yjLUG8+sClN13P2X55ZVrG 9u7HFAp+itMs5Zim8VhSCA3tjdGkEAYTxYHQjUg6YDmcab2ViaVcGnLyPnRlMVosboaHRHBVA qeo3DbI3dzb0pVWRyhPeapVCkzZi7Yu+8/rbgmxjuuS7SBDuYXJ79BCLwM5fFuYeEbqdloBVx 2Ttj+d9mXdQMPPSmhSXF9AKwIhgyBi2ELi9thVgQUOFX5KM7d6WK8EHItR2RXhCyrqLFo8rSZ hSXwp7iQQ4U1JSRW2YwjoR3QKGrAvooRxWih8Dcg8OqZqnNckNaYnNLue0xDRIu+1ut9C6qVW tZh27SI1HpKx3eLMLkN6dEwjNRYm0Xce6u0aNKQqnQhZ/GjGwPO238NimMe30uhpjvsdS4ddr mahbTbStk6ERddAS9nm2a0Lp5xgQb5W7BK0WcbROw9GYJdYLyI4e9Huo13Q4nemCz2DuOCuWQ EHTVirfBMsyGa/0HN5Bn1qJ0Kso4AYhtDU8M2FJ59Wlj8Selu2VFE58AfdUhcqRg7Dz0B4Cnt VDdjRULI0jrMak= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../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 Sat Jun 29 12:13:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023865 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 93AD3174A for ; Sat, 29 Jun 2019 12:14:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86CF5287F5 for ; Sat, 29 Jun 2019 12:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7AE7028825; Sat, 29 Jun 2019 12:14:37 +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 A57E528837 for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbfF2MOd (ORCPT ); Sat, 29 Jun 2019 08:14:33 -0400 Received: from mout.gmx.net ([212.227.17.21]:48035 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727015AbfF2MOc (ORCPT ); Sat, 29 Jun 2019 08:14:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810446; bh=uI34PuI3UJ0Vj23e0pDBUSO4cLN7Oo++ZU6cixLGgXw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=SjIitINHyMg6SZR64Skt58IF/o6+kV2ls+Cv950gThHPA1jbALXeS9f7tLGRQA2jx pWqMIfspO6jvW7HC9h+xsVkrQ9lc258u4OnI9DK4wYM6pEgiDqW9hEZVJy9eVV/u/c 9tvkT90fTNO/BTz9ff4JTuJlJShWSaKU6vcl9Qkg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MHXd2-1hiIhW0fMK-003JgE; Sat, 29 Jun 2019 14:14:06 +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, Stefan Wahren Subject: [PATCH V2 04/29] staging: bcm2835-camera: Correctly denote key frames in encoded data Date: Sat, 29 Jun 2019 14:13:19 +0200 Message-Id: <1561810410-8829-5-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:vR8+uZhLA2j/tuReY3aykspH3dP08vrGsexgtNEW51mDQw81J8K +IrnB6W3LJVdLHToFBbZQGVW8m5mJ9Ooepo0XlWWwdQPZrpUkyha1IFm4eO6yuArbLD7bdr NPXP8yVpBopUwHmX68UjmGCS5kjRecqLDbZf6lBXEWLI6UIVPqjtMghk4nJ/PWAb0mbTnVy fuq/uFP/xnPqevb2YzTQg== X-UI-Out-Filterresults: notjunk:1;V03:K0:KSLK4Th0A+Y=:QE+5OUbIelXXaeaU5XjFx1 a2lPLeh3S9Kot13XHCNMsNaQTPhsreUM4vFTyFQUlqwQieSGRlNYNdO4hHsJ5j3NxOfrdlFIk phhet2buIn/k2WtbT52sJSIxz5D3K5yVQEm4BDSP5eLEh+JyEGvs4EIHJs83K4ELMKhOuZXWP e2pSKmfPTh1d9PvDRkvla/uYkXz/fpVVo1fPfXFgJl6kxkgGOk7def7U6oLb954V02SG+EO8Y /4Bz3NoZB+gaIHGetKtEwaXpsvxp7qQWp+5uQMMOPj4GgZoJSWzP1cVzxgE5tmkkz5NEFRhnc I0TKRJwB7YSSLTWrfAQJntgDFxyWnlpwLobj6icVqw7PLCRhtbcTOhJHbrKc5ZpUckdH3Kzed tefOvi5aRoZ2OIKdWnPUhxr4SL5FEUaoNLvFrimPCRl7nASm3/41bcc3p58fB8M3zMTBQ0BWL 9AaTDauOAp7boPYfzXGU5yaAcV/5eW9rU++pDYi+gAYu2JP9u0hyjOPhpGnsvLXs9GwtmmreC osbWIY0TofRJDSuhuuHCRsyIhpm+jT4AiIjS6+Vd1bCVOq5+3mroi5IMGBH18+rzsUQqEVcXs jFnM6/vpGckEFUVeIGmetGSIBc/Xbg5CGyM3wJg4Xg+DjBkqcIA3/QGtlJ/iDOWYFjS0IZ9G5 6sLhkydfYxm/HNTrCeBwSjpOYg8wzySwqzc6zhBoSD4g7rJcTeSCfg0ubV4P1kpuPHnHDfLyN uVZo4NaTqoYGiAPTLEcNUTI0zyP+sq1SUbXIcEAizrwn6q+7htpIOPavZ2JtHjtTh5teOCmV9 X3NYMGXcn6YKcg3lSufotEpO6f19zUeggN5GX9ukSjZEA28ff5eETh5vh6usTiaj4B3LhG7v8 TAFFuXCxsh+VGb7ee/uEXSyMOdBitjlCBDlCSwOhvmy4juu+lzivY4UNpzubBlQUV7tEpDmGk OEDQpx8K5grJGUWeilm6TZbWUfqm5p/CKnfzurGVIOvFlpy/GO+4EYrOEEbbDuUAYcwzS2mEk rrnTg2A1Knq0971l8AgDoxHnIBv+1/gCnjM9BzC4lPryKStXv3bU9mlc/wfumPanuOPwNmIuS LU5EfWL+hZpHVY= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 dce6e6d..e81d4df 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -376,6 +376,9 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, } 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 Sat Jun 29 12:13:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023875 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 9671D17EF for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88FB1287F5 for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CE9E287FB; Sat, 29 Jun 2019 12:14:38 +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 0BBA928825 for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727060AbfF2MOh (ORCPT ); Sat, 29 Jun 2019 08:14:37 -0400 Received: from mout.gmx.net ([212.227.17.21]:55295 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbfF2MOg (ORCPT ); Sat, 29 Jun 2019 08:14:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810446; bh=XsCSZFtMGn8TEqXeoQWK7pBSlK9ZoMDMSNSPhL3eAqg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=dQe1gCjQZec8NuvQ8p5TxSq4dqcQ1a24W0+kR/ax6Qu3CAAUm4sCLlpWylvVpZeKf 5pCOzYH355TMyvFLCIY6WlnDoqF67sIqZLmO6/2L+dNkaROQue2kL3GmI37XMlTbX0 hnjXoUWscgtVy1yMz/ma79lNhaINqA13QPa3Pq7I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LyEUz-1ib6MN2SAf-015cXP; Sat, 29 Jun 2019 14:14:06 +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, Stefan Wahren Subject: [PATCH V2 05/29] staging: bcm2835-camera: Return early on errors Date: Sat, 29 Jun 2019 14:13:20 +0200 Message-Id: <1561810410-8829-6-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:uHemwYg13/jic9QLGpqUQIie5rCHxJoQET8DxwVg2MpLubY1wp2 8ohoUL3hv8zWd5L+p9BBdA0+nGuEbRwGZaY7wtFTyV4VgxNhMeVkZRhCnnH730vEpZ1V3lF 1tnOyMcVgY7rgMLtcyfoU2XAfNhsgSCGWVWXt5KKcnHmMRMx9oYNiNaDgVU3FBo6ILieaD7 /xYqe/WOI+HFH6jhaj49A== X-UI-Out-Filterresults: notjunk:1;V03:K0:HaRXCETBJO0=:MGe1Qp12avPevQPeXCtJUy tOqT2yE/R0QzP6Q6JQPU9aICM2esTj8rJsLG4kF1/r9cJnJQgKc4iA0F1hptBMYwdARIAsGzt seNbb2N6yD+eAg/lh0oFj0jXX3vyWO4wb6HZywmrr+tGGaXe2tzyk2C/pYgmrbvBPWbiZ+4Jj s016J4cy5ynY2q52JFBrelXfwpkWtDKs6lQwA7QlNsOlMXS6X/UayvDI9kUzO95Y969qWdvBM pI6WKcTv9tzqslZa4kueI/H5KBi1lPDFsMS8fgtzxm0bNDauosPXOXmy+R1wL+Y9JsUJI/4M9 E0Uz8XB01MuD+5rq9I/ZMJk2JmyCDpaHVfVRydS1dRpclrfMv1FHCHZ0oPJfVowL22QE1js/c bqFkbinepocFKex7E7JAjgOKw4enytfXR+LCz50gS/fVfUFOLxevpCNEVDycHvtfFGJWoZ/ZY ELhjc5ss5Pm47pxYCfQRAv7xoM5/hoS9FF6BUw3J7z9jMisUDA91T83kLj24XgGq3z9+77kFG uu+83a82hqBSva+nPYzGsvjHmhRfkpvzgoogbWN9VcnTUyaCKQi5Nnz1v9AF8MCIC5AkjLX63 3Qz8cfWg+ptREsgJTsZipf8ZJfsWAMk7kpShe3BjVu0vuQ6krhuD3KgPPDPyVQ4/FgiW0N0c6 lMfbwkT8NOx6Bt4lOpjuVVmNqbc0omEqCjC4BQEtWXzNjTSfb0yhwR5tdLzEt1RA9n+/cC90o 1qplWmbmG2Vlkro14R6JE2FxE4wKNkq0dPHMSnd5rokPoBX/NUuXW56p3RnJmV/JZTP+Hj/83 YQ19PshzwvY3LCuTX8jVWa/aQtlXkMxOFx8Blv8qHP0HaIaIv4+SRqZA3/ZqZvTEmJ4qHh9oF 1sy7LVqWg5iZUpQqFEFREdWMyyJ/8HHPUmil0akZc+w0B9jKXDx4jDk+U01Yo5vHgufJnTRh+ FLanyR9Q9z9lJdTl0DN1qMZYPjFA+vsqV9TlmONus0Z9MXMf4aWHktloxhwx/cRaDgBpORCwE f+DrEZkokpkdpksbKsNGyOrEdpB30pJii83FC/neYfFgDvhBeK2eXCZY6kyRS5zG9P3pd0GpI SCgDF+m2/ukeR4= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 94 +++++++++++----------- 1 file changed, 49 insertions(+), 45 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 e81d4df..1e2b51b 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,46 +359,48 @@ static void buffer_cb(struct vchiq_mmal_instance *instance, /* signal frame completion */ complete(&dev->capture.frame_cmplt); } + return; + } + + 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; + } + + if (dev->capture.vc_start_timestamp != -1 && 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.frame_count) { - if (dev->capture.vc_start_timestamp != -1 && 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 { - buf->vb.vb2_buf.timestamp = ktime_get_ns(); - } + buf->vb.vb2_buf.timestamp = ktime_get_ns(); + } - 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_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); + 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)); - } - } else { - /* signal frame completion */ - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); - complete(&dev->capture.frame_cmplt); - } + 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)); } } @@ -775,28 +779,28 @@ 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; + return -EINVAL; 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; + if (ret) + return ret; + + return vchiq_mmal_port_enable(dev->instance, src, NULL); } static int vidioc_g_fbuf(struct file *file, void *fh, From patchwork Sat Jun 29 12:13:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023877 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 C032114F6 for ; Sat, 29 Jun 2019 12:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B226B287F5 for ; Sat, 29 Jun 2019 12:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6BB128821; Sat, 29 Jun 2019 12:14:42 +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 C6D62287F5 for ; Sat, 29 Jun 2019 12:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727065AbfF2MOk (ORCPT ); Sat, 29 Jun 2019 08:14:40 -0400 Received: from mout.gmx.net ([212.227.17.21]:56933 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbfF2MOj (ORCPT ); Sat, 29 Jun 2019 08:14:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810447; bh=xSZf4sshgnOGkIeYWvVPeHeJaQd7iBzaUFcewOT9zlM=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=S+KunKnAkvNNEiWt4AW8FiVkbSb9cwZfEXvJCA2WdvcPrHL0BCN8i61esY0nHXKff Um/7xG3v61Z5qO3sQMORinTgHjlA6eB5qhVfLPPujGMRQDfNY1mXpGoQx4YJiZUe7S F/k3vsR7ZlCe1iVErf9LdjLuuIaYVMcJkvz5EDzY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LpbfG-1iASWP02li-00fOaa; Sat, 29 Jun 2019 14:14:07 +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, Stefan Wahren Subject: [PATCH V2 06/29] staging: bcm2835-camera: Remove dead email addresses Date: Sat, 29 Jun 2019 14:13:21 +0200 Message-Id: <1561810410-8829-7-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:u8dcX+uPWI8jZABOAZWV8959v75+wgTRZA+GL0NYeBiNO4JNFSI O8CFXIef267l28FpxCc6gfHE7zQDg3Bf+rp9PxTlpGdvHPpdbnF7LU5zEIorRVs3/k+hQdl lccYss5+ObL6t8Z7Vpb3AnfUkAMy5WqEbeOHUVgEh3nMcsnlYOX20kWwbIBIBMd7Oar8xSt EJSlGqdeFwam1zLN81ykA== X-UI-Out-Filterresults: notjunk:1;V03:K0:k4vywjo8ii4=:WGFAa+5MVPGtF9Ys6CGr31 vm5r5DuUKzJt6dfLqlVvJyi/f8p3W3VhfwDBBBmH+OtZ16/ErqBIT4WoyeLEkbMW6ziJSx2RU +E3/ewZ8PrLcQnD6+qfGhIktOSKC/wP2pEnPNt2PhhQWAWd7Dd2TncHstece1jlbgOuL3MA5C 77ObPR4B/Cn8TTCS6U7bSCkbSoi/hgmmAPaBPciAM8P+91CvhXcMMoMvQ4BCeax91abnI4+eB PlaFBs2ZdCRtd4pYqmDSiDfxxpZRT2/GChULjmXKDqGgaz9UNQSWAk5gaYrbpNJjHeTeWRO+2 g/J5OW5nVZXB4n8MGj7ZYMoxpI8aefkWs6c7YUbr3d0XHVophXoSPXaXNcGAsvK5stiS8FvVn i/Y0rAsN0eKTML6kY0CZIiSCaprCqZM8gtPo3FBzsmjNnsOj+fOb2btcV7/uEqIW9umA8eN3v GVWqtVzqjymlqpDgAEi50cgUkOxXW1P0+UgqKi4qpTOLUyvGZOSwU2G+JB5U5VMPkhCe5xsqw MdgQncPNCT8dLZ2FsoNTagFXa1PemeDQlixpvtvi2rpazrenIMSSCPabYcLlQ2Hrt36TQyzaL Je9ohV382bXDg5oq+vGaYUieY0myBKWhmNw/6rhNJLtYmxknSv/fV+eaC0C39BHYsp5HWmCvc Wr3DMN1Iq/dzp/bqhEJNS20rzjAWPXIZSNEd/UpxBditMD9F1egstn7a7N9cu3fz4A7chHl9e lXDlwSGaQE0OW9dy4zN4Hi3EnFgHzzzgmoBQgL80cHMNQZN4fPRqlMWswQKWDjb5rE/uoJ0i0 6Klmu3tqe3MKTcEUbFyNfHAOkOd/ev6e3YqtP0/yelP6/TUD1YAF+f/ACSH47u0yIDLDA/EDW kUHQ3kOh+lQFLF4tRVGkW9Swas/6Najw2jfrGB4QalK1gJrOOqNfpftOxRyhmc52X1WlQEbCH 55b7EvoHZ0qbME4t5qGbm16UIOcUNHVkfICaKVThDDWAuXDaQdDbQghU8g8lVeiSMQ4z5HZpF LV3P5JBqlKBay7UvP7Z/PZgjNeFEoXdYoulK9VxBm+Kb/Wz3G1XBY05TcUN0rhOmR/MQ+NIhM PZ21T3gt7DVaCs= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 1e2b51b..c9d3636 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 2b5679e..9adbe93 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 Sat Jun 29 12:13:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023879 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 7556F1398 for ; Sat, 29 Jun 2019 12:14:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65526287F5 for ; Sat, 29 Jun 2019 12:14:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 598262881E; Sat, 29 Jun 2019 12:14:43 +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 06804287FB for ; Sat, 29 Jun 2019 12:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbfF2MOl (ORCPT ); Sat, 29 Jun 2019 08:14:41 -0400 Received: from mout.gmx.net ([212.227.17.21]:35941 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbfF2MOk (ORCPT ); Sat, 29 Jun 2019 08:14:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810447; bh=nWEpcesPCUmI+Mn6YTovbWK9XLR6b2/jTDNwrsmjHWA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Q45iNnubk1AOnn3n+b4v1gg+mJjyYptHWFpXPvHGSzU2++hXPUWk1bj9asZZL47t6 w9mQvD9QQ6RT6BVju5CQbCjK6tK1RQT6ZMQtumE5Y5h7rNwRKoUfxVfqNjaH3Dv64s LzstYt0oCil8NtIjskJ3e0i0VXWyQY4y1RbjeRjw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lk81O-1iIBkb1y2c-00c6nY; Sat, 29 Jun 2019 14:14:07 +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, Stefan Wahren Subject: [PATCH V2 07/29] staging: bcm2835-camera: Fix comment style violations. Date: Sat, 29 Jun 2019 14:13:22 +0200 Message-Id: <1561810410-8829-8-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:O+h+utqVcyAqtPuE7AQKKFpwpGklEgTB5T3/xvlD9T5treICt9J vZTTpHlEoluTxPOyFJ3yjSFp/7sZsrF7R3FdzAacxgXuqCMpzyW9aslrVC9tT2UE7GHfumq ra+7dMsI3ETcs7BO6AB7Vqf81kl1z9eTv8thhsNpW1/+FtCP52Z6YjB3nMpVeLXNQH9FEyp 0jJkZSX+WkFaHD5QJsXzg== X-UI-Out-Filterresults: notjunk:1;V03:K0:nOycWNuUiG0=:pv4oTitjIOYzJnSTPL+Wqj fQ+7VNyUEstPdXOLNQ7Idn4dXQeR58ihIILc4hbnHEohvoti9dyJDJ9oAvskT5CTJ+/l0S2Rs 4BtwWff9VK4gAjDev89+30rrvHLxIowqYdPVvGjJzPa1BLE5DmKRjyCZgtRvjD2AG670hgpIY hIOfsxbzBw7pOOSpSy/j+Lag5Ee6T1gII2+9vQ9MFvVw8xgZ533f/wpaEP3UAhTgPaNYwEm+Y lWZhXnPGbl3XTXy5E0k3gPUBRLLFaRL17oSYr02/z9Fgtp9VaFIVh9iGIaBcI1YYlUFdsrPbC EJsSw+oCgBklA5tCBUOhM0XEDmkevsDvYOmQ9j4F5Bkl1i0HBTFVXrt7AliIXyIlmmpBVoUgD 5N51pZN0IdmonoqX1R7zDj2ZZJ634F/DzLtOsyds2tU4XiXRtn9Rd3qavchLVdx0hAQgmkwGW AdiKNNOAZYFkXVIVKsQkIQYxmn9eeh0nJ18B5St2+SyLqdHs2C43YywYZp2KiOyedQTp7yMah Knt+MT2f8J7JFjx6Tq3JmKYTGXhUSAi3h1swNcmdKnmUXxHnIzzyRvowF26pKPvbgXFSOZY6Y ywNHebiC8NtdiIP2k6SPphgPY9mEXnTGu7tDdm6nTHJ+hjdLTJ0Xskw9uAegheu5B0l7/SXQj GeTPoiQudUmNjr3r8weYZvNNvHoWSW8o10Q/8t1kmGYK/EZRYQy9WNd/8fFVBgRa3ZFAUGppN dISFckzcig/JmKGKR4shtnvy8A9cEKXCSIiVu0nFIW/yuyG0BG7IlJNZEW02GFgYqleKutTMs XUN4UFO+1HvNr6OoljECQuiPAdGzsTWyDvi46ddA/MwwKm79teMARH/EyN5Q9jPG7GZKWL10N jjPKx0D567DuGMofnG9LKUOl8XACxAVkPWYrlDzMq1H3tcIYulVGtp4Un3UkR8isoHv1dWgCI kIiKvwQn+y0V98JEn0z1+ZIv/7SkGc3CLqJFIE2nKXmtBBju9DTZ3AoiCWjListwMBS5sNAoB PAExryzX7qYAx98iGLR4x/VsCK1J+pKvWTowx8g1ZRaGHJ/8R2KpFz3vU3onmGRqnQ+GaAKzZ cfbW3BHBNTtxoc= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../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 Sat Jun 29 12:13:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023867 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 EFF2F1398 for ; Sat, 29 Jun 2019 12:14:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E02A02881E for ; Sat, 29 Jun 2019 12:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D34DA28825; Sat, 29 Jun 2019 12:14:37 +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 11AE82881E for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727038AbfF2MOe (ORCPT ); Sat, 29 Jun 2019 08:14:34 -0400 Received: from mout.gmx.net ([212.227.17.21]:55987 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbfF2MOd (ORCPT ); Sat, 29 Jun 2019 08:14:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810448; bh=sawqClbmwzP8gOS82jsaIvyieT/CKO+qLtFgq4B5t5w=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=QfI4dNZW4xwaLkIHUFAtaoI9avbKQSmL8ZK3VHmFNVb+NBg9F0ZbZqWe06CP63sC5 /OI2FIZVwKLUGJ3uMgooY5kSvMHkkENz5DwFjwhQGNL0+VG3ryQSj9JGahEBJ29d9U dqHq0Q1/kOTQOUPCIrIcmbhqWNZtRLRtFWjM8xnw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MMkgl-1hd3dw48TP-008WkP; Sat, 29 Jun 2019 14:14:08 +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, Stefan Wahren Subject: [PATCH V2 08/29] staging: bcm2835-camera: Fix spacing around operators Date: Sat, 29 Jun 2019 14:13:23 +0200 Message-Id: <1561810410-8829-9-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:uZlFCPIvwSrwoy1+6SmtOF/rdR78jw0SmsjXI8sYKvrfE3z+oes Xj/6YtX/idHia93ZrvoMnttlVTmSUt1DBmvmLpFN7ga4dGlwlkhehguKQ7m9FHDyEXxJSqz +LGBlbQ+DlJ3vdBF2L4pwIu6iohCgU5mhXV9IJx3DaucGCyDYVQOxrb5gxtK/P5xCLx1O+/ biVMshJADUxXkuEAQWNHQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:F0c2/fsffzY=:T+2/Ooa//clQAoTZkRKW5d PL8T3lXqlO1H68AesSW32TSfbl5ldcK7O0yNWeB7quuDpI+0TOIhquBUb80FyYUj/wWmZIz1q SzmcH34NUiVTpVOs/62j0K4U+Prl/4Nen0TYY6kQxSmFswsD3+pYwp+zMJYyipHtAYSm/MCAU v/XPTpiXNh28Yd9xHYQOTWWnsauZx55hG51bfKnbD0+qZp0ahE2Xb7PATrCaHsvt8yT7xE3Mx U+4/p7NtTivJhRJcoDkRny6DLtbCJHq9Z3erdPR7kONCybZC/PDKAMhIzCMcSkfm59tUqBMPa pX/8f8LL4y7AiliN/QqwF2SA4erg2cFrEq4i2Jdu/fwFjKPHbQP7Ndu0XJ6lXCAqzKL3WoF8z yfv0hI+4jF7T9GJfIyhltvY2th8/oDAB9XvGzyZRQj7nmlflF2QF5VY6BgQWwdtgxWrU+MDf+ O/lyDEG3pAHOHA7G9WD7ZgVjs3aQbVDzK8Orq5XvAv8sXCADqPCR91p1omfkqYd3+OpXJ+WiP bivf2skeYQQC6hVaoqrzKdc3G+l0vLZLhaxlmljm+A6XqLh7zOtHKlYgM//sFwGBfCwXPpKDP LqGha+j2Im9dDDAz+p3/OhANHg+9wqbUMQz6Iv+n3d52Pnz4GRb4UvDgS/QUwLXxobEXojQVd GYTtHlqQxSIiLZRqMzsWObocvYnaRC6OD/BiBlnybMNBruNpHsFNOQDYc2JyPW5bY611zTJlT JMVIQ3/1GiYQ3xqThG01xLRCc0A+f1koLNqXDyRcH7Svk56YshijA9+1J1i2zeEIWVWdw1aGO YOMA4sLocLh9vPwgiN5s5aeVYqUoBrPVwRktkZH07COMAmx4lqcm/htRPz6hjD88jCDhSXGn1 lQPBxfU60di3Wly1TMwIh/IqxQFiKNr/WZsLo+MfstUCRoF4QE/meehjC58FhPKYE0iZjVeOT sLY5TQB9MomFcPThwBzBj/lp98D6L3g2SStfEk/cWNyulUzNAItF1Dfb9yO6nzCIb9XfKH1sN 55a+BUfuMtUxwPH/3CL+VH8BWAqcKil/xCMXnglcRSzsIVeZtu7AQGWnfhxBj9UOsaMoU6/6I KdvW3tKtw41AN0= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../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 Sat Jun 29 12:13:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023881 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 0A30714F6 for ; Sat, 29 Jun 2019 12:14:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE86A287F5 for ; Sat, 29 Jun 2019 12:14:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E270928821; Sat, 29 Jun 2019 12:14:50 +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 5356E287F5 for ; Sat, 29 Jun 2019 12:14:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727043AbfF2MOs (ORCPT ); Sat, 29 Jun 2019 08:14:48 -0400 Received: from mout.gmx.net ([212.227.17.21]:43195 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726916AbfF2MOs (ORCPT ); Sat, 29 Jun 2019 08:14:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810448; bh=eDSzHd6b68ZGJwR45fzO10/uR3dd9ElGp3lvBglLEBI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=XodfcTEJl0WKwDTBgv3pbM08c6G+wlAGw/aYrLebunqemhB5WRGFno6ujTp3UEitk gvoTEPK3CkcqZ2chyjwR/ruQeoJrfNE0yUy7AaW97IsgmBWy1lHu5yhsTACARbWlFw JHgX9ulB5F66JKODS3rM1LGIhGIxL472eIGYa57E= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LfkJC-1iMbbm1i4Q-00pKCu; Sat, 29 Jun 2019 14:14:08 +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, Stefan Wahren Subject: [PATCH V2 09/29] staging: bcm2835-camera: Reduce length of enum names Date: Sat, 29 Jun 2019 14:13:24 +0200 Message-Id: <1561810410-8829-10-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:oJuR9xr7EJ0VPDFjN9g1HJfR+ElwJiI0KXNHQVGPbSgfIWXThnV 6ab8otEPVECipiqgQ/kyx8zWybAp3vpLZaQCZz8zoioPIUdVmKdUdr3dLsako+Qs+kfVawn 5CEtOMezsYfFe70G3Mlz/idpaGYYZZdfZGOcVtZneCj3op5tlaLl/u+rxRECyggf0tdz3I5 zqqGmsnNsLKOhZ9S4f+rw== X-UI-Out-Filterresults: notjunk:1;V03:K0:uOyOBd8Si70=:GhI9MOpe1LbkwXAP4EXgXH 5evtBzBytOhAuL1hA30w4J3PgeL5hnPOFS4HY3tkQg0AvATwaPq/dRebfI/tLiQOiJLuqCYvX yiYbeHZc9puS1IwLPt+oSiucg1CJcR0xyPnXx7o3vIN/qbgtmVj9+m82vflfq2JGYGmGMm/aX XHRspMzr4TI9wy9+PvcIThVIxciJJhRubSB0xBPye1lMnrA24VTwNJAR5FrTu0TGEdBJ0Xuok zZsNmuZtoRehLYBSJRRtRCcKuHhkzxA+3fIIasS5tTSFYEsdJQ/q8P5A99vyjgm/KOpXSEtG+ tFKXAQf2wUcnMT1BkgOvF+CVM2fIQkOjmRb3Yka/YxrioYJjf6JPCPTaDg6wToJGFnKE3wTjh 95eGzhOb0TER0doFqg4DRTklXxn3f6tcmr7dNJloXp9wKVZM97gU9tfbiQG7BhG+HQoWquQl1 6teewRCqOqBHdeOP1lmJl0kCgoUka/cmVwKON6dRtSOYG9jyJcCYNoiZHB21KqVdfUNv+qCFp XNcMa/4uL61TCfmHrgR+EkNXbTE3lX2eWk34Xax/VrLE/FryfvxgWvrZvHnxRAfoX2pl2BE1Y La4DS+kjusjJ8WaKonBs11DGWdW6rH2LIjMEHeXGkdkThtn3H1AEzmKHXoZk2mq6yXNlJHeEM 5XsKCbzx+o42kVhW3vNpOECsvrzI0Gbc63h3gR9f7/Cd2eAksNcJqrQ6lSVlZRCCdnJpIHsYl YtI+/rKxHC1ln8FXv5EoYaQpvPzs32Sa+6S8vNiMMeei0tw5RK3ugS0LMdTQRiYXYbvOPRF5L HwyMX7Wp+i771myiWk9UwF0HsoiWyGfORHzJSLt3mbv/oNpGFFGWhEX6BXbVV7XD7B8XOUxUn RKNMTkAtKjnlHqtFtAS/GzT9FUQqK18lA5yNPGy9rNFGlVVvBkCHFeviD3EDQXcoTgIOrSeYE JpUwC/yWJofQhoIgAuHBLAhW3CN02szP2chXjNU78sJ8xx1iXM4Yck97Uw3NiE7W+umApLR7Q T3BIkx0tyvgfOE8SuHnMwZcbDP8wngRr+jSi8Z9wcukcBd8Ua16/1qyGFeV4VgnhL/7KbsGkC MA27MM11e0f/tE= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../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 c9d3636..c16a206 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, @@ -412,7 +412,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) { @@ -423,7 +423,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); @@ -455,7 +455,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); @@ -463,7 +463,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)); } @@ -515,7 +515,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) */ @@ -737,9 +737,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; @@ -752,12 +752,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 */ @@ -769,14 +769,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) @@ -791,7 +791,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; @@ -812,7 +812,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; @@ -1010,27 +1010,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; @@ -1070,13 +1072,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 @@ -1107,7 +1109,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, @@ -1161,11 +1163,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: @@ -1536,14 +1538,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; } @@ -1565,7 +1567,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); @@ -1586,7 +1588,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; @@ -1600,7 +1602,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; @@ -1614,7 +1616,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; @@ -1638,49 +1640,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); @@ -1691,12 +1693,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)); @@ -1714,23 +1716,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); @@ -1786,19 +1788,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 9adbe93..9bd262d 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 Sat Jun 29 12:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023857 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 BB6CD17E5 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC30B287F5 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94F3528825; Sat, 29 Jun 2019 12:14:36 +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 F0C39287F5 for ; Sat, 29 Jun 2019 12:14:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726958AbfF2MO3 (ORCPT ); Sat, 29 Jun 2019 08:14:29 -0400 Received: from mout.gmx.net ([212.227.17.20]:51391 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbfF2MO2 (ORCPT ); Sat, 29 Jun 2019 08:14:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810449; bh=DRr7lscebZ8wctMokVnVvWYIcPpsVGDYxVCVDlgab8Y=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Jf73JgXLpu8P1OqTc1ysI742Dp0LsmYDy3Yw/BJDEjcjOFA7ek79lVphxS7fIZHMU 3C9WWmAXEGLjT8ube1N4xz4lFfbdoQddRtwap8ohiNb7K6MX7LBNKu0J3Dn4meChgy ZMDX/GSQyk8HoEyX6kQCge4wmXSt0ysomBP+gRB4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LfTC1-1iMsrB3eoL-00p35n; Sat, 29 Jun 2019 14:14:09 +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, Stefan Wahren Subject: [PATCH V2 10/29] staging: bcm2835-camera: Fix multiple line dereference errors Date: Sat, 29 Jun 2019 14:13:25 +0200 Message-Id: <1561810410-8829-11-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:mIp1k00YLYIRTQPgciwE7hDEy8fupJdyLOgpvG+ZfkBfWRhYiKK 1B0oaaIJL/kqiFJmDpE0dfUdRMrRQgkbIKy/V7QTD2kAYIrp1T5WtP5HwVy2Ac3ZieJwJew BW5g8PtgmP7z0oumhPN+lOolZOvwijqvBIZVfPCFlcIx02Nmtq8+ghOSLMSigc+vDJU+ze5 lwnIhbS+fMLP79hGE9Obg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Tym/dFtHE4A=:OinOAHIJJfCiT0JGpKiVS6 7tMQHsZ5Lk2yhUAou1py6asMsBoRqXt2Of+eFscNozQFRxvm1gCdY6YBjrmL0dfvmq60fePy4 DVV3XciQb5IDvNfMIexplpaSdN8y/M0m8hbZk5LbVn0HgER+0q1nDRiONl9/F3KFXJjFDFoW7 KVkfe2+EX9hsLKaZ7L3e/gaup0SDnliYzIAN+6GwZuXc9V71D8cQN/FM4meEwlXcKALqJGywl NN2hPn/Cuz01SdC2UPIyMnjtbLb8sBEFoyB4CpfSacWKXgbWXy7lW77JBnRi0oSihfI+fHDMB +eAQSd+V+hn1WSaa3he0BetbwPvckNiaTUaq/KQxp5St68xIX30JSjPBzv4f7UARO7q9bgn1J 3NCTzWXbLIDtwMGYFOC3H+G1miFr5hj52L6nNRegzw9HG/eXjHsWFCAs2FJWEoLq1xqeYeY1i 5yqAbNqREkjY0HHmMpioayAfyMabSb1piZBTPoenQLEHLpFd4XCeaZSak4VeoD0cZkuE4/BBX aqg1rHN8nOy/ueiScBFKjC6Tiwd4prRK0UCi++vIeihqwY1ykSeeRt7t5p0Fi3s/GKEFFLHjq juaBpKiWp76hlzMAzfgicA7zF4Z2IU3ijLIsM/sdnUZ9CfrVaIg41I14ujMl4DjgMHTs4O8rs I7yw/yKC4K1r+Hanjzkuo00SLtFH/YJDwyixeDYuzTmdsm7dDYQtG8WXq3RorwjuAVsetHFU8 vzCDBP/guic3CRX9pvQ0zvSI9XD+lK6pe0/ex36lpSyrUq6uX2Kv/zZXotUdbXuImtHP38Q8X qNP32Jnjl4TFiKznLHXnefLQ/Ea16d45853LHRTqtx+/gsjZ4pRgsW5A1x1BZiUAVVs5qbNK/ ySla07DiMiLaQCeqHB6h8/9es1IRVodazoW4dp+AVWtvUPSmII76hm7zHj6CENETiI3Xmm+/2 bDm1sYedAw/tm2tNDychX7iqVvZ/8xynwNNkXqkmjjr9NEZu+q8eyHWdAJZfovvSfmJ33lnnm R56EdO6dQoZAJDQUZ+jznUNM8Rs6zV0sUsT2XfplWhnx+flBC/y8D2gdTR/C/aR3ugF8nWMcb LugtI+f3Fh0tXU= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 c16a206..753c3cb 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -1015,12 +1015,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]; @@ -1211,9 +1209,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 Sat Jun 29 12:13:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023855 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 8D72F1398 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F65728821 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 690EB28825; Sat, 29 Jun 2019 12:14:36 +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 65AFF28825 for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfF2MOa (ORCPT ); Sat, 29 Jun 2019 08:14:30 -0400 Received: from mout.gmx.net ([212.227.17.20]:42317 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfF2MOa (ORCPT ); Sat, 29 Jun 2019 08:14:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810449; bh=2vMmB60hqr3zxMDs/2xUlpIve2eQnaNGGEk/RnKtgqI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=hryCDATcdajfsa2L0v+1NRa6wMbUF95A2u4SMfsqcHQhewuM6Alof/qDnrPRaHKqW Qpm7fh9GBVsD18jSm0621o7vTkMBfXBI+yAeiS2xl/oWmW9khOE7X6QQ9n/thpr/4Z dtYR2QatwXEOE+1AvzKo65MWj7PkO3rkppPd+Lic= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LhwAY-1iKOgN1HQg-00n8LY; Sat, 29 Jun 2019 14:14:09 +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, Stefan Wahren Subject: [PATCH V2 11/29] staging: bcm2835-camera: Fix brace style issues. Date: Sat, 29 Jun 2019 14:13:26 +0200 Message-Id: <1561810410-8829-12-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:xg82IR/YrwzDKkqe0xrUSHWdnUCYSrOu/C4kVV5IZoQAEU+xv4w Cb9T95Vs//MaV27yrM58adcxfOUBiDeECBh8N6AzgP3k/vomS7kGutCoyqYIkKTQMnxSty3 AWnxw8xECdE5LymmoScdh8/tIqJfHbZBKjQFuWiP6boqtMbDwy3pmT1Ehv2D7l4/97iWsJf ht7cz52+UZW7PgtVbSIoA== X-UI-Out-Filterresults: notjunk:1;V03:K0:zD7mBSQaAx0=:jGmpEMPg9ZYJO67MKaSmFL 8kjek2SG/fuUHrN0UkD0cYwhvIbH0L3rCW0OCk+jG1/Ric3+E9jaCDh+STIhPYxYNiqoCvn4P aqDIMdlD3dGY6nd614v46QPIrEeC/TJAQq+jTHf4PNpWAIR3B94VzDQMKFtJxUFlkLuFy+6mE yA8sphZ1lm73n3v73wF7kyqe35+lgw0rCG5PQ7ebnThakwbpJ6GIUYF/ZyvmEFg3oiY88PjI7 eF8YYmY9n3dP2mXKezA/tUyY1xeLv2Y0J/Qjw6SklkgVn3vl1qNBj8JBOTLoQWQ5FCfW0lLAT cMH0GeQiV2493m1rZuMF+4E/NC0a9XUmNd5oNpghPiwVj5cBVlO+RqSiXglt/iMDMyR7QxmLi s8irWsZQ47A4Gp8wYWiK+zBBwam/udByYVIu5QNgJLJGI0QpSt6ks1q6MUeLBrO7qQvobzibC tD51bylGKFHwdd/iPBnHZgx6VVhVBthsv6ar6QVVWMC1Lt3rfZaDkVywYqlZTovPjzg+6/Quw QMX9LXsASPiXz0NWJgy3xgtZ8XVE+JQywWdAgf3W5wvNlIPm1tHBlaJHQ5emgthn/JI/AAafz VJbHIaUuFs0PkhLgpRWFXIeqSlj3AesIw/luiEKyAk515sbkl3shR8TuVoUW5uhZfxe+IeY6Y 9HgBg2Zuk8NgAvbpdZAQHx/4Wnn6ERCT6GecQZNM4tSnmYRWyvaqtnq5cxE/gKWs//gSgZJYg Zdjt+6sedlRd9Zy4ODtIG/DhIQZadUyOVJJw5kfIB0Yp+9sM8PNYzG+fi20OD/6e9YKeYb9xD +543KVos5qrSoKxPpA+tCQhp/r7v1QdYDHgZeQpaBJa+SIn3J/o20UN3ulk4/jAKUY2p9yQb/ C5pRpa8AavYiKI2nXPxo/NhaIPSnN6Hc0uGywv1cFKNeETuiF3r6KmTsXykIIu4/0DHlpXoN5 jMY/3NHyvEnIsof9aMtbwOvXU9Ce8eDIhSkis7BXMU48RejDPlh+cAmARHnrmkRg7T9aem4Ry KhwwoOkxfzW4XYX9q0nUS/U7JRA27bGtYZZ8nrKncz98FW8xbrgyqFy5VjshXTIU2mcKkdfxM k9F4iYn8BsLu1o= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 753c3cb..8813ffc 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -543,10 +543,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(); 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 Sat Jun 29 12:13:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023851 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 29D1814F6 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C68228841 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D06028846; Sat, 29 Jun 2019 12:14:36 +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 1CAF02881E for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbfF2MO3 (ORCPT ); Sat, 29 Jun 2019 08:14:29 -0400 Received: from mout.gmx.net ([212.227.17.20]:44097 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfF2MO2 (ORCPT ); Sat, 29 Jun 2019 08:14:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810450; bh=lqb0GYVfx1zv6fO8FMllOzy0xCPuxLT1hKd8sJfD9HU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=A3Ac58GtFkjzDPTsuHI66QgLUsSHx7UXS+Be9ozhe/MTT5ZX+NA8C5n0NLLBRVV9g qF014PXESDBFwlKvzH8T6VDJ4UPdEcgV4fTKWEosp6mwkSvR0zTOJy0G5dLXgcAP2K T51SfbBpXHmrMuo63ZE0akhEBl1bemQeQzYYTpeI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LfTC1-1iMsrA34qf-00p35n; Sat, 29 Jun 2019 14:14:09 +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, Stefan Wahren Subject: [PATCH V2 12/29] staging: bcm2835-camera: Fix missing lines between items Date: Sat, 29 Jun 2019 14:13:27 +0200 Message-Id: <1561810410-8829-13-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:AouCbZc7Dgcy2VJXo5BzkXG8P6sTu0cIpPoIeko7pitM1iIcSTq 6J2Sv/bRRNbyszHl1LN0b+FgDjflg311LO0lzMVZyNhPU83CGbIrOXnct+wPzZb9d4nkvbs /n1J2GjbM637uSOpIKwUHCKfuZkPhHaO0N79w+se5CTamoz8thAPdxL7VXtFdFVmUi+8gG8 RVvu+eQlPXbAVlAbG0DgQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:O5qRPkUdzdU=:4Ie1ZpOk3U4XKRXkw3H19L fhuy7yZLkBAIvZpSNsLhW75FvEu1Lp1zW0TemM7Z37qocomGNkP2wptdFKnBSBSk7yMUugcws 1NeYqh1lVs7o8NlT6a+sBPfVNex8NdsWrOAkui7LqY1ZCNdb86zioun51QU0PzSWf3b2m2HJn q0X2z9g6PCQg707MSL6ugU025dtFGmuUFpLWuHEpiAJLHnm49/7iy9xlSNz/MUb/LjFkXYbv5 XxD4A8w6eXJSRXUP+ufxisyOUCl6CuijtSdYEZ/iaQpj32dArROu1W7A9N2BPZn2MXOVK/nZ0 e7xWgPOIr74YdG8b+rVUg4l+e8wBk+LhBUBTkMhHdsehk5mQ43uo6T5sdsc2/nz/WACbe7rnm B/2HcniqzXXW3LBAlkSM6nipukleeRieX8zVb/JEF+RlExalbjZ8NPZ/cKHahV0vD8lZEhEVu l3A8tKyQHs/Cm/pveWEGYNbKX2l9Gziev5oMOR9pMQaxU606Jyvw8GgdERkh3wW1IBO4+epw0 0TKIL3bmcxhmz2iK9xYV4Q3+l/k1HvHNNddiEh7GKbDMQGviL7EYN32NM8dO0XRN+IxBpUlm1 vfY2vRBbA6/M4+F44IxbKpbfQAJW8lmO2HMkzCPA77yv/hDs1zPYq137AJEq4p5MXd9a2D95q Q8qWbduO/fSBwP65DToYnt5S4j4On6Vw4Zs+JV19rQ/FO6Ztkc83nLIuSHnMKjnuzTMLnczU7 gT3bLGmgGCujJcSgBIaa9OPXYbd7D0pocSGqeBFSNNQ9otyPSK6BMQ9KK7ML+WVNJBZZWa+YD mJQv27Wmzt4ggpFel2E2njXX5VvDd6x7Irdfer+tOYe/gzK+4VcIqPQwdlgS/F26VCXfjRZtz 3ZxpP6tNhV0eqDNF62xumX7unnaHOjzyP9oljAwQdOytozkZ0Czza+CZ7iNYrVBDon1w5Zs5b zfQcxd2LHYVEHjZfHtNOCitGjNBaY40hO/3FzYrYTHp/Oci6nKkhzzv1Dydzb4SvpfmY8lUJQ iPductemKgh8BnWDp4Dng7QT4OgfvViMMjDwh8v4WT2OWYWlQ3uaIXf6v/wi0AlY6B6z/hZ7k nWxcwEqAQAhtjM= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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 9bd262d..d9f0411 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.h @@ -128,6 +128,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 Sat Jun 29 12:13:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023871 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 35E5917E1 for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A2A8287FB for ; Sat, 29 Jun 2019 12:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E5332881E; Sat, 29 Jun 2019 12:14:38 +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 E59862883F for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727037AbfF2MOd (ORCPT ); Sat, 29 Jun 2019 08:14:33 -0400 Received: from mout.gmx.net ([212.227.17.20]:60873 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbfF2MOd (ORCPT ); Sat, 29 Jun 2019 08:14:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810450; bh=+MNg9Ng71wZ+upNb9jMR88EfmSYMRi5mPcFt4Zwi63A=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=LE8tkjEcaptJ8W4ccljYqlcsvyIIoI2UsKbIe9UeqRmcwLq3BG7qVQWDOeSCcFwcC Hbbbt3KkBI0beq5+0ePSw1xUgiQoqCtbM9yVnTsDeGPf0Sui8msUgEO3nvXCwBI1TL HYJH/jXVvKwcm0ZSjem3ABi9jiTjroghPsh/sVRQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MOwY7-1haqiT0bEV-006Kt3; Sat, 29 Jun 2019 14:14:10 +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, Stefan Wahren Subject: [PATCH V2 13/29] staging: bcm2835-camera: Fix open parenthesis alignment Date: Sat, 29 Jun 2019 14:13:28 +0200 Message-Id: <1561810410-8829-14-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:qnVbBMjKF9tsH/xeRV2gaNlIm6MhdhWQQPBaOhwQZWzfj7J7KDb A5PQICqF1gSkKG2lrCFARwgxCBhxgZmbTh04U+HklFrWzwXIZRSHgDn7gqoivAeajHr34rv Bg8YIoO92N5brREftQmfvRoEBSwFbRSpLHrtQCHsBSloGG2W27nWAa0uG+JweCNqRSsfw26 1Vt6W2kg2pimi90SWFgeA== X-UI-Out-Filterresults: notjunk:1;V03:K0:GH6PcsME5uw=:YSpif96mUcCw/0tifg9tJ4 XX00hZegr2q4OQubQBsQMO1gg7tGNJcFaVw1PL0RC9p6eXTxHoyfq5BcJHA/7V5G0xxjog+2c QSsLO+T2gQzYOuUythYdneZKLh+8rNzBzzRaifUcVDwmC0HXoHVWwSCg/6SBOzmfOor5+Q1Fw Iba013Z909/rE25Uzs+FQFkJ8saXKM7rlhy9ozRd07gAfKUlEaRxQSrFwjbOcAjx6SEsjBSOq o8B94O8nOGywrTmkjohaxh9s2G6vzBKJlHYm+OYKFJ4ONLKS3LlvDoZDwFCg/PJcrFCrqC8MO AdXbj6vCo2Ed6zb77pFRyjHNyPVpVzHKMBKiBzVP2yYwrKH75ko9NWVZkOC/Uic2X6cZVpLZ0 PmLLfbp/RdwwOs+gp//BrnI9sTv+dzWXe78wSKMLbCCnQU1viRd0AUqCpk2N61OIq1S4KN0b/ On51KLuL+0q7UztL+IyTPWTj+DfWtVJnMQDfGUX//sOQsrxzbbNtMovOSTBJzjfZSUWn5JsDs A7w7IlSQYYkt2RYPoI/XlS/1quT0oq7UZssCWLQvGIoZBaQmkIgqfJwpbtsPzTjF6qMB0lCHm EXCaFihuZI0/2191+3uOQ03w3L2YDFx7uED9NJFXkOeOgPl3h7rHcg7WyjrGh9XsdnelBqWld 3Tq9YQQrQ6O9T35NQj789sqtne1kuR9ycDhmDdun4HujlpgbBe1Gjot+ScWAPvHwm8pFYMKE5 qJlS+IDS9XlJIoVA0XVMLPcdYdgwg6vxs3dnQkptjnLudoUvQVW9EqUlJum5lNxZi/lPuWX5g ekNCVMevwx2hf9LBD1GC+M86WkBa/KNLDF5RIs6u07YmvKDFu9RBkDsezF0qHgYEHKafULUkn hQUHjHB0nRUyXRenwQbeTdgQeO8ng2U6Aw6txfGrlsoagQRdCIfl+RFUznYPAcJcISr8lFjKa hxSWzULlL3pL+m5FpRNuIg4FtBXmhetl/8Kr1qJu68X4jR1nrI7e6xv/ny8yHInuTYwdI2k8d Y2jl6ADsAVaEBKMztJ2QFFcJsAjB7I9aa8eLAKVzksuOucbQWrLH0yt8U8zsylTUtKuzDhMry 6Z8jl3uCiT75sk= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../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 8813ffc..5ca644c 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -557,8 +557,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); @@ -948,8 +948,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); } @@ -1295,7 +1294,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 Sat Jun 29 12:13:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023859 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 D6F3317E1 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA8E0287F5 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C893B2885F; Sat, 29 Jun 2019 12:14:36 +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 31D1228841 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfF2MOf (ORCPT ); Sat, 29 Jun 2019 08:14:35 -0400 Received: from mout.gmx.net ([212.227.17.22]:51089 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbfF2MOc (ORCPT ); Sat, 29 Jun 2019 08:14:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810450; bh=PsXPKTFlFy3F5v1GrxunrIbc0Yz6bQq+zN7/aiCfhr8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=GGL2Cui21skezh03MLIAqtwX733RXjVzL25OHafdZFiP/lnXUEexKeljJZ/frWJGw X/U2oguQkQyTskiVWF22rRPqGC2mjA6rPePYzjnb7oU+tQVeTKEDk8xUetq4LZ9NqD jL97VwTqXUf3fUWgudrDCMa5iSXtS8FkU/YFIxyc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LymjL-1iaY7h2Y23-016Alh; Sat, 29 Jun 2019 14:14:10 +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, Stefan Wahren Subject: [PATCH V2 14/29] staging: bcm2835-camera: Ensure all buffers are returned on disable Date: Sat, 29 Jun 2019 14:13:29 +0200 Message-Id: <1561810410-8829-15-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:wyjbWJY8Q2242ZTH+m/0IHN6J/mB8YMeACQ9qibx2sJtIw+WokY 7mCx/PHEVXIKhMLT7IlMRXaxgYIXpwGDMVjEPG6FfGQHfuIf/v/BUFKJE+o5kWBLZgN/VtU oxY2Av5a0RtGwZ7eJ9d814JeFG+UitWBJoaBB1F0dY/jFXQMz8lNe3j9JZDZ1jIy14sq9rg k6RAx/moRh5AoRPzuP6qw== X-UI-Out-Filterresults: notjunk:1;V03:K0:LT2QB84/kq4=:8vlHi/aT3jOjYqLyYGym3L LHJpVf59moRvH11N7E1MxS+r6L1EwAd0rQRwPzUv6KLx6b7tZE7ZUCfqWENr/skXle6emQaP6 pTizpwXDjLYHbIWz4fOjEhqJqEzfStD93aqIWX95DNObnwwgvQaF9kWj64pGSiS3DafSQ7Hhk hy5lyKeisOrfsiXm35JKOI5RA3lobbSWBqiTT8pPd26LJX71hDjga2O/Z0rlRavxMMnwRPWhX lWdOq2Y+5v5a4OlvMFKlk5ig9lpmc6nkcfnfbpUism0s9qBP9IgnXCjWwIyhTplQrbPIh7ldL LSycy1RSb6PJInodBNMrV4d86kJkHMZPVzRUsr5voClqlytgjGj/YLOS2aPPG4XjyRxHMb5dz VwJc6XcJH1D1P+xY9C3PdQRb8kifoWx/MAg/jIEFiIFyg74872VpdT7Ur8XSyKyq+0yx0lQT3 yNdDVzVyuRyWtKV5A4uYpFqy4lH2RoTwWnwRqu60rGiZ+MNRbepzkkBinkkzoFhY6XRz+l+2u N0JZag31x7Wk+cLQN8CAStwSGIoUbUE9OI30v6cACXyJ3Use1+UthaZIp+SiQEBR+NskjGtaB p1ZbuUHYPaclPemNqWuDRCaWh8/5NVgpwpMvacmqACC+WzGbk4cpxIh6Qk2404gOwEcZy395M 6aV/zi8FPfFDC03e8k2Tg8uZLZaWOP2pm6ZJmwyYOl84TBWo86yVEDo0BIkLmaYbaTBGze8OF jZz2lfdRIsLIoHMTMtJTGdvTku3RDDchWacU6vR+OrmM4ZVhqZXCA5NTbrc250yXkuS/9P+kv TOLmpuMySlTSgxrTnoc52j2YO+fOS4/JxenTP1JneqT8XEKiNWEX66Kzgl2edC6KYNstERRUl DASFXzngY3bWWLPybrvx+Cda57ASWp6m3eM/n3gR/3II+uInhF+uky364lm9tG9hvBLbHBTn1 /bopLBqahnpJMNK2mOkDezHCp3lvczZjk+/N+fx/cUvxYBWG3I71VJ1N1u4tpOviSQQDPpbUf b/9fFIF+/mrL+CuLIjpcLLMgxtunk1pjLmSeLBctYpwmeaTp5m9CTjfXV2r15D4PCJfw69GIf Tm0U00qxR8gOgg= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- .../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 5ca644c..296f4f0 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c @@ -584,6 +584,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); @@ -607,12 +608,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"); @@ -627,6 +622,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 Sat Jun 29 12:13:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 11023853 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 6E4F7174A for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6228728821 for ; Sat, 29 Jun 2019 12:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 565012886C; Sat, 29 Jun 2019 12:14:36 +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 3C3A528821 for ; Sat, 29 Jun 2019 12:14:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726993AbfF2MOa (ORCPT ); Sat, 29 Jun 2019 08:14:30 -0400 Received: from mout.gmx.net ([212.227.17.22]:34649 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726963AbfF2MOa (ORCPT ); Sat, 29 Jun 2019 08:14:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1561810451; bh=rIM3Cz1WAKPV0BYtLr0jELwNn1BK7VirmbeWmMyEk3Q=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=AiKFmEsKy4deUoljE7ODH/oe/LorZoaNke4syWVP47iEzWjsVWIfv9JJiNkYP3huL 1yLYiMnL0m+cuHz5ZEekT4QciIaO6Hxr/rA8Fa/DuRWK9WIPEVB/SzaeytQBZdd0QR ADVvdczRUmXXcY483JoVu6/+81VEUYq52m77urLE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([37.4.249.111]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M1FAK-1iaGs7066y-00tDwY; Sat, 29 Jun 2019 14:14:11 +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, Stefan Wahren Subject: [PATCH V2 15/29] staging: bcm2835-camera: Remove check of the number of buffers supplied Date: Sat, 29 Jun 2019 14:13:30 +0200 Message-Id: <1561810410-8829-16-git-send-email-wahrenst@gmx.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> References: <1561810410-8829-1-git-send-email-wahrenst@gmx.net> X-Provags-ID: V03:K1:tad7qdgkQl4RWv6RpdHYArIVesPr8zvsMAid0YbAv94c5hbQZFf Xd5Wce7JOaEknJSu9kRrrtJBpHF+eqb4DTfJL/pheuXLMQUPcGw43RRw5zLL6Omw2ur6bN4 o70QIbb6S3xVJyz0iOiY5nhZ5CeI7GIeheQeNJh96uxLYWH4QCL5i9dEI7rpzCouTjXO8l3 21wAWCJJQvHAROw8zXW/Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:J27WurzvVEU=:mKcxB0F3zxrgBpjD3Hm/Yh XrRWggz/+56tCDUSUgXhJU+XhsfVW0BzFp7s6Pd4Wr4lHdoH2px1FBtlJmTd2sjEd3paZ4TCW pW82mbDcNqgpCPkVZyXwLk6bq+PnIzW9lNXC3GPAVcYsl9jjB42yH1a7SwFr51PdVNEOTTOrs +yqWG6BpEk4wugZJJkBwjhdl7RU+segMOjTw4FiKUv6gZdXYI+iUP/ijP6LMHQXh1Mw+LOlD/ ZAcdSD8sDWP0zhIM3F+hHRD1cTfgdBZFNSyN9ISWuKneK88I0mEUlr9in3o49cvtTQoaNLau8 jWq/ckN7qTSkIvDOlZmOVAQOmpzy4j2qKX8ORLDV9kWCUadd0TSEynuhAkgvg/Bg2fFdm3IF6 C+CUgtF+KB3uxOFOCrP07he/8Jcrty2QkvCp2f9Os6co50NJrHgeBfZMnU2SP5gCJjtZ09Mc7 V7YGixvu/yd1u7K/IQXMs2EeEMuUJmbnrLgBgKDcx/X62NJEoctvBEPW9zyd7h1QwiIg3Bafe 8HHwNRXoiOEFA4ZAFzYAwM+yQD5XZh+xqx/7gVbZI1+7YATSp6HN1Zsk87xUd7OYJYCEaoW3i 3YaT7KdrMjkAHFjcXOnLSvoevtS7e2xeOT9TsGxC5bUsqdoLyJkevL1Ns0qfns1ynq8h0jsal B9BsmNNYpNkAE/0Sbl43Pu44FAiu9H37So6JVqgHkT2P+w/E8QLyg/T9x/1uBX5UfoOQndVPq Hg5e7rdJJECpG9DfESwFZaWEdX7VyMrw4UdJPKtGCCSfeBfPk0fBTEWmyOXAHdCOYNiz4XKbv UEAn8zUzAetnvjo3yLAL0dDWV5zOIFZetCSr8ylv3VlgMz/2tanDzqOtYKLH/BxePOabOpxc1 o3/sJwcE0DvuhRkKW1B3FnkRJr5yv32qKd7f18oULfnh5aW+eIJcnT5WPgBbvhzqISQOrx0Rb LXlUalqil235FrDmg28UaBORWQTQOntFRdq2PvRpEAnLqMgvWO8ECCsGBjjEzet3fWJNkprp+ 5vzRvOqScVxz89POZjl9bVnwyOu9Pd6QyBZUGAqvZdTsdNaOwDHW5a1okBvlCc7MKCBNZ4oHF dBlNoY721NWP+U= 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 Signed-off-by: Stefan Wahren Acked-by: Hans Verkuil Acked-by: Mauro Carvalho Chehab --- 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)