From patchwork Thu Oct 19 12:51:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 155522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp360055vqb; Thu, 19 Oct 2023 05:55:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5ZgD9pSZsCmr5R5IZizg/GAGhlz2Sq2QTj8kRZOMrKUmqgHVAzOG92vKQ3zfLy+bQxJ2p X-Received: by 2002:a17:902:ed01:b0:1ca:3d9c:a752 with SMTP id b1-20020a170902ed0100b001ca3d9ca752mr2370987pld.12.1697720137623; Thu, 19 Oct 2023 05:55:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697720137; cv=none; d=google.com; s=arc-20160816; b=lo+TdULD5Ot+Q1RMB04e1w6Cdlh9AId5jep1KAUSM1jWBsk26wbCMtRrQpe2ePxJGM VVXUsRJHwla+N2kijU5EYvmjjHGeX+DjzdUghvfqwRA4Z/1HsExRaA/V6RZ5ASrBKK1c 1It0M4hVNwRhiidoAJPMPm7nVQbFvW4M18V3jx1AG+fjPSdJYWfRRmTzMUnr9iWBZLWI 00ExNb++7C7U3b10xMx/ncQvRwfmfcjbw2kx4IWJG1TGv7Bzgati48EP5gOuhQ4H4iRq ye33pEt5s7oHtsZPdJCRby/+EKQRb+31AYAqJpJjpUtwtvah65dCE9busIUURkAdT8SZ 3AJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=am6t4n+2sQpuZbKeCUffkOwgvf3HTAP+movCgweBPJs=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=zlj9ABmr/yeBQcBDOIeO8od6YX9ADSL1EaAYuewtl6gyPJPnM1CfSeTurnP2Czb0BG NCcctXLvjyQ8sHhjnCFxC8yBxqhWoCG6GaamUf4/E9nTsgVQAG+QzoVjoHeziMbxngPi tm9SfbG8Q4bWHag8sTZ9CVmUnuEvw5xwS88snKEP8rl9o4MTyhy/uyO5sTpUrlTXML3q vfd52T/zM11aXia+LwWvjqS4F5vSXn4R/KqO4Tr9x/fo+P58HkFRug1TFHgCZH9cyen8 plABXarZed+1Zi78TWrPI0lXhcknt0mvQgxjndIvllPfvk92qWR2kwBC326gCa+zhijo p0ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AHBDaI5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id u10-20020a170903124a00b001c9c9251e05si2163186plh.476.2023.10.19.05.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 05:55:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AHBDaI5B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8B8B0826EB95; Thu, 19 Oct 2023 05:55:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346162AbjJSMzA (ORCPT + 25 others); Thu, 19 Oct 2023 08:55:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345846AbjJSMwt (ORCPT ); Thu, 19 Oct 2023 08:52:49 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551D61A6; Thu, 19 Oct 2023 05:52:46 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:ccea:1fb5:34eb:239b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: benjamin.gaignard) by madras.collabora.co.uk (Postfix) with ESMTPSA id AE8B2660736D; Thu, 19 Oct 2023 13:52:44 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697719965; bh=+To6mEq3JeR7oNn+VfFQcxDH9wOCwdTHlvSi0qsAVuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AHBDaI5BM8oK3di/U+Y7WiExMD7eXnrE2S3OEKUs2oFkYTdi8wURGr5eK+L4Azq0W aKfJCwJL4mrFCYzxtBn+ZlfSWLiNYvPXNALXLQajp2uQnFBCV+Hj61/+Sr9QNRp40u X2nNsEAPREP3maPP2FCjIdIeguaL376dJda2Wibxhww8mm0rYieYPySolnrav9aI/+ lnXZl1OeDKp73ge0Cf1UHCSdEWUI6xyo8YASxF9klDDGaZ4/EFQ3CxCdOBzapCSBF5 3kMwoHZ6/f7MOlY3vc9RnUdX+Cm+BnLbQNzzAl4IxWIDuq2M3ukF9VIFVHuUtpWd/j F7mfH6C5AfpUA== From: Benjamin Gaignard To: mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, ming.qian@nxp.com, ezequiel@vanguardiasur.com.ar, p.zabel@pengutronix.de, gregkh@linuxfoundation.org, hverkuil-cisco@xs4all.nl, nicolas.dufresne@collabora.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v13 27/56] media: coda: Stop direct calls to queue num_buffers field Date: Thu, 19 Oct 2023 14:51:53 +0200 Message-Id: <20231019125222.21370-28-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231019125222.21370-1-benjamin.gaignard@collabora.com> References: <20231019125222.21370-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 05:55:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780188590881769588 X-GMAIL-MSGID: 1780188590881769588 Use vb2_get_num_buffers() to avoid using queue num_buffers field directly. This allows us to change how the number of buffers is computed in the future. Signed-off-by: Benjamin Gaignard CC: Philipp Zabel --- drivers/media/platform/chips-media/coda-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda-common.c b/drivers/media/platform/chips-media/coda-common.c index cc4892129aaf..f1d85758f6dd 100644 --- a/drivers/media/platform/chips-media/coda-common.c +++ b/drivers/media/platform/chips-media/coda-common.c @@ -794,7 +794,7 @@ static int coda_s_fmt(struct coda_ctx *ctx, struct v4l2_format *f, if (vb2_is_busy(vq)) { v4l2_err(&ctx->dev->v4l2_dev, "%s: %s queue busy: %d\n", - __func__, v4l2_type_names[f->type], vq->num_buffers); + __func__, v4l2_type_names[f->type], vb2_get_num_buffers(vq)); return -EBUSY; }