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;