From patchwork Fri Oct 2 18:42:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11814431 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 520AD1580 for ; Fri, 2 Oct 2020 18:42:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 249AC20758 for ; Fri, 2 Oct 2020 18:42:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RTapda16" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 249AC20758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wjhMIOHGdit+lS6oCO1alTxS4OrrJrVw3vv6ceVK05E=; b=RTapda16/NZCu8JBO/M4znwaWl cZettYnCpOOIwsGn5ge0ktQRBi37RRKWD1nG4+jHK7KxgDwpWdGHLmUUkmh5UIQjDo38hF3zgVUyx GNk5tZ3FOtSUGlSlKayIwOQKmOA/7srTTKyP49sHWRYsAd8DSERnnIUX1wK5r6Pdcl78pRrLODsDk r56hD+OLClcq7tIVo/oJW9eI0DI9R8CfQyXJzwBaCDpkw4nbH45M5t4Pctq46a1PrpXV0gcVv8V2k xqKWciJ2hg1IGGLYDISdPZ7RvvUKWfCFxZ9/7n78xjKxlaaRm5so9QMdXYnQbKbOZ7DpkjdaElFoL JVBy8PfA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0o-00046A-OI; Fri, 02 Oct 2020 18:42:34 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0l-00044K-RW for linux-rockchip@lists.infradead.org; Fri, 02 Oct 2020 18:42:32 +0000 Received: from guri.fritz.box (p200300c7cf13ec00987cfa6c93a91dfa.dip0.t-ipconnect.de [IPv6:2003:c7:cf13:ec00:987c:fa6c:93a9:1dfa]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 2E21129DEF1; Fri, 2 Oct 2020 19:42:30 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH 1/6] media: staging: rkisp1: validate links before powering and streaming Date: Fri, 2 Oct 2020 20:42:17 +0200 Message-Id: <20201002184222.7094-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> References: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_144231_994937_17829596 X-CRM114-Status: GOOD ( 14.07 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org In function rkisp1_vb2_start_streaming, the call to media_pipeline_start should be the first thing in order to validate the links and prevents their state from being modified before power up and streaming. Adjust stop streaming to the same logic, call media_pipeline_stop after we disable streaming on the entities in the topology. Signed-off-by: Helen Koike Signed-off-by: Dafna Hirschfeld Reviewed-by: Tomasz Figa --- drivers/staging/media/rkisp1/rkisp1-capture.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index b6f497ce3e95..9b4a12e13f13 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -921,7 +921,6 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) mutex_lock(&cap->rkisp1->stream_lock); rkisp1_stream_stop(cap); - media_pipeline_stop(&node->vdev.entity); ret = rkisp1_pipeline_sink_walk(&node->vdev.entity, NULL, rkisp1_pipeline_disable_cb); if (ret) @@ -937,6 +936,8 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) rkisp1_dummy_buf_destroy(cap); + media_pipeline_stop(&node->vdev.entity); + mutex_unlock(&cap->rkisp1->stream_lock); } @@ -986,9 +987,15 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) mutex_lock(&cap->rkisp1->stream_lock); + ret = media_pipeline_start(entity, &cap->rkisp1->pipe); + if (ret) { + dev_err(cap->rkisp1->dev, "start pipeline failed %d\n", ret); + goto err_ret_buffers; + } + ret = rkisp1_dummy_buf_create(cap); if (ret) - goto err_ret_buffers; + goto err_pipeline_stop; ret = pm_runtime_get_sync(cap->rkisp1->dev); if (ret < 0) { @@ -1009,18 +1016,10 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) if (ret) goto err_stop_stream; - ret = media_pipeline_start(entity, &cap->rkisp1->pipe); - if (ret) { - dev_err(cap->rkisp1->dev, "start pipeline failed %d\n", ret); - goto err_pipe_disable; - } - mutex_unlock(&cap->rkisp1->stream_lock); return 0; -err_pipe_disable: - rkisp1_pipeline_sink_walk(entity, NULL, rkisp1_pipeline_disable_cb); err_stop_stream: rkisp1_stream_stop(cap); v4l2_pipeline_pm_put(entity); @@ -1028,6 +1027,8 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) pm_runtime_put(cap->rkisp1->dev); err_destroy_dummy: rkisp1_dummy_buf_destroy(cap); +err_pipeline_stop: + media_pipeline_stop(entity); err_ret_buffers: rkisp1_return_all_buffers(cap, VB2_BUF_STATE_QUEUED); mutex_unlock(&cap->rkisp1->stream_lock); From patchwork Fri Oct 2 18:42:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11814429 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CB341746 for ; Fri, 2 Oct 2020 18:42:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E3412208A9 for ; Fri, 2 Oct 2020 18:42:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tHTBjXwU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E3412208A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bCTGaOHXB+E7kQ+i5F9qxO23P2PK/VkyLgmCmVFlIoo=; b=tHTBjXwUg0b7D3NlJ7mnpx8V+E DcDiWorqygxPCKis3u512GWYRze3pS3TTZIURRCYAExhW2hcByPuGhQyoAQyYBXD565ndEuAEd6Xg mAqlPGOUNMZ2+/wckHfcPz9scCHmXvFdHNuxKsRqC4HlXUiBLW1mjEZjQOKaPmRnpSHptzwxhZxAo z6nzzmrKDGXUcHEmNBkALK5evgHaSeOQnmBltF0BDKM56npbR3G4+aboLifp4OQQI0cRlSOwwk1Hl LNX65YAe0822UrQaNoeHdbU1kiDU4WMU5m3kPkj2BkJugVK798nFqxLOfftClp7coc8aIVpxRgxxG NiDok9YQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0r-00048f-Qy; Fri, 02 Oct 2020 18:42:37 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0n-00044j-JI for linux-rockchip@lists.infradead.org; Fri, 02 Oct 2020 18:42:34 +0000 Received: from guri.fritz.box (p200300c7cf13ec00987cfa6c93a91dfa.dip0.t-ipconnect.de [IPv6:2003:c7:cf13:ec00:987c:fa6c:93a9:1dfa]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 4307829DEF5; Fri, 2 Oct 2020 19:42:31 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH 2/6] media: staging: rkisp1: params: in stop_streaming, use list_splice_init to move the buffers Date: Fri, 2 Oct 2020 20:42:18 +0200 Message-Id: <20201002184222.7094-3-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> References: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_144233_853476_4A1E6DAF X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Currently the code uses 'list_cut_position' to move the buffers to a temporary list. Replace it with 'list_splice_init'. This is nicer since we don't need to access params.prev. Also, replace INIT_LIST_HEAD with the simpler LIST_HEAD. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/staging/media/rkisp1/rkisp1-params.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c index 986d293201e6..cb9f3332a9a0 100644 --- a/drivers/staging/media/rkisp1/rkisp1-params.c +++ b/drivers/staging/media/rkisp1/rkisp1-params.c @@ -1462,9 +1462,7 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq) { struct rkisp1_params *params = vq->drv_priv; struct rkisp1_buffer *buf; - struct list_head tmp_list; - - INIT_LIST_HEAD(&tmp_list); + LIST_HEAD(tmp_list); /* * we first move the buffers into a local list 'tmp_list' @@ -1473,7 +1471,7 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq) */ spin_lock_irq(¶ms->config_lock); params->is_streaming = false; - list_cut_position(&tmp_list, ¶ms->params, params->params.prev); + list_splice_init(¶ms->params, &tmp_list); spin_unlock_irq(¶ms->config_lock); list_for_each_entry(buf, &tmp_list, queue) From patchwork Fri Oct 2 18:42:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11814425 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEF46112C for ; Fri, 2 Oct 2020 18:42:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7E65520758 for ; Fri, 2 Oct 2020 18:42:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RXy7UR3/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7E65520758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CThJ0BGmZbsNcuV26f0H44vQu6+2Fqo1qtodd0e1NtY=; b=RXy7UR3/JOWKjKyQHDvs017M6U jjYQWKOpBPHXQKf5gweleWV8XAuTfCaCIirTJlPh+GMFHBVjxPe3OCZOLG2AylAEa/QOO3mWe32GA sqFJZUiErbyGd7X4ZWUWuT/eIh/P3ee1IZzO+KHKISvE2k6lTzj6dPHjEVGjUs99Dz+EN4XEeBAjI 6HiQbePCw1OYVS0bOyBbdEkYLShgoMTrLXrRh7BGc6pilxUHCcNs8IDVkV3ZGqS/KeN5X3O7tlAJU zWhVh79kWB0oU8FQsuAhU6Cw7MhNG207tRCklERYmY3I8A/9+LL5jZiYxy1fVFHtbETEp5zKY8pS2 O1+vD3pw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0q-00047n-J7; Fri, 02 Oct 2020 18:42:36 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0n-00044z-Jf for linux-rockchip@lists.infradead.org; Fri, 02 Oct 2020 18:42:34 +0000 Received: from guri.fritz.box (p200300c7cf13ec00987cfa6c93a91dfa.dip0.t-ipconnect.de [IPv6:2003:c7:cf13:ec00:987c:fa6c:93a9:1dfa]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 46ABB29B258; Fri, 2 Oct 2020 19:42:32 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH 3/6] media: staging: rkisp1: initialize buffer lists only on probe Date: Fri, 2 Oct 2020 20:42:19 +0200 Message-Id: <20201002184222.7094-4-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> References: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_144233_778413_C7E64D4C X-CRM114-Status: GOOD ( 10.87 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The buffer lists of stats and params entities are initialized in queue_setup callback with 'INIT_LIST_HEAD'. It is enough to initialize the lists only upon registration. For the stats entity the list is already initialize upon registration. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/staging/media/rkisp1/rkisp1-params.c | 4 +--- drivers/staging/media/rkisp1/rkisp1-stats.c | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c index cb9f3332a9a0..aa758f8c2264 100644 --- a/drivers/staging/media/rkisp1/rkisp1-params.c +++ b/drivers/staging/media/rkisp1/rkisp1-params.c @@ -1420,8 +1420,6 @@ static int rkisp1_params_vb2_queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { - struct rkisp1_params *params = vq->drv_priv; - *num_buffers = clamp_t(u32, *num_buffers, RKISP1_ISP_PARAMS_REQ_BUFS_MIN, RKISP1_ISP_PARAMS_REQ_BUFS_MAX); @@ -1430,7 +1428,6 @@ static int rkisp1_params_vb2_queue_setup(struct vb2_queue *vq, sizes[0] = sizeof(struct rkisp1_params_cfg); - INIT_LIST_HEAD(¶ms->params); return 0; } @@ -1545,6 +1542,7 @@ int rkisp1_params_register(struct rkisp1_device *rkisp1) params->rkisp1 = rkisp1; mutex_init(&node->vlock); + INIT_LIST_HEAD(¶ms->params); spin_lock_init(¶ms->config_lock); strscpy(vdev->name, RKISP1_PARAMS_DEV_NAME, sizeof(vdev->name)); diff --git a/drivers/staging/media/rkisp1/rkisp1-stats.c b/drivers/staging/media/rkisp1/rkisp1-stats.c index 51c64f75fe29..c58ae52b8a98 100644 --- a/drivers/staging/media/rkisp1/rkisp1-stats.c +++ b/drivers/staging/media/rkisp1/rkisp1-stats.c @@ -94,8 +94,6 @@ static int rkisp1_stats_vb2_queue_setup(struct vb2_queue *vq, unsigned int sizes[], struct device *alloc_devs[]) { - struct rkisp1_stats *stats = vq->drv_priv; - *num_planes = 1; *num_buffers = clamp_t(u32, *num_buffers, RKISP1_ISP_STATS_REQ_BUFS_MIN, @@ -103,8 +101,6 @@ static int rkisp1_stats_vb2_queue_setup(struct vb2_queue *vq, sizes[0] = sizeof(struct rkisp1_stat_buffer); - INIT_LIST_HEAD(&stats->stat); - return 0; } From patchwork Fri Oct 2 18:42:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11814435 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 298E11580 for ; Fri, 2 Oct 2020 18:42:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E178C20758 for ; Fri, 2 Oct 2020 18:42:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xpUKzHsH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E178C20758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jq1S2htPvsq2WfxiUZ7xJLFH69/l+tmtWNmhaGrRs5o=; b=xpUKzHsH8JdXhKfUZeeqYLzWrj sTnARqCXims+oocZRgDuZSyvdk9jmGddMRWnRh+tFwSQjJr9C81/VkuUDDn7Z5YQddkfAVExClnRC eBMxfQcuWPDW+hQwdoZI8TpwWTdy83ZFJKokdU6yC1b1UOb+R0kjbgTit+IbKN4K/vBJ6tG+5rBqw uNeZyPmgpIEXo5uheXJoKIO7GwoTwi1YvFDA67W7ImhxyC9mc2gZP9f2Kv2VxnO6ozkYewq5d4/Rf Wll+lKuuzjQSTp1QjXdlzs3YY6CXxZt3tjlur0eey5ywkY3S1l2nkY72RBFxEq0DhXZO9gB0U3P6E g/dnXSjQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0t-00049j-Bh; Fri, 02 Oct 2020 18:42:39 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0o-00045k-Se for linux-rockchip@lists.infradead.org; Fri, 02 Oct 2020 18:42:36 +0000 Received: from guri.fritz.box (p200300c7cf13ec00987cfa6c93a91dfa.dip0.t-ipconnect.de [IPv6:2003:c7:cf13:ec00:987c:fa6c:93a9:1dfa]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 0EFA429DEF3; Fri, 2 Oct 2020 19:42:33 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH 4/6] media: staging: rkisp1: remove the 'is_streaming' field from stats and params Date: Fri, 2 Oct 2020 20:42:20 +0200 Message-Id: <20201002184222.7094-5-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> References: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_144235_160426_C8BD8272 X-CRM114-Status: GOOD ( 18.24 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The params and stats entities have a field 'is_streaming'. This field is not needed since the entities can have available buffers only if they stream and therefore it is enough to check if there are buffers available. As a result, their start_stream callbacks can be removed since they only set the 'is_streaming' field. Signed-off-by: Dafna Hirschfeld Acked-by: Helen Koike --- drivers/staging/media/rkisp1/rkisp1-common.h | 12 ++++------- drivers/staging/media/rkisp1/rkisp1-params.c | 21 +------------------- drivers/staging/media/rkisp1/rkisp1-stats.c | 17 ---------------- 3 files changed, 5 insertions(+), 45 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-common.h b/drivers/staging/media/rkisp1/rkisp1-common.h index 45abacdbb664..692333c66f9d 100644 --- a/drivers/staging/media/rkisp1/rkisp1-common.h +++ b/drivers/staging/media/rkisp1/rkisp1-common.h @@ -240,19 +240,17 @@ struct rkisp1_capture { * * @vnode: video node * @rkisp1: pointer to the rkisp1 device - * @lock: locks the buffer list 'stat' and 'is_streaming' + * @lock: locks the buffer list 'stat' * @stat: queue of rkisp1_buffer * @vdev_fmt: v4l2_format of the metadata format - * @is_streaming: device is streaming */ struct rkisp1_stats { struct rkisp1_vdev_node vnode; struct rkisp1_device *rkisp1; - spinlock_t lock; /* locks the buffers list 'stats' and 'is_streaming' */ + spinlock_t lock; /* locks the buffers list 'stats' */ struct list_head stat; struct v4l2_format vdev_fmt; - bool is_streaming; }; /* @@ -260,10 +258,9 @@ struct rkisp1_stats { * * @vnode: video node * @rkisp1: pointer to the rkisp1 device - * @config_lock: locks the buffer list 'params' and 'is_streaming' + * @config_lock: locks the buffer list 'params' * @params: queue of rkisp1_buffer * @vdev_fmt: v4l2_format of the metadata format - * @is_streaming: device is streaming * @quantization: the quantization configured on the isp's src pad * @raw_type: the bayer pattern on the isp video sink pad */ @@ -271,10 +268,9 @@ struct rkisp1_params { struct rkisp1_vdev_node vnode; struct rkisp1_device *rkisp1; - spinlock_t config_lock; /* locks the buffers list 'params' and 'is_streaming' */ + spinlock_t config_lock; /* locks the buffers list 'params' */ struct list_head params; struct v4l2_format vdev_fmt; - bool is_streaming; enum v4l2_quantization quantization; enum rkisp1_fmt_raw_pat_type raw_type; diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c index aa758f8c2264..3afbc24ca05e 100644 --- a/drivers/staging/media/rkisp1/rkisp1-params.c +++ b/drivers/staging/media/rkisp1/rkisp1-params.c @@ -1224,10 +1224,6 @@ void rkisp1_params_isr(struct rkisp1_device *rkisp1) struct rkisp1_params *params = &rkisp1->params; spin_lock(¶ms->config_lock); - if (!params->is_streaming) { - spin_unlock(¶ms->config_lock); - return; - } rkisp1_params_apply_params_cfg(params, frame_sequence); spin_unlock(¶ms->config_lock); @@ -1303,8 +1299,7 @@ static void rkisp1_params_config_parameter(struct rkisp1_params *params) spin_lock_irq(¶ms->config_lock); /* apply the first buffer if there is one already */ - if (params->is_streaming) - rkisp1_params_apply_params_cfg(params, 0); + rkisp1_params_apply_params_cfg(params, 0); spin_unlock_irq(¶ms->config_lock); } @@ -1467,7 +1462,6 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq) * without holding the lock */ spin_lock_irq(¶ms->config_lock); - params->is_streaming = false; list_splice_init(¶ms->params, &tmp_list); spin_unlock_irq(¶ms->config_lock); @@ -1475,25 +1469,12 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq) vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); } -static int -rkisp1_params_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) -{ - struct rkisp1_params *params = queue->drv_priv; - - spin_lock_irq(¶ms->config_lock); - params->is_streaming = true; - spin_unlock_irq(¶ms->config_lock); - - return 0; -} - static struct vb2_ops rkisp1_params_vb2_ops = { .queue_setup = rkisp1_params_vb2_queue_setup, .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, .buf_queue = rkisp1_params_vb2_buf_queue, .buf_prepare = rkisp1_params_vb2_buf_prepare, - .start_streaming = rkisp1_params_vb2_start_streaming, .stop_streaming = rkisp1_params_vb2_stop_streaming, }; diff --git a/drivers/staging/media/rkisp1/rkisp1-stats.c b/drivers/staging/media/rkisp1/rkisp1-stats.c index c58ae52b8a98..3ddab8fa8f2d 100644 --- a/drivers/staging/media/rkisp1/rkisp1-stats.c +++ b/drivers/staging/media/rkisp1/rkisp1-stats.c @@ -136,7 +136,6 @@ static void rkisp1_stats_vb2_stop_streaming(struct vb2_queue *vq) unsigned int i; spin_lock_irq(&stats->lock); - stats->is_streaming = false; for (i = 0; i < RKISP1_ISP_STATS_REQ_BUFS_MAX; i++) { if (list_empty(&stats->stat)) break; @@ -148,18 +147,6 @@ static void rkisp1_stats_vb2_stop_streaming(struct vb2_queue *vq) spin_unlock_irq(&stats->lock); } -static int -rkisp1_stats_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) -{ - struct rkisp1_stats *stats = queue->drv_priv; - - spin_lock_irq(&stats->lock); - stats->is_streaming = true; - spin_unlock_irq(&stats->lock); - - return 0; -} - static const struct vb2_ops rkisp1_stats_vb2_ops = { .queue_setup = rkisp1_stats_vb2_queue_setup, .buf_queue = rkisp1_stats_vb2_buf_queue, @@ -167,7 +154,6 @@ static const struct vb2_ops rkisp1_stats_vb2_ops = { .wait_prepare = vb2_ops_wait_prepare, .wait_finish = vb2_ops_wait_finish, .stop_streaming = rkisp1_stats_vb2_stop_streaming, - .start_streaming = rkisp1_stats_vb2_start_streaming, }; static int @@ -355,12 +341,9 @@ void rkisp1_stats_isr(struct rkisp1_stats *stats, u32 isp_ris) if (isp_mis_tmp & RKISP1_STATS_MEAS_MASK) rkisp1->debug.stats_error++; - if (!stats->is_streaming) - goto unlock; if (isp_ris & RKISP1_STATS_MEAS_MASK) rkisp1_stats_send_measurement(stats, isp_ris); -unlock: spin_unlock(&stats->lock); } From patchwork Fri Oct 2 18:42:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11814437 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8484892C for ; Fri, 2 Oct 2020 18:42:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5915920758 for ; Fri, 2 Oct 2020 18:42:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nr6aUOOb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5915920758 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eSWQ/E21bfs3JsC9uM/lrQEh54ZuKe/5PVdhZjBZx3U=; b=nr6aUOObPO78gUE00+bZJLQN7V 67t2cT7hAFTK105//3ErKlw+fXrhtm0ToveSZ1rpBXvlS0OrFydCgSirodMAYWg6osqEfwOPllIsl WpRlkP+Ru62noy0U5TC7IOr9/wY8YBcZEckGu0Z+P3aY6hH+0ePP5Pzv9On7fgttxVnHMO5DqF30W k0dGUH5uJZzA0cbRD8Y27VuL/GfJ09sl6PQnh9Dx2ejch630Zo4iOeKLG3mDdrNYp4PfPwlQbpup3 5aoMMDt543qrcre4Mo86ra98oE/sRvhDfXUOt7VWz5ZSPuWHPhiNWqb2uwSKEkvujAZh4JBF6y+UN HaJp8sPQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0u-00049w-2X; Fri, 02 Oct 2020 18:42:40 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0p-00046C-DL for linux-rockchip@lists.infradead.org; Fri, 02 Oct 2020 18:42:36 +0000 Received: from guri.fritz.box (p200300c7cf13ec00987cfa6c93a91dfa.dip0.t-ipconnect.de [IPv6:2003:c7:cf13:ec00:987c:fa6c:93a9:1dfa]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 111A929DBF7; Fri, 2 Oct 2020 19:42:34 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH 5/6] media: staging: rkisp1: params: add '__must_hold' to rkisp1_params_apply_params_cfg Date: Fri, 2 Oct 2020 20:42:21 +0200 Message-Id: <20201002184222.7094-6-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> References: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_144235_569778_52BD7A60 X-CRM114-Status: GOOD ( 11.62 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The function rkisp1_params_apply_params_cfg must be under the the lock of params->config_lock. Add the __must_hold annotation to indicate it. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-params.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c index 3afbc24ca05e..aa18a113245b 100644 --- a/drivers/staging/media/rkisp1/rkisp1-params.c +++ b/drivers/staging/media/rkisp1/rkisp1-params.c @@ -1187,6 +1187,7 @@ static void rkisp1_isp_isr_meas_config(struct rkisp1_params *params, static void rkisp1_params_apply_params_cfg(struct rkisp1_params *params, unsigned int frame_sequence) + __must_hold(¶ms->config_lock) { struct rkisp1_params_cfg *new_params; struct rkisp1_buffer *cur_buf = NULL; From patchwork Fri Oct 2 18:42:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11814433 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF158112C for ; Fri, 2 Oct 2020 18:42:44 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9347620795 for ; Fri, 2 Oct 2020 18:42:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0BMFmhH5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9347620795 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0cjxSBsODb6AdgsfkW2QLEQWVtr6ASmbAOSJ+xtEQ1A=; b=0BMFmhH5H8GMragFVU9LmsEwQL vwTN5aKgTZi7Qkcx/DYMAQ/EXxlCZZKzCkjuHtWMOve9j7PYG4KctVssNpZu4rNAsEm5LBX0W1/Uh T/E1rnk4BSEmbLRjf5yflSdP425BWuQoeaxwI4+F8KzzfpQO7uruLyFZWiBw6qyoUhXhGhRlKT7Be MqlW5DOmH7/IaEKdoL8e/d7fSbtklSEv5hQ/RCwMHZ6lLFw0bUmiTD4J2fKKuHDDLqkG6Hc7Y2slh aSkPCWXJ9ltyXMPiKsKF4k/f+6y5OFPHKF4vKhbXJv7MIS7crwM+74tTh8BIm80ZJN/qfOtlAuIO9 JPcoOXHA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0u-0004AK-Ib; Fri, 02 Oct 2020 18:42:40 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kOQ0q-000475-6o for linux-rockchip@lists.infradead.org; Fri, 02 Oct 2020 18:42:37 +0000 Received: from guri.fritz.box (p200300c7cf13ec00987cfa6c93a91dfa.dip0.t-ipconnect.de [IPv6:2003:c7:cf13:ec00:987c:fa6c:93a9:1dfa]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id C9C7D29DEFE; Fri, 2 Oct 2020 19:42:34 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Subject: [PATCH 6/6] media: staging: rkisp1: cap: add warning when link validation fails Date: Fri, 2 Oct 2020 20:42:22 +0200 Message-Id: <20201002184222.7094-7-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> References: <20201002184222.7094-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201002_144236_339099_6D0FFE43 X-CRM114-Status: GOOD ( 10.83 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The link validation between the capture and resizer might fail because of various reasons. Add an informative warning to make it easier to debug. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-capture.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index 9b4a12e13f13..75321280ebf0 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -1269,8 +1269,16 @@ static int rkisp1_capture_link_validate(struct media_link *link) if (sd_fmt.format.height != cap->pix.fmt.height || sd_fmt.format.width != cap->pix.fmt.width || - sd_fmt.format.code != fmt->mbus) + sd_fmt.format.code != fmt->mbus) { + dev_warn(cap->rkisp1->dev, + "%s: failed for '%s' sd:cap: height %u:%u, width %u:%u mbus: 0x%x:0x%x\n", + __func__, + cap->vnode.vdev.name, + sd_fmt.format.height, cap->pix.fmt.height, + sd_fmt.format.width, cap->pix.fmt.width, + sd_fmt.format.code, fmt->mbus); return -EPIPE; + } return 0; }