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;