From patchwork Tue Oct 17 14:47:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 154327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4187596vqb; Tue, 17 Oct 2023 07:50:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpCp07p+Lc/vNDf/lHUs8KtGa+pqm1Wrq47dv0rtESI4hNuC39Jc3oQcbHv1EYKSzGZFxR X-Received: by 2002:a17:90b:3802:b0:27c:f653:37b2 with SMTP id mq2-20020a17090b380200b0027cf65337b2mr2601984pjb.1.1697554214461; Tue, 17 Oct 2023 07:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697554214; cv=none; d=google.com; s=arc-20160816; b=g8po/kva8pCZ2raYjKkuQZ6Q+7I5PVbFwdVceyHJ4RuCWRSdb2y2S/gCDZIiHFB4Vz FDq8kkVKVuwr66ug99TT1W1Rgo2SPCXflcQLr2ZV4+kWVOf9retKA73BfUStezSuxaTD LkIlYmkoqWfVpRsQQQjQ3tiNhT2oFi9PUbHvrZLrEeURlGzl2uPANWAgvOC5PRaoFR// n8LaPNipk8MWP/fBL0FbdWP+nN4jeNHRvyHwg8bCOGT12voynKRbJq9AH4m8NQtwDivo ajSCn2OBNLeistTvktON/VG//vPFh8d7igytT+lEX44kdqiY+2ExJx/c5Z6aYL/50Gpk rYoQ== 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=r6Eo2vRkhAxdOpYpqNbsdaTSx/y+NlSxqt8wWRoUchM=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=v0ir2Gzo8ujZt/nvc6uqZ+CekKNsQXy7rlugQguDIVkp2X+y/9T4/wUkjw6/iB3awl kY/sq0Pkr4Lf7nHyW13IiyH9ioGqtvDDN06ePP0I6k7VnFjtwxHq7MVZSP1yKJes1LZk XEoj2XCJyrcb/BNMDLtY0ZlOhFsgPiatRkFWtKE6Fo+bzoDsV5KVO1nG0KVeTEq96ajL Q0D78vepPuhaGml8T0glnUaxxNlOg9YWgCfAcKaLFgkpdedMAbXPr920k16BHpNd28Nn uiMkC2qYASJFacCm600iGe42HOVtTxxXK9Pd9G70UvsFqjWBpvkIXa0sHtZbQmVrk3tZ I7Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=N+CeSGxV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id hg17-20020a17090b301100b002775f7dbd79si1747547pjb.184.2023.10.17.07.50.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=N+CeSGxV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 3B08B8044352; Tue, 17 Oct 2023 07:50:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344508AbjJQOtY (ORCPT + 20 others); Tue, 17 Oct 2023 10:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344209AbjJQOs0 (ORCPT ); Tue, 17 Oct 2023 10:48:26 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21CC512F; Tue, 17 Oct 2023 07:48:19 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:7205:da49:a7e8:59f8]) (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 79C136607322; Tue, 17 Oct 2023 15:48:17 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697554097; bh=/dEmIdIJBXPR3lp68L0eO8Ks+TlFFI9ywnMWFSnMh5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N+CeSGxVGpilyS+eYAD3rNm3nqwbVoBc+iuKh+sCyXkkQK3W+dOC8G1mJ/qtF9AOd sPu9Jc9gHHpVW5IcYiomB1lLQEDCqU+Mo7IK1uYN/tBXXr5aXiFdCbh04rde8gbqWg rOIm0K3O4/Xh4Bd6snBfxXs6aLlfRIumD1HSbsxy20RTjTbx74fQu22Yq0TwS2MZaM ezz5C2dezU6iIL6wobIlSmLs5diDGy124WjJ/wLguhIoS2GKOtHdU/LO2NvKdVV99x zuheO+ACvn6U07LZlsdTVm5+CN82ScwojLxX2kA0wmbjP9zy+OZbPBxLcACv0Nxfy4 4iLb9jbV1mUbw== 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 v12 27/56] media: coda: Stop direct calls to queue num_buffers field Date: Tue, 17 Oct 2023 16:47:27 +0200 Message-Id: <20231017144756.34719-28-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231017144756.34719-1-benjamin.gaignard@collabora.com> References: <20231017144756.34719-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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 07:50:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780014608406212602 X-GMAIL-MSGID: 1780014608406212602 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 futur. 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; }