From patchwork Mon Dec 4 13:22:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478380 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="LGuCyNM5" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9758295; Mon, 4 Dec 2023 05:23:36 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 E91DF6605835; Mon, 4 Dec 2023 13:23:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696215; bh=/jXOJsw0p75OXpH12qRqf2mFFTImN471wSEgNYwBmG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGuCyNM5hcxzCsRTiYNtAcnlFtm2LTROFeLGFP+16aozE/clXAf370U6xBkhRtOhe uSGmSVWUvaRyW4Bil7+Jh5PX2e9pny6Is9oMmv1FoS0skDmPZXX+6srUwjZni61EeU Y9j+C0RIicWsyX0uQCVCWj3DEi8dFOC2LlHjv2nRMfioCdoTSpRYI3M6GHKuvpPpVG O9G9QhUfr8v6o6LkctQt9NPED5klHsOVoGbB6HysCFy5Z4/Ae7aPM3J/tZKHEERrsY bQf0WWOelyNfruoqU3vMI4M9TxoEnszzW5QCT6RzlBW9HgHoIeO0+2ENgTi5kNqmnu yWShit1oxBLUQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 01/36] media: usb: cx231xx: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:48 +0100 Message-Id: <20231204132323.22811-2-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard --- drivers/media/usb/cx231xx/cx231xx-417.c | 1 - drivers/media/usb/cx231xx/cx231xx-video.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 45973fe690b2..24c94cfb5268 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1782,7 +1782,6 @@ int cx231xx_417_register(struct cx231xx *dev) q->ops = &cx231xx_video_qops; q->mem_ops = &vb2_vmalloc_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 1; q->lock = &dev->lock; err = vb2_queue_init(q); if (err) diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index c8eb4222319d..ce44114e2188 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -1811,7 +1811,6 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) q->ops = &cx231xx_video_qops; q->mem_ops = &vb2_vmalloc_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 1; q->lock = &dev->lock; ret = vb2_queue_init(q); if (ret) @@ -1871,7 +1870,6 @@ int cx231xx_register_analog_devices(struct cx231xx *dev) q->ops = &cx231xx_vbi_qops; q->mem_ops = &vb2_vmalloc_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 1; q->lock = &dev->lock; ret = vb2_queue_init(q); if (ret) From patchwork Mon Dec 4 13:22:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478382 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="e4isb/PH" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88880D2; Mon, 4 Dec 2023 05:23:39 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 DB358660711D; Mon, 4 Dec 2023 13:23:37 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696218; bh=SGWc3SJhUtEriZPP5qupv/R50VZL3SHH8MYp7sJ69S4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e4isb/PHzPqbYTiDeO0t2dgjXId0TEpiepai054+cSFHueB9PjmQG14sNxwrOoL9y Jale9GU8xk5ZPILkf7eoZoxxGaWFjgBq5g2Xo7+42VAtB7SaOSgSy6mUO/5Y/3UBU3 tsmO+daHgh4NxoiuI/65um63McMKYsRsKB1grdewU6f1qtNirrqzzh35/ikYuN0uVL oR7seZX2nKDzLe5KG8WNfoasMFnCZ2JXzoI4kqrtAnKtcx66EkvR7pSQhovGJYFbEa e9yMzJUFaVyHFMp957ZfjTgr7XExwyQm0AlNDS5BXt1NYWcRUAef17zP7J4w26aHIJ VtJcwuMYLAzTg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Philipp Zabel Subject: [PATCH v2 02/36] media: chips-media: coda: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:49 +0100 Message-Id: <20231204132323.22811-3-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Philipp Zabel --- drivers/media/platform/chips-media/coda/coda-common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index f1d85758f6dd..d5529f988d2c 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2546,7 +2546,6 @@ static int coda_queue_init(struct coda_ctx *ctx, struct vb2_queue *vq) * would need to be reflected in job_ready(). Currently we expect all * queues to have at least one buffer queued. */ - vq->min_buffers_needed = 1; vq->dev = ctx->dev->dev; return vb2_queue_init(vq); From patchwork Mon Dec 4 13:22:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478383 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="c8OUxYNU" 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 09020AC; Mon, 4 Dec 2023 05:23:41 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 29BB566071EF; Mon, 4 Dec 2023 13:23:40 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696220; bh=K4kc6aE30aNr8fEMgPpgyQo0QhobUXDuFfbQVHAZRG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c8OUxYNUoNxpwYJm3Jv1Eccbec9duUXulRVJcZPfah9Ps5AxoQrGTqY9Nv/rDIkZd h62H0JaJhtnjssg41JXC9W5DGjCMj5BWY5sTBh92Kxnf/sG7jvw7G1D01v5iRYpRmN WO0axwUsNrncXkx+FahUSDNjJwJZAB9tU6slULf7AkaH68Vrpk/6c7Ex54bQIp1WUl byfVGg/mOmQDngw1WY0Vv2857SGk0e4dvCarAKy2h9qn9Y8HkKjrvN8AJj7KLwcqjr HluZdiPgsWptSJVBwv7eDhx6XB3H7nY2DlEwiy/w48o+9fnOc2O+zgD7lC9Vu3JnH8 JCCiULoihos1Q== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Eugen Hristev Subject: [PATCH v2 03/36] media: microchip: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:50 +0100 Message-Id: <20231204132323.22811-4-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Eugen Hristev --- drivers/media/platform/microchip/microchip-isc-base.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/microchip/microchip-isc-base.c b/drivers/media/platform/microchip/microchip-isc-base.c index 3fba0e2844b6..63c39981f47a 100644 --- a/drivers/media/platform/microchip/microchip-isc-base.c +++ b/drivers/media/platform/microchip/microchip-isc-base.c @@ -1821,7 +1821,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &isc->lock; - q->min_buffers_needed = 1; q->dev = isc->dev; ret = vb2_queue_init(q); From patchwork Mon Dec 4 13:22:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478384 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="YPPjIMOu" 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 1D1FDF3; Mon, 4 Dec 2023 05:23:43 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 1A05C66071CC; Mon, 4 Dec 2023 13:23:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696222; bh=vUKzmdehCfLCcwbM7gaKkVboVYXsxqKFA6kaBbI0L2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YPPjIMOunjZNuH8fAjPP3b4mSMCV/NHPckS3LjK+bXSYdCykIk5tD/FGV9U+H/5BR m01dBoNIjvgtGuQ3gycq515tlISsPaWjtLe1l1HCvCUuzbKHYMfRmzn1Yqf2oUMFFo UnOxQa3CzjSVhOlkDrK40q/eNTj9/3QcyAcxPhfgEdavnwo7rrJTEAPLUdGnN5gnbG ia8NC9nuPQbrn98fm+9YJKNZrlzbyIh+IT2bAQClJ7hgJqqvN08+t5efAoom6JLvXd 0Vog+unbItWp5hnYhKxsWoojzQY0GHbQ2HcPaVEYfjhxYGUM/gMewLLC0a6GDP+R3m Tq0BN32TcXvRg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Ming Qian , Zhou Peng Subject: [PATCH v2 04/36] media: amphion: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:51 +0100 Message-Id: <20231204132323.22811-5-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Ming Qian CC: Zhou Peng --- drivers/media/platform/amphion/vpu_v4l2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c index 87afb4a18d5d..a80c5f28c659 100644 --- a/drivers/media/platform/amphion/vpu_v4l2.c +++ b/drivers/media/platform/amphion/vpu_v4l2.c @@ -649,7 +649,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q src_vq->mem_ops = &vb2_vmalloc_memops; src_vq->drv_priv = inst; src_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer); - src_vq->min_buffers_needed = 1; src_vq->dev = inst->vpu->dev; src_vq->lock = &inst->lock; ret = vb2_queue_init(src_vq); @@ -666,7 +665,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q dst_vq->mem_ops = &vb2_vmalloc_memops; dst_vq->drv_priv = inst; dst_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer); - dst_vq->min_buffers_needed = 1; dst_vq->dev = inst->vpu->dev; dst_vq->lock = &inst->lock; ret = vb2_queue_init(dst_vq); From patchwork Mon Dec 4 13:22:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478385 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="RQhD8+PK" 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 A7807C4; Mon, 4 Dec 2023 05:23:46 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 BFC276602026; Mon, 4 Dec 2023 13:23:44 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696225; bh=Dywo70CQG363NbYL8uLIRlzPbx56pDtvUEKi675FEes=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RQhD8+PKDoxYdoPM4Ao1lagEw4nKvvEQJorzb4rCzzTZtgUARwzbUeralYHdgJu0j lN9R+DCAN7FbZamZnn+YIJvE/IbgyM/egma+s9RcVmF+w07BkZQvseYPKntPS+Zvyt YDMD/Lwx+Kp/xMe9H7361+qBQHdt+KU7ZLVeAZ9WvkJi8/cBmG78hFKTteBWQIwkxR 6mDdqwHuNIk7UceZdtv8j35Br69iXMeWZkJPvPQvtoSpeVP5D5O0MDQdfZ93S9hbeQ zPDyOACJlcJaQiZrwCmPPdAp7vocEuT7RHlYOj+z81pUm2P6jisNZD/eJlb8og+0yZ 9OLTh1x4wHtZg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Stanimir Varbanov , Vikash Garodia , "Bryan O'Donoghue" , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org Subject: [PATCH v2 05/36] media: qcom: venus: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:52 +0100 Message-Id: <20231204132323.22811-6-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Stanimir Varbanov (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) CC: Vikash Garodia (maintainer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) CC: "Bryan O'Donoghue" (reviewer:QUALCOMM VENUS VIDEO ACCELERATOR DRIVER) CC: Andy Gross (maintainer:ARM/QUALCOMM SUPPORT) CC: Bjorn Andersson (maintainer:ARM/QUALCOMM SUPPORT) CC: Konrad Dybcio (maintainer:ARM/QUALCOMM SUPPORT) CC: linux-arm-msm@vger.kernel.org --- drivers/media/platform/qcom/venus/vdec.c | 2 -- drivers/media/platform/qcom/venus/venc.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index dbf305cec120..8bdffe546219 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -1641,7 +1641,6 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->drv_priv = inst; src_vq->buf_struct_size = sizeof(struct venus_buffer); src_vq->allow_zero_bytesused = 1; - src_vq->min_buffers_needed = 0; src_vq->dev = inst->core->dev; src_vq->lock = &inst->ctx_q_lock; ret = vb2_queue_init(src_vq); @@ -1656,7 +1655,6 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->drv_priv = inst; dst_vq->buf_struct_size = sizeof(struct venus_buffer); dst_vq->allow_zero_bytesused = 1; - dst_vq->min_buffers_needed = 0; dst_vq->dev = inst->core->dev; dst_vq->lock = &inst->ctx_q_lock; return vb2_queue_init(dst_vq); diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 44b13696cf82..f2e6bd44ed15 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -1398,7 +1398,6 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->drv_priv = inst; src_vq->buf_struct_size = sizeof(struct venus_buffer); src_vq->allow_zero_bytesused = 1; - src_vq->min_buffers_needed = 1; src_vq->dev = inst->core->dev; src_vq->lock = &inst->ctx_q_lock; if (inst->core->res->hfi_version == HFI_VERSION_1XX) @@ -1415,7 +1414,6 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->drv_priv = inst; dst_vq->buf_struct_size = sizeof(struct venus_buffer); dst_vq->allow_zero_bytesused = 1; - dst_vq->min_buffers_needed = 1; dst_vq->dev = inst->core->dev; dst_vq->lock = &inst->ctx_q_lock; return vb2_queue_init(dst_vq); From patchwork Mon Dec 4 13:22: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: 13478386 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="DRrAzwNQ" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9A92D2; Mon, 4 Dec 2023 05:23:48 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 275526602020; Mon, 4 Dec 2023 13:23:47 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696227; bh=jON8BOdCAHEK/Xd0Dl3W1Jb3UXgsTiGXSbXsYdLJdIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DRrAzwNQiG4aTqwGt24i0ROd0oGyvYIvQoLFxdhV2VVgvYsljYfEhYcQkBslVXJig ZSEOGDiKkbaKKqcfCpQsALuYmKrRM6y9U9ZTrKCpTvLi+/vIBEdDcE3xTiRvzTO/Lh d7Ngg6cYlsOqWbNqxL0N4oxbdBCnE68dzmZkAWfewpr22zpU9Z2K5jAuajOlnyj5ZS bNHQuVPYCMi1o16ue5fP/0IY9xUdvQIEmC0C2WTNaGdkeNDB9nL12p5D15uE/ixo2i vwbFEwI5bya62nzVGDU1WcTBJo2a+38rG0nvQUeCy9MEyQ76ao8B2lIuN88juzYftp WglNxhx/vKSbw== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 06/36] media: i2c: video-i2c: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:53 +0100 Message-Id: <20231204132323.22811-7-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard --- drivers/media/i2c/video-i2c.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index ebf2ac98a068..8d7f01b50aa7 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -795,7 +795,6 @@ static int video_i2c_probe(struct i2c_client *client) queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; queue->drv_priv = data; queue->buf_struct_size = sizeof(struct video_i2c_buffer); - queue->min_buffers_needed = 1; queue->ops = &video_i2c_video_qops; queue->mem_ops = &vb2_vmalloc_memops; From patchwork Mon Dec 4 13:22:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478387 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="FZw6LLkP" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD15510E; Mon, 4 Dec 2023 05:23:50 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 2AEF06607090; Mon, 4 Dec 2023 13:23:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696229; bh=b75WmWdAC31wYaSj8EBGol+3A1YhixNlBQKHyIrP9VU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZw6LLkPRHbExevSYSoH3pN3MBxZ7bW7Aw6MEyb4D/Fu0G8RD9H43mXqdqXqWmodr T/PtPCwwHCegixiV3VWHttC6gwCy5ko2iKNOjWbCXWE6hnyFAdSCpHyhUhQhSTyVrh mSjaKvufxbrIDjYSr5SXOLOx8GYv4bTPnGutkjZMYBIfB7B0RrdbQH7uBkytjbJa+Q DZPEfVsQTUK64laJ6Gi4X5t+rIP7cpN/h8C6QQ1eDMmWGaIO6aRrJzKa9BMU7byIGK 7+OP5AbdnJEi009Q2SQXoGCDl2y5PNLyRuLOjnuLZ/My4T0FPNYhOXTXShUhOs5tFl sOLBbYrysVCQQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 07/36] media: dvb-core: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:54 +0100 Message-Id: <20231204132323.22811-8-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard --- drivers/media/dvb-core/dvb_vb2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/dvb-core/dvb_vb2.c b/drivers/media/dvb-core/dvb_vb2.c index 167ff82a6fed..54a3649d8424 100644 --- a/drivers/media/dvb-core/dvb_vb2.c +++ b/drivers/media/dvb-core/dvb_vb2.c @@ -171,7 +171,6 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking) q->io_modes = VB2_MMAP; q->drv_priv = ctx; q->buf_struct_size = sizeof(struct dvb_buffer); - q->min_buffers_needed = 1; q->ops = &dvb_vb2_qops; q->mem_ops = &vb2_vmalloc_memops; q->buf_ops = &dvb_vb2_buf_ops; From patchwork Mon Dec 4 13:22:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478388 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="DQGdEJLn" 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 ED6A9191; Mon, 4 Dec 2023 05:23:52 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 1AFAC66071CC; Mon, 4 Dec 2023 13:23:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696231; bh=6AlqOx+FFImcfZDLMEeEUovXA4Sft7cnaCjngZduvsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DQGdEJLnbAtvICwkzkiwILiCu5IFwCGI3sKELOnaQ4qA6uN+I1q949usc+7kddK47 1T1h+qb9y7tP7O6BmnN0dyLk7S3GuIlq0TUdEhECJt6//xOlguCvaPsCk1/urrQFuR A99ucfpNWRhBfrlpWCNn7I5kMJPhas7NFwhwsNDNXTyWFGcSnK5yCsCPB7r7CTwIjw YahM0Wd0SKKbJ5Z8RPCSvfej+gFaQMyS4JiQ+wy4p72PPBDUwCy5fcg1TzA/jjstM2 8yf1cVzOjIFQyWvlUv9KRj+Tx9paigAZMVKsM8YhFY9kAVp+4hTyzakBXHulctGw43 ROG7G9CFiDylg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Eugen Hristev , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Subject: [PATCH v2 08/36] media: atmel: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:55 +0100 Message-Id: <20231204132323.22811-9-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Eugen Hristev CC: Nicolas Ferre CC: Alexandre Belloni CC: Claudiu Beznea --- drivers/staging/media/deprecated/atmel/atmel-isc-base.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c index 468568b5bb7a..c18f3ba5ae1a 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c +++ b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c @@ -1871,7 +1871,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &isc->lock; - q->min_buffers_needed = 1; q->dev = isc->dev; ret = vb2_queue_init(q); From patchwork Mon Dec 4 13:22:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478389 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="fpiHlguw" 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 D71151B8; Mon, 4 Dec 2023 05:23:54 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 0085F6607090; Mon, 4 Dec 2023 13:23:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696233; bh=oOWz24gQ5YvCYqxsrt9/vTKzJDstMTwD0f8jUu4NRTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fpiHlguwrMYeN1mEYBkELVL33tKiT1KR1nwYsrEn7jLbmYp4MWuEE2MQQ89kigGaS yiQkxZn5OjeQE6coLIgMLBpL6BUnC8Hxzlg44paOrvCSuKR3YBpPHmPc9zkaHWY4NV vU6EeU0+6cVc/8WmEtol8w1LDdFE6uEA5k4yN+zchWyxCK+X+OI/A3ozs8+fJ3hmBK ZixewklE7l4VrRbXm1HKQs4N/xwTNfA7icvXNmILAHbE4B/dBzM3N+zDaeAmIwEckF GmmQriTDYBxHDpJi4NRMUBVg+itb6l75/d9niz8NrIf3jmVvYh+2SxyAnz1VXzBgx/ inX3JLYW+QaSg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Sakari Ailus , Bingbu Cao , Tianshu Qiu Subject: [PATCH v2 09/36] media: ipu3: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:56 +0100 Message-Id: <20231204132323.22811-10-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Sakari Ailus CC: Bingbu Cao CC: Tianshu Qiu --- drivers/staging/media/ipu3/ipu3-v4l2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/media/ipu3/ipu3-v4l2.c b/drivers/staging/media/ipu3/ipu3-v4l2.c index 0fe2b858da83..7f9104411edc 100644 --- a/drivers/staging/media/ipu3/ipu3-v4l2.c +++ b/drivers/staging/media/ipu3/ipu3-v4l2.c @@ -1197,8 +1197,6 @@ static int imgu_v4l2_node_setup(struct imgu_device *imgu, unsigned int pipe, sizeof(struct imgu_vb2_buffer); vbq->buf_struct_size = imgu->buf_struct_size; vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - /* can streamon w/o buffers */ - vbq->min_buffers_needed = 0; vbq->drv_priv = imgu; vbq->lock = &node->lock; r = vb2_queue_init(vbq); From patchwork Mon Dec 4 13:22:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478390 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="R1cyr0Cz" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55E94D4B; Mon, 4 Dec 2023 05:23:56 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 A5222660711D; Mon, 4 Dec 2023 13:23:54 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696235; bh=INhnWKxfeyDOt5+MSDz9mj1pvx9+8U4kzLbB8RirFts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R1cyr0Cz6N9zmXvAIXxoYllx2wyLKTZZi4UYPUCpchQiqpZuk7NPNTzz3K3ba6nGW U65GelxmN6oDuAemsPWzYSVsdMZ5L5VpLjLgHzafY7hXTt1Bfd6rpAJ3+OMe0nAhSV LvPfgrilMfXz+gqfJCoeX4RMCHXmpkC2oC/mSQkTw8iCrgP3KTz2BTKby2C0kBTPeo /iRGBvglcJwdnpUDyyTsp0gY1cdgwlANhHhT2akrKRbVaNGNQpVicR/3xKaXRDAn9E qcYRl+2pZAfgnqhozV1MrzMUmc/9uk/eCDUre8aw4G14HthQUetSCFgnjGchc2GRhl rHRWGCFHaQ1cg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , "Lad, Prabhakar" Subject: [PATCH v2 10/36] media: ti: am437x: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:57 +0100 Message-Id: <20231204132323.22811-11-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: "Lad, Prabhakar" --- drivers/media/platform/ti/am437x/am437x-vpfe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/ti/am437x/am437x-vpfe.c b/drivers/media/platform/ti/am437x/am437x-vpfe.c index f18acf9286a2..228920450e7a 100644 --- a/drivers/media/platform/ti/am437x/am437x-vpfe.c +++ b/drivers/media/platform/ti/am437x/am437x-vpfe.c @@ -2234,7 +2234,6 @@ static int vpfe_probe_complete(struct vpfe_device *vpfe) q->buf_struct_size = sizeof(struct vpfe_cap_buffer); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &vpfe->lock; - q->min_buffers_needed = 1; q->dev = vpfe->pdev; err = vb2_queue_init(q); From patchwork Mon Dec 4 13:22:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478391 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="N7fNBL9W" 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 5B9CFD53; Mon, 4 Dec 2023 05:23:58 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 A7D4266071EF; Mon, 4 Dec 2023 13:23:56 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696237; bh=Kzbu88ymNE025HOjKsO2ioiaZkYT4loaGy3sxXF5Jh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N7fNBL9W3ILAxin0faA1PBv6kx9Wrh3q/TLE4wNhnRAWPdOIovKNoyI2jhIuGe0UO YLuC8F5+L3sie6Ixv/dHLKQ7sDR3v3jdAo3XWeACLcjufdTIYs6Ipz0OdqSl71VP3O wa45Wm3FByeutiCzCvLMbm0QRzbjcTefLTkTg3mdRJe8ZSPqbjl7jqb4Cnvjaj1kex vi16BwcafFI0QdSjLXA0KwPqXoqy4r+VIdVo+UjVd4FNnbo5hDx3sI6OIqpJh2etrE i1FRvrN2NJrxcytzbWsv0LpoTPU8cJAeP/SGewepKSzxQyMOMp+vgtj19VoxhwTClr T3+BmWWdU0DeQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , "Lad, Prabhakar" Subject: [PATCH v2 11/36] media: ti: davinci: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:58 +0100 Message-Id: <20231204132323.22811-12-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: "Lad, Prabhakar" --- drivers/media/platform/ti/davinci/vpif_capture.c | 1 - drivers/media/platform/ti/davinci/vpif_display.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c index fc42b4bc37e6..300c3cb5cbed 100644 --- a/drivers/media/platform/ti/davinci/vpif_capture.c +++ b/drivers/media/platform/ti/davinci/vpif_capture.c @@ -1429,7 +1429,6 @@ static int vpif_probe_complete(void) q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct vpif_cap_buffer); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 1; q->lock = &common->lock; q->dev = vpif_dev; diff --git a/drivers/media/platform/ti/davinci/vpif_display.c b/drivers/media/platform/ti/davinci/vpif_display.c index 9dbab1003c1d..d45391a4d8f2 100644 --- a/drivers/media/platform/ti/davinci/vpif_display.c +++ b/drivers/media/platform/ti/davinci/vpif_display.c @@ -1169,7 +1169,6 @@ static int vpif_probe_complete(void) q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct vpif_disp_buffer); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 1; q->lock = &common->lock; q->dev = vpif_dev; err = vb2_queue_init(q); From patchwork Mon Dec 4 13:22:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478392 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="iGgq6AMr" 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 5A1EE187; Mon, 4 Dec 2023 05:24:00 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 4DE0A6607090; Mon, 4 Dec 2023 13:23:58 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696238; bh=JC1ApPThEFi+YkEPaYavKRjqsYCfmAjyWnjgDZQA57Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iGgq6AMrz/K6w72xKTX2JlOjH5fAYO4VyU8r4gTG5zhCF9vZdh6XfNr7UqL5sAOp+ yig/ihVATezjkLt35itsHyTI3bHdGtrz/yDhtV6el27SDNamXMZW2RRZY41roQKKfv 1A6dXuesJNJnxiORpnVTE4QphvJNAi7d9+PTRsjFzmINtILg7Tb8DttYbxf7wA7nLj KOoB2tIV47W8mplraKZ8dMwpJQgE6nfC/T+1FWJy0S1ka8vPd/Ub1QZRuYPuHUayi1 mhVdCzArsjjHnVtif3FbIfedLSRlNvIGwT6Hayo1bAFyJDDH/BLdL6KxhSFf8DdvsW LRbO4121PBseA== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Nick Dyer , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH v2 12/36] input: touchscreen: atmel: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:22:59 +0100 Message-Id: <20231204132323.22811-13-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Nick Dyer CC: Dmitry Torokhov CC: linux-input@vger.kernel.org --- drivers/input/touchscreen/atmel_mxt_ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 20094b9899f0..d98cf9560511 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2546,7 +2546,6 @@ static const struct vb2_queue mxt_queue = { .ops = &mxt_queue_ops, .mem_ops = &vb2_vmalloc_memops, .timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, - .min_buffers_needed = 1, }; static int mxt_vidioc_querycap(struct file *file, void *priv, From patchwork Mon Dec 4 13:23:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478393 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="IKAhwex1" 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 89F68D60; Mon, 4 Dec 2023 05:24:01 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 D9B866607285; Mon, 4 Dec 2023 13:23:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696240; bh=Zf8T0QawxN16ZAg63GdDflHcfaq5H6YtXv9s0/s7xXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IKAhwex1gFYRAx3hDHfxpFowqZMci/itc9EIWax2F28K5av71bY6AVFdDwDMabDkO F8pei7hGvnqijiEDT8b65C8XvUu4EI4ZZaDIHGzUqC4dquLlXEtD3yBW+Th49QhiJ+ 3oTpIFx23HMiPvuZ+zq0TnCF4aa8+6gsItQxoVcIQGVez444eYTocYRSL53yzBNCyk LdVOdnecbd5E1ZaknmOjUHASrCY7aw9X+yfCB/uWMGFMTBnmuutl2o4wPe7siRIfIS KkWz5t2H7+wjmFmUirL8yrcOdcungJwNuleDKCRkbG7mKeDHgUop1vsAFZKjENCoyb U3nnMlT5mKcNA== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Jai Luthra Subject: [PATCH v2 13/36] media: ti: j721e-csi2rx: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:23:00 +0100 Message-Id: <20231204132323.22811-14-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Jai Luthra --- drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c index ada61391c8d2..1e5f68f50afb 100644 --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c @@ -873,7 +873,6 @@ static int ti_csi2rx_init_vb2q(struct ti_csi2rx_dev *csi) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->dev = dmaengine_get_dma_device(csi->dma.chan); q->lock = &csi->mutex; - q->min_buffers_needed = 1; ret = vb2_queue_init(q); if (ret) From patchwork Mon Dec 4 13:23:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478394 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="QYIu4Je/" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30BFE184; Mon, 4 Dec 2023 05:24:03 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 640EC66071CC; Mon, 4 Dec 2023 13:24:01 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696241; bh=Td6waqKLfQADCpGtVukzLb1z1c+xWCgcYmy4mUTwhEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QYIu4Je/wnXRFw0SFkQ7Eq60kt3d91eWlmUmvf2Cj5q0PczHT970mjh3G3MovqjZx oGGTnV3iT3vERDBgP06goLwxus9Cel/ivoJ2FdYzlkDNatZEDdrhT+f0YCF7aU+zNO 5zb0G7yq4w73dYvBr++4kRz9/aX1hRjgtYroPfyviFM2ZBYu4C8IgT4a/TYRLi+kyE T/Cfr+K0iRsMHG7dVBl5RviAPi89RhyMB48CxM+QwJArSFHgj1C1qMZ2wI3HZVvyVI uKk+ywXY5pYsa99DOee58zFfCrVbIGVMXYCJNcON7YWqMaDSAKcjhUTo7g7GOD3nFv ehOrezeltVeTg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 14/36] media: ti: omap: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:23:01 +0100 Message-Id: <20231204132323.22811-15-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard --- drivers/media/platform/ti/omap/omap_vout.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/ti/omap/omap_vout.c b/drivers/media/platform/ti/omap/omap_vout.c index 72ce903717d3..f67a45f1441b 100644 --- a/drivers/media/platform/ti/omap/omap_vout.c +++ b/drivers/media/platform/ti/omap/omap_vout.c @@ -1404,7 +1404,6 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout) vq->ops = &omap_vout_vb2_ops; vq->mem_ops = &vb2_dma_contig_memops; vq->lock = &vout->lock; - vq->min_buffers_needed = 1; vfd->queue = vq; ret = vb2_queue_init(vq); From patchwork Mon Dec 4 13:23:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478395 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ScY/owUY" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92C1418F; Mon, 4 Dec 2023 05:24:04 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 B79946607090; Mon, 4 Dec 2023 13:24:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696243; bh=hw+EcJmQWwZPR1A5B99ReLj35TY7AMeTL9JoTuzkKAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ScY/owUYVMArpLwsZLqwD8BURKTytyZwaGhIdZHnATD5V85sPJdmyfgFtfJ3W58n1 AzJOV3V9/JsgScBZdgNAdJY9+25vMZ5RiDFw9inseTsVPtLLrZ+jueagxnryoW3wk0 3Krn8WecTG7xtTt3bIhU/cwVFCTe7JG7YYmjkJLgi3dkMOw9vVOqt5Puo4w3vwMvrr dTxcbbpDVNka5SRJH3yZagQbR3c96AdjTNGETYIVjf1cQvRFDZkUEKXg9qT7b7CTe3 aFnm2Cg6rjBUGVDvm5fxjhAtsj/PK3ikUklYREsbhNeyZD/tQpaFVkqWXKI5TmAM1r GaIgzX1iEKCzw== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Yong Zhi , Sakari Ailus , Bingbu Cao , Dan Scally , Tianshu Qiu Subject: [PATCH v2 15/36] media: pci: intel: ipu3: Remove useless setting of min_buffers_needed Date: Mon, 4 Dec 2023 14:23:02 +0100 Message-Id: <20231204132323.22811-16-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This driver uses min_buffers_needed which vb2 uses to ensure start_streaming is called when at least 'min_buffers_needed' buffers are queued. However, this driver doesn't need this, it can stream fine without any buffers queued. Just drop this unnecessary restriction. Signed-off-by: Benjamin Gaignard CC: Yong Zhi CC: Sakari Ailus CC: Bingbu Cao CC: Dan Scally CC: Tianshu Qiu --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index 5d3b0ffd3d08..7f72be686981 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1589,7 +1589,6 @@ static int cio2_queue_init(struct cio2_device *cio2, struct cio2_queue *q) vbq->mem_ops = &vb2_dma_sg_memops; vbq->buf_struct_size = sizeof(struct cio2_buffer); vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - vbq->min_buffers_needed = 1; vbq->drv_priv = cio2; vbq->lock = &q->lock; r = vb2_queue_init(vbq); From patchwork Mon Dec 4 13:23:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478396 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="RX7xrmq4" 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 F27E210C1; Mon, 4 Dec 2023 05:24:05 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 530C5660715D; Mon, 4 Dec 2023 13:24:04 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696244; bh=7RGpb9eXUi6lQdxW/1vzQwvC1+GPAwIhQ8xVVzZPHxM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RX7xrmq4GvDpj91MiwF1uNjqVz+SU/11KD+Xm+ywaqLks0X9rMkTF7m/RG8XRMzrJ WfiCHUFrHW417ILh7VWCUvx2L9hp1ykHPTLwD75nyB/iJIQJdOtae6nOhBaOeYtARk fwxUz5tSA164f+bkA+2V+CB0VsEvs8m/VJt6wy4eGjBenoGp3gfqM861pwIBleDBz1 YjLORInZGn4FnY77jh6RfCJ5QASWOM7YVm+3pbVdFe0ZUdLa6N0lmbWlk0ddd1Xmbz mLNhisE1aNKveXIFGwSH+AYBbmdBUVNSJ2jZOzPauBiY6j6vvy16YWly9BBsFCA5T2 P+YtjxCcm+9oQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 16/36] videobuf2: Add min_reqbufs_allocation field to vb2_queue structure Date: Mon, 4 Dec 2023 14:23:03 +0100 Message-Id: <20231204132323.22811-17-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add 'min_reqbufs_allocation' field in vb2_queue structure so drivers can specificy the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. Later that will help to distinguish the minimum number of buffers needed to start streaming versus the minimum allocation requirement. Signed-off-by: Benjamin Gaignard --- drivers/media/common/videobuf2/videobuf2-core.c | 1 + include/media/videobuf2-core.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 8c1df829745b..c224d13b3105 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -866,6 +866,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, * Make sure the requested values and current defaults are sane. */ num_buffers = max_t(unsigned int, *count, q->min_buffers_needed); + num_buffers = max_t(unsigned int, num_buffers, q->min_reqbufs_allocation); num_buffers = min_t(unsigned int, num_buffers, q->max_num_buffers); memset(q->alloc_devs, 0, sizeof(q->alloc_devs)); /* diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 5557d78b6f20..17cacd696ab4 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -550,6 +550,9 @@ struct vb2_buf_ops { * @start_streaming can be called. Used when a DMA engine * cannot be started unless at least this number of buffers * have been queued into the driver. + * @min_reqbufs_allocation: the minimum number of buffers allocated when + * calling VIDIOC_REQBUFS. Used when drivers need a to + * specify a minimum buffers allocation before setup a queue. */ /* * Private elements (won't appear at the uAPI book): @@ -615,6 +618,7 @@ struct vb2_queue { u32 timestamp_flags; gfp_t gfp_flags; u32 min_buffers_needed; + u32 min_reqbufs_allocation; struct device *alloc_devs[VB2_MAX_PLANES]; From patchwork Mon Dec 4 13:23:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478397 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ZFyu6m/I" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95CAE10F1; Mon, 4 Dec 2023 05:24:07 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 B85C466071CC; Mon, 4 Dec 2023 13:24:05 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696246; bh=hMnzJg8JCOvJEFop4t5B+/fXIKwF/ZeHN2PahVubUo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZFyu6m/Iv6lGO96k9Sw+DYXvnoNGZ1s5dIAJP8DFYYcRzeZiMzq6mf+FfoN0o46P1 EKXE23fqVk1oX29ylfe2ax8p+6Q/CpOrcx1QS9h7UR2gwDseNYBGsSlWn/TjPfCMDB pBXOs9exSQCg8B95096ixHTUT5dCf4tLS89tXeaZnFglbcdxy/rxbp2nh1dVTgVhhH ZxiXtnqaTkCK8ifvTFTP4PBctrZ0junrb1bn80tHGOT0whfbN2ofbJMiFKRIkz0Yjr RcuWU1FTbbUk0E5l/J+uwjcMGWWD5BlRM6RAAjm5ZEX/laqiQtSaARq11nhH6+iS0p hsXyiNq9e8usA== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Shuah Khan , Kieran Bingham Subject: [PATCH v2 17/36] media: test-drivers: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:04 +0100 Message-Id: <20231204132323.22811-18-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. Obvious test-drivers don't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. While at it rename function parameter. Signed-off-by: Benjamin Gaignard CC: Shuah Khan CC: Kieran Bingham --- drivers/media/test-drivers/vimc/vimc-capture.c | 2 +- drivers/media/test-drivers/vivid/vivid-core.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/test-drivers/vimc/vimc-capture.c b/drivers/media/test-drivers/vimc/vimc-capture.c index aa944270e716..97693561f1e4 100644 --- a/drivers/media/test-drivers/vimc/vimc-capture.c +++ b/drivers/media/test-drivers/vimc/vimc-capture.c @@ -432,7 +432,7 @@ static struct vimc_ent_device *vimc_capture_add(struct vimc_device *vimc, q->mem_ops = vimc_allocator == VIMC_ALLOCATOR_DMA_CONTIG ? &vb2_dma_contig_memops : &vb2_vmalloc_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_reqbufs_allocation = 2; q->lock = &vcapture->lock; q->dev = v4l2_dev->dev; diff --git a/drivers/media/test-drivers/vivid/vivid-core.c b/drivers/media/test-drivers/vivid/vivid-core.c index 353f035fcd19..b4e888ac6016 100644 --- a/drivers/media/test-drivers/vivid/vivid-core.c +++ b/drivers/media/test-drivers/vivid/vivid-core.c @@ -861,7 +861,7 @@ static const struct media_device_ops vivid_media_ops = { static int vivid_create_queue(struct vivid_dev *dev, struct vb2_queue *q, u32 buf_type, - unsigned int min_buffers_needed, + unsigned int min_reqbufs_allocation, const struct vb2_ops *ops) { if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE && dev->multiplanar) @@ -898,7 +898,7 @@ static int vivid_create_queue(struct vivid_dev *dev, q->mem_ops = allocators[dev->inst] == 1 ? &vb2_dma_contig_memops : &vb2_vmalloc_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = supports_requests[dev->inst] ? 0 : min_buffers_needed; + q->min_reqbufs_allocation = supports_requests[dev->inst] ? 0 : min_reqbufs_allocation; q->lock = &dev->mutex; q->dev = dev->v4l2_dev.dev; q->supports_requests = supports_requests[dev->inst]; From patchwork Mon Dec 4 13:23:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478398 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Q16SfkSU" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0151134; Mon, 4 Dec 2023 05:24:08 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 362426607090; Mon, 4 Dec 2023 13:24:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696247; bh=nXea1hVd1CLJC4QjmTPo1Qmgjq3TpB25wTNYX2076fw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q16SfkSUODOUuv0aRr1a3vsuwi50wG5boYx5dbxzV+1JktEOinEGm2IbRY9SpbKIV uM2jMqTnnGkJTXKKIa8mKU7hq6w1abgA7+HUszwqS82ybLLjoXljwQygr7sorOQRB7 KZwGn6pABnYlJv7ayfvX9QB860fC9ChvBaocsCayHnHRWp4AJE6RWCnPzPBxda0HHt vnVWvcjjNz7i1wyRuKe2qbBTVG9/qsj5O/UOfArfMDW43kU60C6gjjfNL3VH36Cp9Y BLJsRd8531dND0h9nAJRsyvud+k5/sVWisQpOXTHzV/objUYPOyC4YM4mU6wdBvTA6 kz5tfeY4HaeOg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Michael Krufky Subject: [PATCH v2 18/36] media: usb: dvb-usb: cxusb-analog: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:05 +0100 Message-Id: <20231204132323.22811-19-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. cxusb-analog driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Michael Krufky --- drivers/media/usb/dvb-usb/cxusb-analog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb/cxusb-analog.c b/drivers/media/usb/dvb-usb/cxusb-analog.c index deba5224cb8d..a038d97dd62e 100644 --- a/drivers/media/usb/dvb-usb/cxusb-analog.c +++ b/drivers/media/usb/dvb-usb/cxusb-analog.c @@ -1632,7 +1632,7 @@ static int cxusb_medion_register_analog_video(struct dvb_usb_device *dvbdev) cxdev->videoqueue.buf_struct_size = sizeof(struct cxusb_medion_vbuffer); cxdev->videoqueue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - cxdev->videoqueue.min_buffers_needed = 6; + cxdev->videoqueue.min_reqbufs_allocation = 6; cxdev->videoqueue.lock = &cxdev->dev_lock; ret = vb2_queue_init(&cxdev->videoqueue); From patchwork Mon Dec 4 13:23:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478399 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="ItkreTcL" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31E3619D; Mon, 4 Dec 2023 05:24:10 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 8B87766072E6; Mon, 4 Dec 2023 13:24:08 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696249; bh=cSCDQ8wlrHHxZIMdX6yERM4DP0+7F96unl/YfCpM+80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ItkreTcLbIUWjrggv+eBydLFkXe5BAIpJoa2R/UzOo0kch36mgtQE5M7SmUk2KbUi Ml9N0D2Z+myIvIoFBmd61zoLNXl33ivazxw/vaDFXAh60T1/hJzvVN7zxianSIYtvN 0KkH/xOHVYfzHE/H85y4sANcUJdLU5eGR9pTsbWz8alHpX+NcrldS7oZLk8ooaxDjf OJsG7qvi0VMLggkv1csdCGLIIvtCrnARMFcctD6IZaGSL3cgSk4wppqIrYKQsRLH7Q ZWGkjaYqQ/KUtcsAZfJCnu1K5lNXr114+PC7CHbadgq8OGvnSvheAjP5DEBGPFzGB/ a/Yqt3ouhA81w== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 19/36] media: usb: gspca: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:06 +0100 Message-Id: <20231204132323.22811-20-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. gspca driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard --- drivers/media/usb/gspca/gspca.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 770714c34295..7b701275f76d 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -1257,7 +1257,7 @@ static int vidioc_g_parm(struct file *filp, void *priv, { struct gspca_dev *gspca_dev = video_drvdata(filp); - parm->parm.capture.readbuffers = gspca_dev->queue.min_buffers_needed; + parm->parm.capture.readbuffers = gspca_dev->queue.min_reqbufs_allocation; if (!gspca_dev->sd_desc->get_streamparm) return 0; @@ -1273,7 +1273,7 @@ static int vidioc_s_parm(struct file *filp, void *priv, { struct gspca_dev *gspca_dev = video_drvdata(filp); - parm->parm.capture.readbuffers = gspca_dev->queue.min_buffers_needed; + parm->parm.capture.readbuffers = gspca_dev->queue.min_reqbufs_allocation; if (!gspca_dev->sd_desc->set_streamparm) { parm->parm.capture.capability = 0; @@ -1517,7 +1517,7 @@ int gspca_dev_probe2(struct usb_interface *intf, q->ops = &gspca_qops; q->mem_ops = &vb2_vmalloc_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_reqbufs_allocation = 2; q->lock = &gspca_dev->usb_lock; ret = vb2_queue_init(q); if (ret) From patchwork Mon Dec 4 13:23:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478400 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="fV/mbh8d" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB031AE; Mon, 4 Dec 2023 05:24:11 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 D77A0660711D; Mon, 4 Dec 2023 13:24:09 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696250; bh=CXOqINnxnCzQ6XOL+VA2AacFLu6JKWe+Zb7RZAzp+MY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fV/mbh8dUmW+X/g8KQ7t3JELb3BDz8avVf7Dm8369BUbOvgB0JutS9jE8gjeTI+V1 TNdX6vEGlQr58xjm3lU7/tIWgx8D0+F5F2ZBkNMIu/StUph9vjP9X0VisVvoPegVd2 Qs+VRvxh4QvFH8yEXVreJFkdBuR/Zs97K/fH4DdosxLLY8b+scWtWBDDvOrMnWFzhY i1irs6Mki1+moB6TTJ2FBozLulIBxnMaoAb8r9//ecrq0nQVKfJsVEYFZrfR0dfYdQ TnyUtP6tGvP9vy7vE4tnpLxIu45lcMcq1C9tq+aNBPbreqgLLUTeBhAU98p6vY6cu6 r08VAWvBGwvfg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Eugen Hristev , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Subject: [PATCH v2 20/36] media: atmel: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:07 +0100 Message-Id: <20231204132323.22811-21-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. atmel-isi driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Eugen Hristev CC: Mauro Carvalho Chehab CC: Nicolas Ferre CC: Alexandre Belloni CC: Claudiu Beznea --- drivers/media/platform/atmel/atmel-isi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index da58f33b6b0a..9c156771568a 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -1244,7 +1244,7 @@ static int atmel_isi_probe(struct platform_device *pdev) q->ops = &isi_video_qops; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_reqbufs_allocation = 2; q->dev = &pdev->dev; ret = vb2_queue_init(q); From patchwork Mon Dec 4 13:23:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478401 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="cmdA99+l" 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 3B26118C; Mon, 4 Dec 2023 05:24:13 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 34C7066071CC; Mon, 4 Dec 2023 13:24:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696252; bh=/omb2mE5oy70HH/kBxdqmwaLlWf6cHg+GYUl9K/Xqzo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cmdA99+lx9aZEXddvjpGcFHe+LHYhFZOdqop2nz1UDCU+bPLUh2JECYEzI2cs8zXM K8KWqXxiJPw6h8mP9P3IMxbxnp9yPP+ex1Of7/IVKc/OUHpnJIWTCsLcQRyGH0ZMnx xaNXV9IXL/PLks7SwuQhtv1ikqUls0XLa1L5HBJa+ziRhJBLZIFKyeF9vAJXn2zFBW 1uPGEJqoukF0hNS9X16V7H6c7R/o2SGTDnp1XLcbHSVYDuZNZXUxe/ch/iI2zbcmr1 W/lboNlHvTbMr7jIzYSWFvNcaHMrCDb1Uv4UQmARaopu/Vnou0q7vU7cYvidXMYxdC R2PULw7GPZ0IQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Rui Miguel Silva , Laurent Pinchart , Martin Kepplinger , Purism Kernel Team , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: [PATCH v2 21/36] media: imx7-media-csi: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:08 +0100 Message-Id: <20231204132323.22811-22-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. imx7-media-csi driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Rui Miguel Silva CC: Laurent Pinchart CC: Martin Kepplinger CC: Purism Kernel Team CC: Mauro Carvalho Chehab CC: Shawn Guo CC: Sascha Hauer CC: Pengutronix Kernel Team CC: Fabio Estevam CC: NXP Linux Team --- drivers/media/platform/nxp/imx7-media-csi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index 1d2464ca59b8..dcc8c54228e4 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1676,7 +1676,7 @@ static int imx7_csi_video_init(struct imx7_csi *csi) vq->mem_ops = &vb2_dma_contig_memops; vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq->lock = &csi->vdev_mutex; - vq->min_buffers_needed = 2; + vq->min_reqbufs_allocation = 2; vq->dev = csi->dev; ret = vb2_queue_init(vq); From patchwork Mon Dec 4 13:23:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478402 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="jHh7yxhr" 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 BC801103; Mon, 4 Dec 2023 05:24:14 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 CA691660715D; Mon, 4 Dec 2023 13:24:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696253; bh=ayBhyvSUe+u4AtwC/rm89lTriRSE3ewHkfysyr3gsEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jHh7yxhrTOed0YJHpL+E4A6fJlIVw0a6JFHHV6uSNJqC09iqvj8joJHefNA4ayG2S kLatJQCfnpDaRXBM3agihjPTM7S4hw02WFF62F7Zxcbxn/SlhPvKzYkUBrXPTPJgwM k0Nxg/v8UyXQ3APyWJHuLRxbwXQChDXS1jmY4v/xRBSTWY2gK5c5X5iR14beAIlpCU en1CbluLf+7j7WtS5HJG0LsC7LrKIK3crTmd3HcOUgN9544FHjTM01OP4BpYbWWXBh 1mQcmTjDEuymy3YrQncMjtQ8kt/JHBCzm7OuizEv9yhOIDChiu6rVH0dn4fyJr2zQC NqSOIWfnFWeYQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Joseph Liu , Marvin Lin , openbmc@lists.ozlabs.org Subject: [PATCH v2 22/36] media: nuvoton: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:09 +0100 Message-Id: <20231204132323.22811-23-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. nuvoton driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Joseph Liu CC: Marvin Lin CC: openbmc@lists.ozlabs.org --- drivers/media/platform/nuvoton/npcm-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/nuvoton/npcm-video.c b/drivers/media/platform/nuvoton/npcm-video.c index 267e301f2b26..6c122508be1d 100644 --- a/drivers/media/platform/nuvoton/npcm-video.c +++ b/drivers/media/platform/nuvoton/npcm-video.c @@ -1612,7 +1612,7 @@ static int npcm_video_setup_video(struct npcm_video *video) vbq->drv_priv = video; vbq->buf_struct_size = sizeof(struct npcm_video_buffer); vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - vbq->min_buffers_needed = 3; + vbq->min_reqbufs_allocation = 3; rc = vb2_queue_init(vbq); if (rc) { From patchwork Mon Dec 4 13:23:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478403 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="d+ot2jI0" 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 00410D8; Mon, 4 Dec 2023 05:24:15 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 50E6B66072A4; Mon, 4 Dec 2023 13:24:14 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696254; bh=q+PBOieh7TUOZfOTD/eax3kPGizf1naDWVCgdVzk/Rg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d+ot2jI04YYP3nNR4UaNzhMsi2OZw+QIwwxMc1qtNVNr2FZVmsM8qk2SnXAwymoiy YHFHpH26jUSYcsTSJc6NDNnWsNSvL/vEirCI4D7Vyi4u2d/Mi5y92f3c+qQ0toA4rF iaZp4BOWgLaUUYk+DCauT/jaJJc8KTNzBQIfo1XNVjDHfLMkQWDiEV7uXyllW1Pu8S F/OQ7P/8s2+syp5bL39Sggb3KDBEcVSC1896Y2CSbVC0VeO8EEaDiFyJ9ETdYGq/ij 7Zz8sIdixI6XoEX5+pC6Z1c4z2Uh8wMmDQKSoMl2flZjeu0owqGUSp4AOPKQsb2kfy 6lWfp2P42sW5g== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Jean-Christophe Trotin Subject: [PATCH v2 23/36] media: sti: hva: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:10 +0100 Message-Id: <20231204132323.22811-24-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. hva driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Jean-Christophe Trotin --- drivers/media/platform/st/sti/hva/hva-v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/st/sti/hva/hva-v4l2.c b/drivers/media/platform/st/sti/hva/hva-v4l2.c index cfe83e9dc01b..d7bc25b0d69e 100644 --- a/drivers/media/platform/st/sti/hva/hva-v4l2.c +++ b/drivers/media/platform/st/sti/hva/hva-v4l2.c @@ -1142,7 +1142,7 @@ static int hva_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; src_vq->buf_struct_size = sizeof(struct hva_frame); - src_vq->min_buffers_needed = MIN_FRAMES; + src_vq->min_reqbufs_allocation = MIN_FRAMES; src_vq->dev = ctx->hva_dev->dev; ret = queue_init(ctx, src_vq); @@ -1151,7 +1151,7 @@ static int hva_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; dst_vq->buf_struct_size = sizeof(struct hva_stream); - dst_vq->min_buffers_needed = MIN_STREAMS; + dst_vq->min_reqbufs_allocation = MIN_STREAMS; dst_vq->dev = ctx->hva_dev->dev; return queue_init(ctx, dst_vq); From patchwork Mon Dec 4 13:23:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478404 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="LXMQ8D4U" 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 5CB341726; Mon, 4 Dec 2023 05:24:17 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 9CA70660711D; Mon, 4 Dec 2023 13:24:15 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696256; bh=TyWnSNSrmM8e46vPb9QIHFcmc4e6SFgOyK7FFQxtbXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LXMQ8D4U/gijOA+nUY9rm3gjiwOc0G6dc8hMd3HlJtRWwSaCNyLJ+aJM3LN4QrieH dRtj3lkOPuToKcN3biJUAeBcxH40CwA7vdpXA8arNS5MDdQAfOnlZfDTW45RWrHDC4 74ZeWIiRTkviXGAT+G1Pk3q3hHsxYizqv/TOX9T7KjUeywIRMzex3TTvlNe48J2cJY sO3NE/qODXyrU88wuAu6vlwJyfjujx5M/UDRQL4/f6hPwVH5LWhq4Z2QaXaKRIbZ84 UyOzZvkdTRTuN4lAAHwEMPWe8/eGNvGptxbKKjBiy/3sUwnDkRpW2WQ/BNP2RpHLNa EJdQuawBQH2QA== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Dafna Hirschfeld , Laurent Pinchart , linux-rockchip@lists.infradead.org Subject: [PATCH v2 24/36] media: rockchip: rkisp1: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:11 +0100 Message-Id: <20231204132323.22811-25-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. rkisp1 driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Dafna Hirschfeld (maintainer:ROCKCHIP ISP V1 DRIVER) CC: Laurent Pinchart (maintainer:ROCKCHIP ISP V1 DRIVER) CC: linux-rockchip@lists.infradead.org (open list:ROCKCHIP ISP V1 DRIVER) --- drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c index c6d7e01c8949..de3d89b1fac7 100644 --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c @@ -1431,7 +1431,7 @@ static int rkisp1_register_capture(struct rkisp1_capture *cap) q->ops = &rkisp1_vb2_ops; q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct rkisp1_buffer); - q->min_buffers_needed = RKISP1_MIN_BUFFERS_NEEDED; + q->min_reqbufs_allocation = RKISP1_MIN_BUFFERS_NEEDED; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &node->vlock; q->dev = cap->rkisp1->dev; From patchwork Mon Dec 4 13:23:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478405 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="aVDiumS+" 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 EB3481736; Mon, 4 Dec 2023 05:24:18 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 ED1646607295; Mon, 4 Dec 2023 13:24:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696257; bh=AW4MiQtO7r6ySDJZcj9g+R3UOrOpuuzpH/3N4dqRqdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVDiumS+7Hpbvv34UKnXzYkoHyqH89/rANrJsiNmeivGeqLC6oykhygzavaE1PwlN LAhT0KTDSQ8/jXa7SQy+c0+gRpYO3UnWqb62UMTo+9fatf+99bCTPXb+goI7DTXGM8 zCdPxN+nEMMtS25qQ9jYdpywtyWicrAkBdtpK1+t4SXfsdhoEN5J7WvwvvPI558q/3 EeR5v/ZtI+cjA6lGn7q2vyYC/zaMNhlzLkFs0Lt4aRO+SaosJsqCjIHuU+2M6jkvtT wT9c/5c2uA/9JP0YkHx5mfS9GcTR69Cc6Rl36GlAEJIYkuQwOoL9NH5sqGYFjXLC8b CBA9pQbGUvW7Q== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Eddie James , Joel Stanley , Andrew Jeffery , openbmc@lists.ozlabs.org, linux-aspeed@lists.ozlabs.org Subject: [PATCH v2 25/36] media: aspeed: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:12 +0100 Message-Id: <20231204132323.22811-26-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. aspeed doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard Reviewed-by: Eddie James CC: Joel Stanley (supporter:ARM/ASPEED MACHINE SUPPORT) CC: Andrew Jeffery (reviewer:ARM/ASPEED MACHINE SUPPORT) CC: openbmc@lists.ozlabs.org (moderated list:ASPEED VIDEO ENGINE DRIVER) CC: linux-aspeed@lists.ozlabs.org (moderated list:ARM/ASPEED MACHINE SUPPORT) --- drivers/media/platform/aspeed/aspeed-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index d08aa7f73d4f..c28b10808cda 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -2034,7 +2034,7 @@ static int aspeed_video_setup_video(struct aspeed_video *video) vbq->drv_priv = video; vbq->buf_struct_size = sizeof(struct aspeed_video_buffer); vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - vbq->min_buffers_needed = ASPEED_VIDEO_V4L2_MIN_BUF_REQ; + vbq->min_reqbufs_allocation = ASPEED_VIDEO_V4L2_MIN_BUF_REQ; rc = vb2_queue_init(vbq); if (rc) { From patchwork Mon Dec 4 13:23:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478406 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bsemf9sM" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37C2B1981; Mon, 4 Dec 2023 05:24:20 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 6121066072A4; Mon, 4 Dec 2023 13:24:18 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696259; bh=nJOkOwWG7HAPg6iANkaE4/DJj5MpFIvKCNqxFpSa5Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bsemf9sMBDox41v7pChvajWkARkXsziAH64yIkLruyeXdNhLanAXUykBK0iYk6LqM P5B52tdP2M6EOzsi85N6KnczR+8NwAr6ESG3bmgM2Q+TnNJLDIKVr8j13XqYF7/8vb r9h7ay6XTl2zDTa8+kE5YjXRO2IdNmfICN26EU7AQRH+h4gnULKBCO1VyLT3TNVVCQ 4N3+xpjLOQ5Qy/v578gl8HNP/wy2jEtJIY4wF2J5IQIrn6dvpV/Y6TvnynTnpoSRsp 5cF8p6BstrnU7dk8eDwXMnPASKfPQfplh/RZtZpuUdZOWrrt85YEX6vOe8y5TXi7By pUPCc7WS/vXZg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Subject: [PATCH v2 26/36] media: sun4i-csi: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:13 +0100 Message-Id: <20231204132323.22811-27-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. sun4i-csi driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Chen-Yu Tsai CC: Jernej Skrabec CC: Samuel Holland --- drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c index 95b5633b7914..8f071cba2d25 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c @@ -411,7 +411,7 @@ int sun4i_csi_dma_register(struct sun4i_csi *csi, int irq) for (i = 0; i < CSI_MAX_BUFFER; i++) csi->current_buf[i] = NULL; - q->min_buffers_needed = 3; + q->min_reqbufs_allocation = 3; q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; q->io_modes = VB2_MMAP | VB2_DMABUF; q->lock = &csi->lock; From patchwork Mon Dec 4 13:23:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478407 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="S0bLQaf1" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 753161988; Mon, 4 Dec 2023 05:24:21 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 A2F3A66071CC; Mon, 4 Dec 2023 13:24:19 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696260; bh=HA3sPol8p5W9ebSYIho1H8w8FmquQ0VLktAbSg8hR1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S0bLQaf1KI+M5fn5WTfutbQqGVwx7owBpZ5MSZjfgNyvN6Og7vdXrOn7gJuiA5R+Y Sq7fmfWitxrdW4E5E0qB9y0kateVA4oKzIyJZprd2+7whuY5YwevPb9JlTDjQI/vUN WymEleRvA/mbCLB/TAe52kAr8V2uBZFzp1E4EeF7XToJd7pd4dZNA++gKhHm49KU4b u8S9Z+uYRa+vy83YQ697EJaHXEnFWEIBswjVZ88BGqAo+HKTXGNqOHUR0SSRzTdPQX Su+WCY4SYReKa/wRosOxGyCvjbyWwTtqVN9j4tkLUfpZ3KtoH0e56IQSCpUftFP6H2 5tVBS4aCA+YHA== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Chen-Yu Tsai , Samuel Holland Subject: [PATCH v2 27/36] media: sunxi: sun8i-di: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:14 +0100 Message-Id: <20231204132323.22811-28-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. sun8i-di driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. V4L2 framework doesn't allow to allocated less than 1 buffer. Setting min_buffers_need to 1 is useless so remove it. Signed-off-by: Benjamin Gaignard CC: Chen-Yu Tsai CC: Samuel Holland --- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index 90ab1d77b6a5..db370519d4d8 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -673,7 +673,6 @@ static int deinterlace_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->io_modes = VB2_MMAP | VB2_DMABUF; src_vq->drv_priv = ctx; src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); - src_vq->min_buffers_needed = 1; src_vq->ops = &deinterlace_qops; src_vq->mem_ops = &vb2_dma_contig_memops; src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; @@ -688,7 +687,7 @@ static int deinterlace_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->io_modes = VB2_MMAP | VB2_DMABUF; dst_vq->drv_priv = ctx; dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); - dst_vq->min_buffers_needed = 2; + dst_vq->min_reqbufs_allocation = 2; dst_vq->ops = &deinterlace_qops; dst_vq->mem_ops = &vb2_dma_contig_memops; dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; From patchwork Mon Dec 4 13:23:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478408 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="OyJ+tjAo" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF47D1998; Mon, 4 Dec 2023 05:24:22 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 D6AE666072F9; Mon, 4 Dec 2023 13:24:20 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696261; bh=JTDXHZTqhB7waUKRicdK/3FM7Ps63mkmRJ8CYuo1MH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OyJ+tjAoaR2JrREcvaDQ/KHAz3QwnnyodJuWJe35bgTsxUcSMGo3ooi8Qzl4lBBRS Ix7zbe1keufVSCViUsMseHiNYtwz9WEzxq+RKpSFC9LFJ4t2Hv9muwceZK0HGCXyFu +t65ic9ie48V6ubFZbrBXzcGAK0hkRc7cepWw1k5Ou+kMZ0V4hpOsR5aUSUz/qpRF3 rDHmdjN4HPsRb3wqg4C7m8w97NA8viWoRakXtUQbLxN8x4SFDD5dxAMRH/oqzNrD1X Gl2ThTZLB0B4Nt4BeD1UPZ+M/G6jYqWvjtmZjs3UFq5mMU5f6Ll9T5p3CLmC/Xk65u o/MecXF6mCUwg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Chen-Yu Tsai , Samuel Holland Subject: [PATCH v2 28/36] media: sun8i-rotate: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:15 +0100 Message-Id: <20231204132323.22811-29-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. sun8i-rotate driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Setting min_reqbufs_allocation to 1 is useless since V4L2 framework always allocate at least 1 buffer so remove this line. Signed-off-by: Benjamin Gaignard CC: Chen-Yu Tsai CC: Samuel Holland --- drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c index 0b025ec91826..daae1ca6335a 100644 --- a/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c +++ b/drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c @@ -536,7 +536,6 @@ static int rotate_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->io_modes = VB2_MMAP | VB2_DMABUF; src_vq->drv_priv = ctx; src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); - src_vq->min_buffers_needed = 1; src_vq->ops = &rotate_qops; src_vq->mem_ops = &vb2_dma_contig_memops; src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; @@ -551,7 +550,7 @@ static int rotate_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->io_modes = VB2_MMAP | VB2_DMABUF; dst_vq->drv_priv = ctx; dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); - dst_vq->min_buffers_needed = 2; + dst_vq->min_reqbufs_allocation = 2; dst_vq->ops = &rotate_qops; dst_vq->mem_ops = &vb2_dma_contig_memops; dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; From patchwork Mon Dec 4 13:23:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478409 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="f7AymoDN" 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 0CD2719A4; Mon, 4 Dec 2023 05:24:23 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 19C1C660711D; Mon, 4 Dec 2023 13:24:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696262; bh=Gl50yamOqxp5F3J61bdrX38ELoxqbgPRLIk274ynKbw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7AymoDN23peeo2rYK+6KBvHLhLevEnsznJewdctG2+XbxaZqVFAotigw//kcWyeL 0/yS9hdKsu8JlMHkZ48H6r22r5ftYMnRpd9yo6OAq02BPB8bEg4w5Eu3R1kq3g+FCX Cl2cfj8wftNOLQSM5Gk/Rknxfeg/SuoH+xUr3+0OVDpaloGrFqo0Z6oyDVA8S/Quzr /jEejnMap3aV9zOb04kFrMuMWSk9j6SwwrJ70/ZfucGS4taGygNhCYAUVm5ZKqwHBd Me8/GJU6+c2Jpgq4Whw6bxOGbcbr9ZswbeULXElhiFk+pwpJ72KU867vQIkSDbu1xf XAMJB4rlRNaiQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Subject: [PATCH v2 29/36] media: sunxi: sun6i-csi: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:16 +0100 Message-Id: <20231204132323.22811-30-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. sun6i-csi driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Chen-Yu Tsai CC: Jernej Skrabec CC: Samuel Holland --- drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c index cf6aadbc130b..73e721936d27 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c @@ -1010,7 +1010,7 @@ int sun6i_csi_capture_setup(struct sun6i_csi_device *csi_dev) queue->buf_struct_size = sizeof(struct sun6i_csi_buffer); queue->ops = &sun6i_csi_capture_queue_ops; queue->mem_ops = &vb2_dma_contig_memops; - queue->min_buffers_needed = 2; + queue->min_reqbufs_allocation = 2; queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; queue->lock = &capture->lock; queue->dev = csi_dev->dev; From patchwork Mon Dec 4 13:23:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478410 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Pbi5bF6Y" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE0E919A9; Mon, 4 Dec 2023 05:24:25 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 517856607090; Mon, 4 Dec 2023 13:24:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696264; bh=ORlm67uM5fv255axUnsY7LF5+NRgLL1FXRZ/tIF2QjU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pbi5bF6Y+KYs5YKI1S/bwWzcWq4rEoIhjVQhuizPnCrVxvAqKlVVQMhzVzTsHJHmQ LKxFor4iEZQHTxyGhn0BShMXGrQ+3+y+ee2miBCFH/cDiri2bhznfEFF0pInt9NmnW Ckr931qgtWKEBNvnTKolamn58mHqDp8QfNYKLjxrUGYLIQcFSu9aK6tEuaffTXB0Vn TX6+KEepBNhnRil5YxfJeTUjF4qZu2WrVqXe914jnFcbVJLlfb/Bh7sDb2IVRXgOEA 5LTa+NFAfKJkvyH78BRkN5iNMt9cXsIkRng3oYaRzh11tpPmVfydCXV0h2R7hGZAa/ 0GTS4JiMTnFkA== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Steve Longerbeam , Philipp Zabel , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Subject: [PATCH v2 30/36] media: imx: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:17 +0100 Message-Id: <20231204132323.22811-31-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. imx-media-capture driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Steve Longerbeam CC: Philipp Zabel CC: Greg Kroah-Hartman CC: Shawn Guo CC: Sascha Hauer CC: Pengutronix Kernel Team CC: Fabio Estevam CC: NXP Linux Team --- drivers/staging/media/imx/imx-media-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index ce02199e7b1b..5bb1ebd35d89 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -1022,7 +1022,7 @@ imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd, vq->mem_ops = &vb2_dma_contig_memops; vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq->lock = &priv->mutex; - vq->min_buffers_needed = 2; + vq->min_reqbufs_allocation = 2; vq->dev = priv->dev; ret = vb2_queue_init(vq); From patchwork Mon Dec 4 13:23:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478412 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hmPpJnHV" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C71B19BD; Mon, 4 Dec 2023 05:24:26 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 C56AC6605835; Mon, 4 Dec 2023 13:24:24 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696265; bh=yTw2OYKem5rJF2Nwf34/Wc4CllCCaoPD56PNsk9nNiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmPpJnHV44ms7R4ZV/QZy3iR1p65Sk+Wr8py03hZzLr3LOKclMSekhZhlscj2wTsZ EbePD6eaCkrj1bGGTdegy4le6jLK+qdfJcYfajKg4rDs9N2NaUWOwJkbqP0fQ7eq53 KITflsKQnst6zAVdDortp3a0PSJBjcAwv4P06V+fPHiJevozdvvZ8XVbewacPKVYDG U42X1q5747Yn2ebL77qmvZxFnnPfOpK0mQmx+W1O96UWJOSRt6in4kccd1gOZLVlm0 27hYlEcxjD3Dbp17ksBlQO4VgsFVqbPa6OlIQLf3Giqi+Tb6Lw/9aXl7OkHuAipZyn NYfVB72UlPlxw== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Jack Zhu , Changhuang Liang Subject: [PATCH v2 31/36] media: starfive: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:18 +0100 Message-Id: <20231204132323.22811-32-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. starfive driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Jack Zhu CC: Changhuang Liang --- drivers/staging/media/starfive/camss/stf-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/starfive/camss/stf-video.c b/drivers/staging/media/starfive/camss/stf-video.c index 0b305f21eb53..25038e37e8a6 100644 --- a/drivers/staging/media/starfive/camss/stf-video.c +++ b/drivers/staging/media/starfive/camss/stf-video.c @@ -513,7 +513,7 @@ int stf_video_register(struct stfcamss_video *video, q->buf_struct_size = sizeof(struct stfcamss_buffer); q->dev = video->stfcamss->dev; q->lock = &video->q_lock; - q->min_buffers_needed = STFCAMSS_MIN_BUFFERS; + q->min_reqbufs_allocation = STFCAMSS_MIN_BUFFERS; ret = vb2_queue_init(q); if (ret < 0) { dev_err(video->stfcamss->dev, From patchwork Mon Dec 4 13:23:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478411 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="BrCeCc7q" 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 3FD0B181; Mon, 4 Dec 2023 05:24:28 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 0D230660715D; Mon, 4 Dec 2023 13:24:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696266; bh=PJOb0upzYk5sy+kA9Qk465u2DFL4NHA2Gb2jqg1/r/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BrCeCc7qRmtQhFxZpNy//e47tTrDrrONVVN0Upa4UssbezXdbTueftYV+u6/mOS7/ QwC847PPjD5sdBVNYaUTgtY3eSpItOHCf7FVIm3sd8Euz1IuixXqe4AAnfasXqPrYq ilf6D7iJmAoX2prua+vwEaYERnBbhfzIUPCtZXuRbub71zAg6i/bAzBt40ya2Tbtyp R5stB9RXoXUA7/Tp5j3456lPQ/DR2z80upofbFpiCJzUNim6aUg4CFV/EfnKW+JOB5 hJnbCe31m9Mf1ntpRiEJmMUyvT5AxqmatoFddH0ylBT+HhpVmTNAwIsYQE3c4VTEMo GThhDniGrBlPQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , linux-tegra@vger.kernel.org Subject: [PATCH v2 32/36] media: tegra-video: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:19 +0100 Message-Id: <20231204132323.22811-33-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. tegra-video driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Thierry Reding CC: Jonathan Hunter CC: Sowjanya Komatineni CC: Luca Ceresoli CC: linux-tegra@vger.kernel.org --- drivers/staging/media/tegra-video/vi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index e0bb59ee3c09..b8242c8c0497 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -1174,7 +1174,7 @@ static int tegra_channel_init(struct tegra_vi_channel *chan) chan->queue.ops = &tegra_channel_queue_qops; chan->queue.mem_ops = &vb2_dma_contig_memops; chan->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - chan->queue.min_buffers_needed = 2; + chan->queue.min_reqbufs_allocation = 2; chan->queue.dev = vi->dev; ret = vb2_queue_init(&chan->queue); if (ret < 0) { From patchwork Mon Dec 4 13:23:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478413 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="bahKe9ZB" 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 447FD1BCA; Mon, 4 Dec 2023 05:24:29 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 673746607345; Mon, 4 Dec 2023 13:24:27 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696267; bh=3CZsTTbHLtC5vyOvtssRJvLsPSp78mQlLUyr4UEzOZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bahKe9ZB6a+MjhUKvq5M8odiKSSZMgqa4W9bYUCypnTmx9V69TndgKdfZ1G0jB0Gz 9OIkgim6c1EotYKd9dw07QHgRZJgVQIQzwNAhuF7a8R9ySNdeZdROWl4aMnNPkbGGI 5xoTZlk2UhA5emVLqcCmBGSewYiyk5/HnGZJDz53x+Wvn8NjSyknUl1GMrOkBgq+LQ pozwHtyCImewiDt2S/k3THtEvXKx+xLNGitQcIwmzNUwL+zULO3Q44sMBkpE541vN2 m0CghTEtBj9XQ0K9MOEK/zVqnJyiqUwHbOAZj5d+TXVe7scrszo+MrLSz0/tVXFx82 5uMsbMoZcMfOg== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Benoit Parrot Subject: [PATCH v2 33/36] media: ti: cal: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:20 +0100 Message-Id: <20231204132323.22811-34-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. Cal driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Benoit Parrot --- drivers/media/platform/ti/cal/cal-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/ti/cal/cal-video.c b/drivers/media/platform/ti/cal/cal-video.c index e1c5e68e945b..04709dac7221 100644 --- a/drivers/media/platform/ti/cal/cal-video.c +++ b/drivers/media/platform/ti/cal/cal-video.c @@ -1010,7 +1010,7 @@ int cal_ctx_v4l2_init(struct cal_ctx *ctx) q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->lock = &ctx->mutex; - q->min_buffers_needed = 3; + q->min_reqbufs_allocation = 3; q->dev = ctx->cal->dev; ret = vb2_queue_init(q); From patchwork Mon Dec 4 13:23:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478414 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="kCooEnmk" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8121C1BE1; Mon, 4 Dec 2023 05:24:30 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 9F272660737C; Mon, 4 Dec 2023 13:24:28 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696269; bh=6CSGRDiRO2lms0wmXZEstJJokqkWndIp5smKK5ehYIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kCooEnmkndIKQN0862GmZwqQIUBTkRANgsq1oGTjWto1LNmPYLRdTfup0Xe/IADHA XW6ubO67cr1Ol1bSKaZ0iWVwX4J3DerDiRTM3Qi/cDhtvyeGs2RDVmKGSdfH2euK64 N/C3juaKclp90MPs/e0oHYFfUuAi4/UCavpliPji0c6iPNf1des2X9QVf1L8TD4SdL 49kmO1YOK3+iQk7uh7j2BN1b1SU24T/JFfOkHami6tc4tQZvvc/DN8Ha9hBvx6j3JA pad2IELQ3EhvWhGBHlCH7N4yOt2O7+FcJJIDwemaR2Y75qX8Y1h9aUeqsBOElvahwX BxdUahsQ2IN5Q== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard Subject: [PATCH v2 34/36] media: saa7146: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:21 +0100 Message-Id: <20231204132323.22811-35-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. saa7146 driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard --- drivers/media/common/saa7146/saa7146_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c index 79214459387a..db4d725a05d4 100644 --- a/drivers/media/common/saa7146/saa7146_fops.c +++ b/drivers/media/common/saa7146/saa7146_fops.c @@ -387,7 +387,7 @@ int saa7146_register_device(struct video_device *vfd, struct saa7146_dev *dev, q->gfp_flags = __GFP_DMA32; q->buf_struct_size = sizeof(struct saa7146_buf); q->lock = &dev->v4l2_lock; - q->min_buffers_needed = 2; + q->min_reqbufs_allocation = 2; q->dev = &dev->pci->dev; err = vb2_queue_init(q); if (err) From patchwork Mon Dec 4 13:23:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478415 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="es63y+ws" Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E52361BF7; Mon, 4 Dec 2023 05:24:31 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 C82BF660739A; Mon, 4 Dec 2023 13:24:29 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701696270; bh=2gAqxxEJ2KqwbPuMzplAmWNudI3ZJjJVcvYYervFwW8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=es63y+wsk9NKG3N9BfzW7OCQ50+rqsy6ihBjbe9zjdwDiu3CBBKh/qkdxbd6heTM4 vefSwEUytpO5F+pQSjdFUOT99RlbDTSBk8QkBnhfqfi75GSCLM72yBLX/1/CJ2wTI/ JSTttSE1HP0oo31PiqCfbKl1vQKsXjtWq0OoqQFDjfPXX/oUHVXG2cTxtwpalWKrhz A2Ie6leRnNjvtLFCER+hiY200xUyhOu+6mWhy/vEFBzkXIQhAn/QobIw8c6swWT0zg WeFQNxVW7qpVQKpiRhERnu8mCEMR/eNgnaQJZ3CaBlz0yL7XvMF2bhEM5+W3nqgPMv BlJQZGE2Vc3jQ== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Dmitry Torokhov , linux-input@vger.kernel.org Subject: [PATCH v2 35/36] input: touchscreen: sur40: Fix misuse of min_buffers_needed field Date: Mon, 4 Dec 2023 14:23:22 +0100 Message-Id: <20231204132323.22811-36-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231204132323.22811-1-benjamin.gaignard@collabora.com> References: <20231204132323.22811-1-benjamin.gaignard@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 'min_buffers_needed' is suppose to be used to indicate the number of buffers needed by DMA engine to start streaming. sur40 touchscreen driver doesn't use DMA engine and just want to specify the minimum number of buffers to allocate when calling VIDIOC_REQBUFS. That 'min_reqbufs_allocation' field purpose so use it. Signed-off-by: Benjamin Gaignard CC: Dmitry Torokhov CC: linux-input@vger.kernel.org --- drivers/input/touchscreen/sur40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index e7d2a52169a0..4da3063c352e 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -1124,7 +1124,7 @@ static const struct vb2_queue sur40_queue = { .ops = &sur40_queue_ops, .mem_ops = &vb2_dma_sg_memops, .timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, - .min_buffers_needed = 3, + .min_reqbufs_allocation = 3, }; static const struct v4l2_file_operations sur40_video_fops = { From patchwork Mon Dec 4 13:39:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 13478443 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="C3yEGz1A" 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 803A61728; Mon, 4 Dec 2023 05:39:35 -0800 (PST) Received: from benjamin-XPS-13-9310.. (ec2-34-240-57-77.eu-west-1.compute.amazonaws.com [34.240.57.77]) (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 61BDC6607090; Mon, 4 Dec 2023 13:39:32 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701697174; bh=zab2+gIouwIIrR/jbmb5javdyyicwi0wlU6M2LP0J9A=; h=From:To:Cc:Subject:Date:From; b=C3yEGz1AtsCUnmpYiP7RLQXkPIce0mD2t6t13sSe+HsAsgmtqTIsHHlJTq9Cjr8UB yxd+/D5gj5vb/Q2Xn2xa/+Cm0dSm+QmKtPLNGHpqnZMBbntWdcJQcQnQY/c1DElN36 GH8ZIKXJhoJ/XIEihNuqnJtaTlHcrzZrQwvP7DIh7QVCY5yZfy+oJQYdzonOdHwXGc Snums99MRWSrOz6lMgX7YhAV3hz/kHb2QGEZUTVyKOB+7Df6/JcVwXGX+3Upe7tfR3 dJZQzdA3SrxkcBOtex3l6FhtjXub9TqfPvKqNqOfukHfFro2aXICKFeDSdcw3g6ixZ zjuwSHAqyBe6g== From: Benjamin Gaignard To: hverkuil@xs4all.nl, mchehab@kernel.org, tfiga@chromium.org, m.szyprowski@samsung.com, matt.ranostay@konsulko.com Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, kernel@collabora.com, Benjamin Gaignard , Laurent Pinchart , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Hugues Fruchet , linux-stm32@st-md-mailman.stormreply.com, =?utf-8?q?Niklas_S=C3=B6derlund?= , Jacopo Mondi , linux-renesas-soc@vger.kernel.org, Andy Walls , Martin Tuma , Bluecherry Maintainers , Anton Sviridenko , Andrey Utkin , Ezequiel Garcia , Corentin Labbe , mjpeg-users@lists.sourceforge.net, Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Greg Kroah-Hartman , linux-amlogic@lists.infradead.org Subject: [PATCH v2 36/36] videobuf2: core: Rename min_buffers_needed field to vb2_queue Date: Mon, 4 Dec 2023 14:39:20 +0100 Message-Id: <20231204133920.23930-1-benjamin.gaignard@collabora.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rename min_buffers_needed into min_queued_buffers and update the documentation about it. Signed-off-by: Benjamin Gaignard CC: Laurent Pinchart CC: Mauro Carvalho Chehab CC: Shawn Guo CC: Sascha Hauer CC: Pengutronix Kernel Team CC: Fabio Estevam CC: NXP Linux Team CC: Hugues Fruchet CC: linux-stm32@st-md-mailman.stormreply.com CC: "Niklas Söderlund" CC: Jacopo Mondi CC: linux-renesas-soc@vger.kernel.org CC: Andy Walls CC: Martin Tuma CC: Bluecherry Maintainers CC: Anton Sviridenko CC: Andrey Utkin CC: Ezequiel Garcia CC: Corentin Labbe CC: mjpeg-users@lists.sourceforge.net CC: Neil Armstrong CC: Kevin Hilman CC: Jerome Brunet CC: Martin Blumenstingl CC: Greg Kroah-Hartman CC: linux-amlogic@lists.infradead.org --- .../media/common/videobuf2/videobuf2-core.c | 29 ++++++++++--------- drivers/media/pci/bt8xx/bttv-driver.c | 2 +- drivers/media/pci/cobalt/cobalt-v4l2.c | 2 +- drivers/media/pci/cx18/cx18-streams.c | 2 +- drivers/media/pci/cx23885/cx23885-417.c | 2 +- drivers/media/pci/cx23885/cx23885-dvb.c | 2 +- drivers/media/pci/cx23885/cx23885-video.c | 4 +-- drivers/media/pci/cx25821/cx25821-video.c | 2 +- drivers/media/pci/cx88/cx88-blackbird.c | 2 +- drivers/media/pci/cx88/cx88-dvb.c | 2 +- drivers/media/pci/cx88/cx88-video.c | 4 +-- drivers/media/pci/dt3155/dt3155.c | 2 +- drivers/media/pci/mgb4/mgb4_vin.c | 2 +- drivers/media/pci/mgb4/mgb4_vout.c | 2 +- drivers/media/pci/tw5864/tw5864-video.c | 2 +- drivers/media/pci/tw68/tw68-video.c | 2 +- drivers/media/pci/tw686x/tw686x-video.c | 2 +- drivers/media/pci/zoran/zoran_driver.c | 5 +--- .../platform/nxp/imx8-isi/imx8-isi-video.c | 2 +- .../platform/renesas/rcar-vin/rcar-dma.c | 2 +- drivers/media/platform/renesas/renesas-ceu.c | 2 +- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 2 +- drivers/media/platform/renesas/sh_vou.c | 2 +- drivers/media/platform/st/stm32/stm32-dcmi.c | 2 +- drivers/staging/media/meson/vdec/vdec.c | 4 +-- .../media/sunxi/sun6i-isp/sun6i_isp_capture.c | 2 +- .../media/sunxi/sun6i-isp/sun6i_isp_params.c | 2 +- include/media/videobuf2-core.h | 6 ++-- samples/v4l/v4l2-pci-skeleton.c | 2 +- 29 files changed, 49 insertions(+), 49 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index c224d13b3105..b251cde33ca5 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -816,7 +816,7 @@ static bool verify_coherency_flags(struct vb2_queue *q, bool non_coherent_mem) int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, unsigned int flags, unsigned int *count) { - unsigned int num_buffers, allocated_buffers, num_planes = 0; + unsigned int num_buffers, allocated_buffers, min_reqbufs_needed, num_planes = 0; unsigned int q_num_bufs = vb2_get_num_buffers(q); unsigned plane_sizes[VB2_MAX_PLANES] = { }; bool non_coherent_mem = flags & V4L2_MEMORY_FLAG_NON_COHERENT; @@ -865,8 +865,11 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, /* * Make sure the requested values and current defaults are sane. */ - num_buffers = max_t(unsigned int, *count, q->min_buffers_needed); - num_buffers = max_t(unsigned int, num_buffers, q->min_reqbufs_allocation); + if (q->min_reqbufs_allocation) + num_buffers = max_t(unsigned int, *count, q->min_reqbufs_allocation); + else + num_buffers = max_t(unsigned int, *count, q->min_queued_buffers + 1); + min_reqbufs_needed = num_buffers; num_buffers = min_t(unsigned int, num_buffers, q->max_num_buffers); memset(q->alloc_devs, 0, sizeof(q->alloc_devs)); /* @@ -918,7 +921,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory, * There is no point in continuing if we can't allocate the minimum * number of buffers needed by this vb2_queue. */ - if (allocated_buffers < q->min_buffers_needed) + if (allocated_buffers < min_reqbufs_needed) ret = -ENOMEM; /* @@ -1654,7 +1657,7 @@ EXPORT_SYMBOL_GPL(vb2_core_prepare_buf); * @q: videobuf2 queue * * Attempt to start streaming. When this function is called there must be - * at least q->min_buffers_needed buffers queued up (i.e. the minimum + * at least q->min_queued_buffers queued up (i.e. the minimum * number of buffers required for the DMA engine to function). If the * @start_streaming op fails it is supposed to return all the driver-owned * buffers back to vb2 in state QUEUED. Check if that happened and if @@ -1847,7 +1850,7 @@ int vb2_core_qbuf(struct vb2_queue *q, struct vb2_buffer *vb, void *pb, * then we can finally call start_streaming(). */ if (q->streaming && !q->start_streaming_called && - q->queued_count >= q->min_buffers_needed) { + q->queued_count >= q->min_queued_buffers) { ret = vb2_start_streaming(q); if (ret) { /* @@ -2211,9 +2214,9 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type) return -EINVAL; } - if (q_num_bufs < q->min_buffers_needed) { - dprintk(q, 1, "need at least %u allocated buffers\n", - q->min_buffers_needed); + if (q_num_bufs < q->min_queued_buffers) { + dprintk(q, 1, "need at least %u queued buffers\n", + q->min_queued_buffers); return -EINVAL; } @@ -2225,7 +2228,7 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type) * Tell driver to start streaming provided sufficient buffers * are available. */ - if (q->queued_count >= q->min_buffers_needed) { + if (q->queued_count >= q->min_queued_buffers) { ret = vb2_start_streaming(q); if (ret) goto unprepare; @@ -2505,7 +2508,7 @@ int vb2_core_queue_init(struct vb2_queue *q) return -EINVAL; if (WARN_ON(q->max_num_buffers > MAX_BUFFER_INDEX) || - WARN_ON(q->min_buffers_needed > q->max_num_buffers)) + WARN_ON(q->min_queued_buffers > q->max_num_buffers)) return -EINVAL; if (WARN_ON(q->requires_requests && !q->supports_requests)) @@ -2513,13 +2516,13 @@ int vb2_core_queue_init(struct vb2_queue *q) /* * This combination is not allowed since a non-zero value of - * q->min_buffers_needed can cause vb2_core_qbuf() to fail if + * q->min_queued_buffers can cause vb2_core_qbuf() to fail if * it has to call start_streaming(), and the Request API expects * that queueing a request (and thus queueing a buffer contained * in that request) will always succeed. There is no method of * propagating an error back to userspace. */ - if (WARN_ON(q->supports_requests && q->min_buffers_needed)) + if (WARN_ON(q->supports_requests && q->min_queued_buffers)) return -EINVAL; INIT_LIST_HEAD(&q->queued_list); diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 09a193bb87df..24ebb66a5988 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -3094,7 +3094,7 @@ static int vdev_init(struct bttv *btv, struct video_device *vfd, q->gfp_flags = __GFP_DMA32; q->buf_struct_size = sizeof(struct bttv_buffer); q->lock = &btv->lock; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->dev = &btv->c.pci->dev; err = vb2_queue_init(q); if (err) diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index 26bf58d17a3d..77ba08ace29f 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -1260,7 +1260,7 @@ static int cobalt_node_register(struct cobalt *cobalt, int node) q->ops = &cobalt_qops; q->mem_ops = &vb2_dma_sg_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->lock = &s->lock; q->dev = &cobalt->pci_dev->dev; vdev->queue = q; diff --git a/drivers/media/pci/cx18/cx18-streams.c b/drivers/media/pci/cx18/cx18-streams.c index cfbc4a907802..acc6418db425 100644 --- a/drivers/media/pci/cx18/cx18-streams.c +++ b/drivers/media/pci/cx18/cx18-streams.c @@ -287,7 +287,7 @@ static int cx18_stream_init(struct cx18 *cx, int type) s->vidq.ops = &cx18_vb2_qops; s->vidq.mem_ops = &vb2_vmalloc_memops; s->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - s->vidq.min_buffers_needed = 2; + s->vidq.min_queued_buffers = 2; s->vidq.gfp_flags = GFP_DMA32; s->vidq.dev = &cx->pci_dev->dev; s->vidq.lock = &cx->serialize_lock; diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c index 434677bd4ad1..fdb96f80c036 100644 --- a/drivers/media/pci/cx23885/cx23885-417.c +++ b/drivers/media/pci/cx23885/cx23885-417.c @@ -1525,7 +1525,7 @@ int cx23885_417_register(struct cx23885_dev *dev) q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx23885_buffer); q->ops = &cx23885_qops; diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c index 7551ca4a322a..3d01cdc4c7f3 100644 --- a/drivers/media/pci/cx23885/cx23885-dvb.c +++ b/drivers/media/pci/cx23885/cx23885-dvb.c @@ -2667,7 +2667,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port) q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = port; q->buf_struct_size = sizeof(struct cx23885_buffer); q->ops = &dvb_qops; diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 9af2c5596121..42fdcf992e48 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -1321,7 +1321,7 @@ int cx23885_video_register(struct cx23885_dev *dev) q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx23885_buffer); q->ops = &cx23885_video_qops; @@ -1338,7 +1338,7 @@ int cx23885_video_register(struct cx23885_dev *dev) q->type = V4L2_BUF_TYPE_VBI_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx23885_buffer); q->ops = &cx23885_vbi_qops; diff --git a/drivers/media/pci/cx25821/cx25821-video.c b/drivers/media/pci/cx25821/cx25821-video.c index 1b80c990cb94..0bee4b728a60 100644 --- a/drivers/media/pci/cx25821/cx25821-video.c +++ b/drivers/media/pci/cx25821/cx25821-video.c @@ -730,7 +730,7 @@ int cx25821_video_register(struct cx25821_dev *dev) q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; q->io_modes |= is_output ? VB2_WRITE : VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = chan; q->buf_struct_size = sizeof(struct cx25821_buffer); q->ops = &cx25821_video_qops; diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index c1b41a9283c1..d55df8fdb3b6 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c @@ -1195,7 +1195,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv) q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx88_buffer); q->ops = &blackbird_qops; diff --git a/drivers/media/pci/cx88/cx88-dvb.c b/drivers/media/pci/cx88/cx88-dvb.c index 2087f2491c42..b33b3a5e32ec 100644 --- a/drivers/media/pci/cx88/cx88-dvb.c +++ b/drivers/media/pci/cx88/cx88-dvb.c @@ -1776,7 +1776,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx88_buffer); q->ops = &dvb_qops; diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index c0ef03ed74f9..cefb6b25e921 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -1411,7 +1411,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx88_buffer); q->ops = &cx8800_video_qops; @@ -1428,7 +1428,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, q->type = V4L2_BUF_TYPE_VBI_CAPTURE; q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; q->gfp_flags = GFP_DMA32; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->drv_priv = dev; q->buf_struct_size = sizeof(struct cx88_buffer); q->ops = &cx8800_vbi_qops; diff --git a/drivers/media/pci/dt3155/dt3155.c b/drivers/media/pci/dt3155/dt3155.c index d09cde2f6ee4..dff853e73fdc 100644 --- a/drivers/media/pci/dt3155/dt3155.c +++ b/drivers/media/pci/dt3155/dt3155.c @@ -517,7 +517,7 @@ static int dt3155_probe(struct pci_dev *pdev, const struct pci_device_id *id) pd->vidq.ops = &q_ops; pd->vidq.mem_ops = &vb2_dma_contig_memops; pd->vidq.drv_priv = pd; - pd->vidq.min_buffers_needed = 2; + pd->vidq.min_queued_buffers = 2; pd->vidq.gfp_flags = GFP_DMA32; pd->vidq.lock = &pd->mux; /* for locking v4l2_file_operations */ pd->vidq.dev = &pdev->dev; diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c index d72b07b87cd1..2cd78c539889 100644 --- a/drivers/media/pci/mgb4/mgb4_vin.c +++ b/drivers/media/pci/mgb4/mgb4_vin.c @@ -849,7 +849,7 @@ struct mgb4_vin_dev *mgb4_vin_create(struct mgb4_dev *mgbdev, int id) vindev->queue.mem_ops = &vb2_dma_sg_memops; vindev->queue.gfp_flags = GFP_DMA32; vindev->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - vindev->queue.min_buffers_needed = 2; + vindev->queue.min_queued_buffers = 2; vindev->queue.drv_priv = vindev; vindev->queue.lock = &vindev->lock; vindev->queue.dev = dev; diff --git a/drivers/media/pci/mgb4/mgb4_vout.c b/drivers/media/pci/mgb4/mgb4_vout.c index 857fc7bbd21a..241353ee77a5 100644 --- a/drivers/media/pci/mgb4/mgb4_vout.c +++ b/drivers/media/pci/mgb4/mgb4_vout.c @@ -523,7 +523,7 @@ struct mgb4_vout_dev *mgb4_vout_create(struct mgb4_dev *mgbdev, int id) voutdev->queue.mem_ops = &vb2_dma_sg_memops; voutdev->queue.gfp_flags = GFP_DMA32; voutdev->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - voutdev->queue.min_buffers_needed = 2; + voutdev->queue.min_queued_buffers = 2; voutdev->queue.drv_priv = voutdev; voutdev->queue.lock = &voutdev->lock; voutdev->queue.dev = dev; diff --git a/drivers/media/pci/tw5864/tw5864-video.c b/drivers/media/pci/tw5864/tw5864-video.c index 197ed8978102..8b1aae4b6319 100644 --- a/drivers/media/pci/tw5864/tw5864-video.c +++ b/drivers/media/pci/tw5864/tw5864-video.c @@ -1114,7 +1114,7 @@ static int tw5864_video_input_init(struct tw5864_input *input, int video_nr) input->vidq.gfp_flags = 0; input->vidq.buf_struct_size = sizeof(struct tw5864_buf); input->vidq.lock = &input->lock; - input->vidq.min_buffers_needed = 2; + input->vidq.min_queued_buffers = 2; input->vidq.dev = &input->root->pci->dev; ret = vb2_queue_init(&input->vidq); if (ret) diff --git a/drivers/media/pci/tw68/tw68-video.c b/drivers/media/pci/tw68/tw68-video.c index 79b627ebc92a..cdf5d733b863 100644 --- a/drivers/media/pci/tw68/tw68-video.c +++ b/drivers/media/pci/tw68/tw68-video.c @@ -952,7 +952,7 @@ int tw68_video_init2(struct tw68_dev *dev, int video_nr) dev->vidq.gfp_flags = __GFP_DMA32 | __GFP_KSWAPD_RECLAIM; dev->vidq.buf_struct_size = sizeof(struct tw68_buf); dev->vidq.lock = &dev->lock; - dev->vidq.min_buffers_needed = 2; + dev->vidq.min_queued_buffers = 2; dev->vidq.dev = &dev->pci->dev; ret = vb2_queue_init(&dev->vidq); if (ret) diff --git a/drivers/media/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c index 6bc6d143d18c..63be95fce83d 100644 --- a/drivers/media/pci/tw686x/tw686x-video.c +++ b/drivers/media/pci/tw686x/tw686x-video.c @@ -1222,7 +1222,7 @@ int tw686x_video_init(struct tw686x_dev *dev) vc->vidq.ops = &tw686x_video_qops; vc->vidq.mem_ops = dev->dma_ops->mem_ops; vc->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - vc->vidq.min_buffers_needed = 2; + vc->vidq.min_queued_buffers = 2; vc->vidq.lock = &vc->vb_mutex; vc->vidq.gfp_flags = dev->dma_mode != TW686X_DMA_MODE_MEMCPY ? GFP_DMA32 : 0; diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c index fa672cc8bc67..2c91f75e8d79 100644 --- a/drivers/media/pci/zoran/zoran_driver.c +++ b/drivers/media/pci/zoran/zoran_driver.c @@ -749,9 +749,6 @@ static int zr_vb2_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, unsi zr->buf_in_reserve = 0; - if (*nbuffers < vq->min_buffers_needed) - *nbuffers = vq->min_buffers_needed; - if (*nplanes) { if (sizes[0] < size) return -EINVAL; @@ -971,7 +968,7 @@ int zoran_queue_init(struct zoran *zr, struct vb2_queue *vq, int dir) vq->mem_ops = &vb2_dma_contig_memops; vq->gfp_flags = GFP_DMA32; vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - vq->min_buffers_needed = 9; + vq->min_queued_buffers = 9; vq->lock = &zr->lock; err = vb2_queue_init(vq); if (err) diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c index 49bca2b01cc6..4091f1c0e78b 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c @@ -1453,7 +1453,7 @@ int mxc_isi_video_register(struct mxc_isi_pipe *pipe, q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct mxc_isi_buffer); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->lock = &video->lock; q->dev = pipe->isi->dev; diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c index 2a77353f10b5..e2c40abc6d3d 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-dma.c @@ -1559,7 +1559,7 @@ int rvin_dma_register(struct rvin_dev *vin, int irq) q->ops = &rvin_qops; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 4; + q->min_queued_buffers = 4; q->dev = vin->dev; ret = vb2_queue_init(q); diff --git a/drivers/media/platform/renesas/renesas-ceu.c b/drivers/media/platform/renesas/renesas-ceu.c index 2562b30acfb9..167760276796 100644 --- a/drivers/media/platform/renesas/renesas-ceu.c +++ b/drivers/media/platform/renesas/renesas-ceu.c @@ -1399,7 +1399,7 @@ static int ceu_notify_complete(struct v4l2_async_notifier *notifier) q->mem_ops = &vb2_dma_contig_memops; q->buf_struct_size = sizeof(struct ceu_buffer); q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->lock = &ceudev->mlock; q->dev = ceudev->v4l2_dev.dev; diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index e6eedd65b71d..d0ffa90bc656 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -767,7 +767,7 @@ int rzg2l_cru_dma_register(struct rzg2l_cru_dev *cru) q->ops = &rzg2l_cru_qops; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 4; + q->min_queued_buffers = 4; q->dev = cru->dev; ret = vb2_queue_init(q); diff --git a/drivers/media/platform/renesas/sh_vou.c b/drivers/media/platform/renesas/sh_vou.c index f792aedc9d82..1e74dd601c2b 100644 --- a/drivers/media/platform/renesas/sh_vou.c +++ b/drivers/media/platform/renesas/sh_vou.c @@ -1297,7 +1297,7 @@ static int sh_vou_probe(struct platform_device *pdev) q->ops = &sh_vou_qops; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->lock = &vou_dev->fop_lock; q->dev = &pdev->dev; ret = vb2_queue_init(q); diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c index 48140fdf40bb..c4610e305546 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmi.c +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c @@ -2031,7 +2031,7 @@ static int dcmi_probe(struct platform_device *pdev) q->ops = &dcmi_video_qops; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; q->allow_cache_hints = 1; q->dev = &pdev->dev; diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 1e2369f104c8..167ffe764a41 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -184,7 +184,7 @@ static void process_num_buffers(struct vb2_queue *q, * we need all of them to be queued into the driver */ sess->num_dst_bufs = q_num_bufs + *num_buffers; - q->min_buffers_needed = max(fmt_out->min_buffers, sess->num_dst_bufs); + q->min_queued_buffers = max(fmt_out->min_buffers, sess->num_dst_bufs); } static int vdec_queue_setup(struct vb2_queue *q, unsigned int *num_buffers, @@ -825,7 +825,6 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, src_vq->mem_ops = &vb2_dma_contig_memops; src_vq->drv_priv = sess; src_vq->buf_struct_size = sizeof(struct dummy_buf); - src_vq->min_buffers_needed = 1; src_vq->dev = sess->core->dev; src_vq->lock = &sess->lock; ret = vb2_queue_init(src_vq); @@ -839,7 +838,6 @@ static int m2m_queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->mem_ops = &vb2_dma_contig_memops; dst_vq->drv_priv = sess; dst_vq->buf_struct_size = sizeof(struct dummy_buf); - dst_vq->min_buffers_needed = 1; dst_vq->dev = sess->core->dev; dst_vq->lock = &sess->lock; return vb2_queue_init(dst_vq); diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c index 1595a9607775..0eea4c2c3627 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_capture.c @@ -660,7 +660,7 @@ int sun6i_isp_capture_setup(struct sun6i_isp_device *isp_dev) queue->buf_struct_size = sizeof(struct sun6i_isp_buffer); queue->ops = &sun6i_isp_capture_queue_ops; queue->mem_ops = &vb2_dma_contig_memops; - queue->min_buffers_needed = 2; + queue->min_queued_buffers = 2; queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; queue->lock = &capture->lock; queue->dev = isp_dev->dev; diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c index e28be895b486..53d05e8a364b 100644 --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c @@ -489,7 +489,7 @@ int sun6i_isp_params_setup(struct sun6i_isp_device *isp_dev) queue->buf_struct_size = sizeof(struct sun6i_isp_buffer); queue->ops = &sun6i_isp_params_queue_ops; queue->mem_ops = &vb2_vmalloc_memops; - queue->min_buffers_needed = 1; + queue->min_queued_buffers = 1; queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; queue->lock = ¶ms->lock; queue->dev = isp_dev->dev; diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index 17cacd696ab4..e8fda582f0d1 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -546,13 +546,15 @@ struct vb2_buf_ops { * @gfp_flags: additional gfp flags used when allocating the buffers. * Typically this is 0, but it may be e.g. %GFP_DMA or %__GFP_DMA32 * to force the buffer allocation to a specific memory zone. - * @min_buffers_needed: the minimum number of buffers needed before + * @min_queued_buffers: the minimum number of queued buffers needed before * @start_streaming can be called. Used when a DMA engine * cannot be started unless at least this number of buffers * have been queued into the driver. * @min_reqbufs_allocation: the minimum number of buffers allocated when * calling VIDIOC_REQBUFS. Used when drivers need a to * specify a minimum buffers allocation before setup a queue. + * If set to 0 then min_queued_buffers + 1 value is used + * as minimum numbers of buffers value. */ /* * Private elements (won't appear at the uAPI book): @@ -617,7 +619,7 @@ struct vb2_queue { unsigned int buf_struct_size; u32 timestamp_flags; gfp_t gfp_flags; - u32 min_buffers_needed; + u32 min_queued_buffers; u32 min_reqbufs_allocation; struct device *alloc_devs[VB2_MAX_PLANES]; diff --git a/samples/v4l/v4l2-pci-skeleton.c b/samples/v4l/v4l2-pci-skeleton.c index a65aa9d1e9da..4fe8f58b270f 100644 --- a/samples/v4l/v4l2-pci-skeleton.c +++ b/samples/v4l/v4l2-pci-skeleton.c @@ -821,7 +821,7 @@ static int skeleton_probe(struct pci_dev *pdev, const struct pci_device_id *ent) * available before it can be started. The start_streaming() op * won't be called until at least this many buffers are queued up. */ - q->min_buffers_needed = 2; + q->min_queued_buffers = 2; /* * The serialization lock for the streaming ioctls. This is the same * as the main serialization lock, but if some of the non-streaming