Message ID | 20231109163512.179524-14-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp558490vqs; Thu, 9 Nov 2023 08:38:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IENJ3aCKt+UrlWKCiHUizMzsi9A7lJBFf9V9fdirinaUyq4UkiErzEACTIatt43TyCEIZD4 X-Received: by 2002:a05:6a20:12c1:b0:17f:cf8e:241e with SMTP id v1-20020a056a2012c100b0017fcf8e241emr5956101pzg.41.1699547888119; Thu, 09 Nov 2023 08:38:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699547888; cv=none; d=google.com; s=arc-20160816; b=tJUAVzb8LTgk5XRK1d/Mghd9vrPBwMgmfQYFfsthbITu01Qpg5RjS/FG5fUOJLgG86 0k8mJ3fKIVL/pyZjWc8iRkgAbsVijKdb3sLVTra5fAZtT5Eku4z3PjGjSL0tuaP5bGbL LE1wf0s687/+zKNf94eShmiEFSgOJQFAvcGvkdWBbvyGy11FYaGBoyMImvHRu2jGH9qB ka3k7eCHwOoa6/MZl6z8kgboxgjTaaHUG4/js7ZG5wK5VP0fw1KJ5YvBdpL7Dgxj2hn6 V+z6T48LHpgXP2+20Q0feMtWMz718yYtsyCNPOOWQnITr5hgTVItX9xx5jXhFCXgCYz4 3vdA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lLJUuvBHbr4mFsWTFdO7lQHItFomQmd5IiMt+wiaXdo=; fh=TmD+hhsp9BmE1gM0frR1Tlg23bmw2sQ+w3SEIAdpcT8=; b=uRk+2ehIm0QLBE/k0ThDfSTchwY9yI02XcYvgLTmOFcuOBTrTYVUhhMhmrKTSnBcJ5 lNErEhJWBIu+anPMwVQG1NhSckiJLSWs+cKK1/EoHtmDqQKIg5wuVm203XJRhLrirEmN 2fjBJ01v0E7Xi9c/dh7h0UMcEbQqy4dFcO5NJ5QJl+Zd68WHoJ/dB6Dfh/C2/4dloG0s G3hylacllpUd2YEVD0yver6iTXEBxfjWBxYp5JRHZYdDLj9eNCciUFeYXh0Vb10qURXB bOcdMyiDZYjg536T1RiuUC72boNvzWqwVs7FnjzajBYVdZ70KpQISei+V+vj6/0TTA/7 /onA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aDfPjorO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id o10-20020a170903210a00b001bde9e8a29fsi5008753ple.183.2023.11.09.08.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 08:38:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=aDfPjorO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 8D97A8179129; Thu, 9 Nov 2023 08:38:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344139AbjKIQhj (ORCPT <rfc822;lhua1029@gmail.com> + 31 others); Thu, 9 Nov 2023 11:37:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344109AbjKIQhh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Nov 2023 11:37:37 -0500 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 D356F35BD; Thu, 9 Nov 2023 08:37:35 -0800 (PST) Received: from benjamin-XPS-13-9310.. (cola.collaboradmins.com [195.201.22.229]) (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 6F080660740E; Thu, 9 Nov 2023 16:37:33 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699547854; bh=BwR4s4ywbEfCHkutA+4CwFbD89uhH72hhYuaRdTzP+g=; h=From:To:Cc:Subject:Date:From; b=aDfPjorOLUWVabpROtXCg4Xu6N3BBSN7dUiY0wR3cycYRdydZvHBo7BW02FrbdYEK acdwmmniNSsVc6bjJwuttViRkO9CK1SyX71TJuKiPsJO2DuRemPsKzUwqh9LxaATma Je9QRiVag5JxtFZAXb5LtlH3TIbQIOGvQas2UBkW4yXCHB8qbKN5GH1OxxQjJDOXH6 eN27uBtJNj93vS/+wNaHewgrqCuYgciAarkWQQc26Tamz8cE3t7kWm7yrOLUcl/QG3 f4KAuPPwJXjZvh2a6FpieTnRzniB4XabH04EDzCde0dKao+kH1PcoI547raGdgrP2w DjkRyv+cTT9wg== From: Benjamin Gaignard <benjamin.gaignard@collabora.com> 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 <benjamin.gaignard@collabora.com>, Andrzej Pietrasiewicz <andrzej.p@collabora.com>, Bin Liu <bin.liu@mediatek.com>, Matthias Brugger <matthias.bgg@gmail.com> Subject: [PATCH v15 13/56] media: mediatek: vcodec: Stop direct calls to queue num_buffers field Date: Thu, 9 Nov 2023 17:34:29 +0100 Message-Id: <20231109163512.179524-14-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 09 Nov 2023 08:38:00 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782105126190021328 X-GMAIL-MSGID: 1782105126190021328 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Nov. 9, 2023, 4:34 p.m. UTC
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 <benjamin.gaignard@collabora.com> Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> CC: Bin Liu <bin.liu@mediatek.com> CC: Matthias Brugger <matthias.bgg@gmail.com> --- drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c index eb381fa6e7d1..181884e798fd 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c @@ -912,7 +912,7 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count) return 0; err_start_stream: - for (i = 0; i < q->num_buffers; ++i) { + for (i = 0; i < vb2_get_num_buffers(q); ++i) { struct vb2_buffer *buf = vb2_get_buffer(q, i); /*