Message ID | 20230914133323.198857-32-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:172:b0:3f2:4152:657d with SMTP id h50csp365773vqi; Thu, 14 Sep 2023 06:58:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+IYE3FcUKUaa67YJd2G/aF/F0OTPPbZaCsCor518Q8CUSq4zn3lSBxMoT8vqemoIZTF5S X-Received: by 2002:a05:6358:2512:b0:142:efb8:5295 with SMTP id m18-20020a056358251200b00142efb85295mr1926680rwb.19.1694699882080; Thu, 14 Sep 2023 06:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694699882; cv=none; d=google.com; s=arc-20160816; b=J5p7sn8A4PoRAOD/3syZkywWlKMOLv2zXOfjGLXVKzqsIMcPRNqdxdgllq6VtDAh7b jh5b7U8M0Swz5H65CBYynXtby/yi24JByGA/6EfUY0/81IVjfutae1RyywE+Jv7hoYDh t0U3LcIVPJqBoS0wj3eUp1853Xzr42Jr10xGON75rmqdDo/sb8riYHenm4Tg41GFMLvf OdRQwj8bXEGRic46UZZ4xJU/5JXFxVhFLg4nR/qHDP1o4CeSWUKF/b1e3/REZZf3fUhT 7yPhjRB1rkx+oqlG9eDXVbVcfG+UTt0Ly3Zk+aCNqBWtfdsi5lvet2a7AT3taZ83JeOJ go1A== 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=oTtmKjE7vQhNKhTumrx56oub9WvRubSN6lcnNjeiil4=; fh=ceA81l8d2hZW6pWH7VE5TwJxtgXUzAubfWIMcikPA1M=; b=fekf+GVvpzpP2WqXvCSBwSN6hXLVjYq8XKJyy1Q5OsvIHWKiLUhns92Co9iyBNHRQT HmCUVCW1P2mNrJdraMP8nshlN5dK1H2SuAxaPp9El8RE7pIY0FOzg4TVeLBc9NPWSzOt 21l2Hh6hlUsiqTFqbVOm/Wj2aaKHhdbW42LO0mnXFl1zEirkJk+vjuoIFNwHn1qpkcxQ ORF0bck2faiBVTAyKGnhCxw+3Et0f1ptPYRpfW8GvOL9cPhFekdP+H8k8W9fmUfOvgkK YQSt4tD9Ki2V/gVSY+jgpV3U6mkqSkJopT/1yXE+5lEn/XyYYpjFe+CcaiWSNDif6rSo qHNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="BW/4Li6K"; 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 az1-20020a056a02004100b0057745d87b53si1515917pgb.686.2023.09.14.06.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 06:58:02 -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="BW/4Li6K"; 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 2E3698705EAE; Thu, 14 Sep 2023 06:35:07 -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 S239877AbjINNe5 (ORCPT <rfc822;chrisfriedt@gmail.com> + 35 others); Thu, 14 Sep 2023 09:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239444AbjINNeL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Sep 2023 09:34:11 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F662137; Thu, 14 Sep 2023 06:33:48 -0700 (PDT) Received: from benjamin-XPS-13-9310.. (unknown [IPv6:2a01:e0a:120:3210:36f2:37bd:ccbb:373f]) (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 553316607382; Thu, 14 Sep 2023 14:33:47 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694698427; bh=cXivZNqToe41YcZuXIOZnOz7dFiXtOZiRZUwxPYGOCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BW/4Li6K5XG6+3vbXDnIR7ChVsl6ZXW8TLElpv89AbHI8KTYjXFsrimfikBDy3zpD 5yeVs584mxICnpxmqLwLwpDIlut30f3mPncqh1kmfrMch623WJsC0kxkJkCkhQUsI1 l2xPjcNq/AQsUJKsz62nZwvcK9WUJfRVElhEI4BS3dCRzTxJtt9dzb3wCP1UDPInax I8NPTG3IZ9ZAXYa7ukFtL19FCGjYbh6Z8Acdkxvi5wmEkzQbtcucrmE3J2E+NALG1H vzxl3c6XqyR4qOAjjgUgoqNg5hReh+N4/lV4sqBQICAWvk/ZxFzub6griqozOykHD/ V76u5/javVwJQ== 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 v7 31/49] media: nxp: Stop direct calls to queue num_buffers field Date: Thu, 14 Sep 2023 15:33:05 +0200 Message-Id: <20230914133323.198857-32-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230914133323.198857-1-benjamin.gaignard@collabora.com> References: <20230914133323.198857-1-benjamin.gaignard@collabora.com> 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 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 06:35:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777021623516260375 X-GMAIL-MSGID: 1777021623516260375 |
Series |
Add DELETE_BUF ioctl
|
|
Commit Message
Benjamin Gaignard
Sept. 14, 2023, 1:33 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/media/platform/nxp/imx7-media-csi.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index 15049c6aab37..4c467fb82789 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1245,6 +1245,7 @@ static int imx7_csi_video_queue_setup(struct vb2_queue *vq, struct device *alloc_devs[]) { struct imx7_csi *csi = vb2_get_drv_priv(vq); + unsigned int q_num_bufs = vb2_get_num_buffers(vq); struct v4l2_pix_format *pix = &csi->vdev_fmt; unsigned int count = *nbuffers; @@ -1254,14 +1255,14 @@ static int imx7_csi_video_queue_setup(struct vb2_queue *vq, if (*nplanes) { if (*nplanes != 1 || sizes[0] < pix->sizeimage) return -EINVAL; - count += vq->num_buffers; + count += q_num_bufs; } count = min_t(__u32, IMX7_CSI_VIDEO_MEM_LIMIT / pix->sizeimage, count); if (*nplanes) - *nbuffers = (count < vq->num_buffers) ? 0 : - count - vq->num_buffers; + *nbuffers = (count < q_num_bufs) ? 0 : + count - q_num_bufs; else *nbuffers = count;