Message ID | 20231002120617.119602-45-benjamin.gaignard@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1510902vqb; Mon, 2 Oct 2023 08:40:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRA7o2Byv1N9SswYdNgWeUkqvt2xiYGYdGri2dTtSstwqHq136AN38OeddF1hPldznDrOa X-Received: by 2002:a54:4717:0:b0:3ae:5a09:9eb9 with SMTP id k23-20020a544717000000b003ae5a099eb9mr12850085oik.32.1696261224360; Mon, 02 Oct 2023 08:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696261224; cv=none; d=google.com; s=arc-20160816; b=LoFK6fQEZOJnCchWnjJugGBYce5Toci23Mu6zD/zfCl3hx7EIB3NcOPS35sp3mxWBG vnbLA8ld8Ppn91TCJYMNwtAsqQkU0GiYTVqX84dCnY4JZW/Y3XPJPDBb/aMxIXgKCLZy IVhTda5EkCuFy+Xoby3rBJrzuISB1gWv/FxDBOfFElrTXc+8iO6rm2vnytkiLPPOXCeT cA9fFitvUTi59Krb3EOwyCCis5tMOYn5ap7rE5wL66I1NMeH0L/Hjg0TweL6llfED/tg 0JKKiYTiZoIIQGPyiNGz+mfLVCelU6t9kwBby75T+zy88X/dVZXyjLJydLQ2ukzuX4az vMNw== 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=tmQ8B48fS653lsNUZPmdnMwdIC6Yd6jLqjKhmYRUJKw=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=dPitmpOj7H9PnMn++825FlTNztcYIVNh9U5Qv02O26///AFX1IwM1Fo1M7bVUGNKmK IQ+HFnLKEpQoB9HwUag6QLrPpPnaYA2vSnflYZ2PrSf6VW7JCvGs/KU063cNf9BPTW65 0V33HWDV4iyez45RWIAi4qSVcayxDunY72lvtBpks2vQmb12RHo2HJyWK1nixEICcKUR 7DsoCOs2FxBzT5BJajM0lqz3lHRx24a5LWzyc9FB7Cy01jo3rh16qlbwZgLfwojR8YVw dJ81ujS5QNjF4KVO4YI4iO/gvrMzygevv5pxHaEoLZwhC3NpxdN6utN6fVy2wulLn1bJ 8fUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=IwJTge2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id a1-20020a17090a8c0100b00274ac0df61bsi7851827pjo.122.2023.10.02.08.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 08:40:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=IwJTge2L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 955EA813A5A2; Mon, 2 Oct 2023 05:09:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237263AbjJBMIr (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Mon, 2 Oct 2023 08:08:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237133AbjJBMHB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 2 Oct 2023 08:07:01 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 937291AB; Mon, 2 Oct 2023 05:06:49 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:9537:67ca:c85e:d0ae]) (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 0DDBC6607388; Mon, 2 Oct 2023 13:06:48 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1696248408; bh=qUxQMObFxpiy3pFolAat/Lsgv4wZ2hZHcdle7SRl8Pw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IwJTge2L/P3ziSGIw+PX0oIbrMWIxPy+E8aTlnT0qvTXj4YqMEmlusgGfo1c/z6i7 b68TcDJOpNETsBlXk7gBjmGUG8RYEzUuBYhAsK2zf6kBj9wupKxJL909RV1N5R9v4v QJKYuOmj8dqVwaJh9mNDP1pnG0ug3pOdF6yjkol8BnP0VRb9ORA4oXuWuSDCyjWSNR Lpo0tUXk11qclAvkvznzqieCY0MKqXfYjuP63YKZo/LlquSG1YUlWf+H6rCBNn30Q4 76bsu/FE2zo7df8BN+FWmPBxSHJJ72TGgLp9f3cuDryQUNxv7z2Wezbl8XdZXB1KSw p907xEV5uGRQQ== 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> Subject: [PATCH v9 44/53] media: meson: vdec: Stop direct calls to queue num_buffers field Date: Mon, 2 Oct 2023 14:06:08 +0200 Message-Id: <20231002120617.119602-45-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231002120617.119602-1-benjamin.gaignard@collabora.com> References: <20231002120617.119602-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 05:09:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778658809372592537 X-GMAIL-MSGID: 1778658809372592537 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Oct. 2, 2023, 12:06 p.m. UTC
Use vb2_get_num_buffers() to avoid using queue num_buffer field directly.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
---
drivers/staging/media/meson/vdec/vdec.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 219185aaa588..1e2369f104c8 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -167,22 +167,23 @@ static void process_num_buffers(struct vb2_queue *q, bool is_reqbufs) { const struct amvdec_format *fmt_out = sess->fmt_out; - unsigned int buffers_total = q->num_buffers + *num_buffers; + unsigned int q_num_bufs = vb2_get_num_buffers(q); + unsigned int buffers_total = q_num_bufs + *num_buffers; u32 min_buf_capture = v4l2_ctrl_g_ctrl(sess->ctrl_min_buf_capture); - if (q->num_buffers + *num_buffers < min_buf_capture) - *num_buffers = min_buf_capture - q->num_buffers; + if (q_num_bufs + *num_buffers < min_buf_capture) + *num_buffers = min_buf_capture - q_num_bufs; if (is_reqbufs && buffers_total < fmt_out->min_buffers) - *num_buffers = fmt_out->min_buffers - q->num_buffers; + *num_buffers = fmt_out->min_buffers - q_num_bufs; if (buffers_total > fmt_out->max_buffers) - *num_buffers = fmt_out->max_buffers - q->num_buffers; + *num_buffers = fmt_out->max_buffers - q_num_bufs; /* We need to program the complete CAPTURE buffer list * in registers during start_streaming, and the firmwares * are free to choose any of them to write frames to. As such, * we need all of them to be queued into the driver */ - sess->num_dst_bufs = q->num_buffers + *num_buffers; + sess->num_dst_bufs = q_num_bufs + *num_buffers; q->min_buffers_needed = max(fmt_out->min_buffers, sess->num_dst_bufs); }