From patchwork Thu Mar 17 10:47:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15466 X-Patchwork-Delegate: umang.jain@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E192DBF415 for ; Thu, 17 Mar 2022 10:47:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A3FD96118A; Thu, 17 Mar 2022 11:47:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647514077; bh=iLKkBESaGqHiZkbB40yEdcQIhCZYhi0GVbSkfENnjas=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=YU2DdhN9NcOdnbwYYUzWIJdESCZnHaGzdy3QqmqIAWZcL2Yw5lIA5Kc5GAhR3sE83 PvpjM+WGWh0lBEZqEuqU1y+UdcnFn0xBJhKMCdYLN7tRHJInpQTLFoyuYIY9ed40Gu PAjpb7PpBh9syck/LjXEWgIq626C9Y+QvWaUjdcQ48kAbCxsKsv6hvIBoCnd39f9sL qdHivxN8SVGbXdYZ1dN/YuE6s3RFt3Jmlyr0sGqCgOfXi1GkbJF3wCYpSXnOjX0aEm 9iSMhTevXtcXqkMdAE2I/D7qmgfSTi7ftXKQysoZMbgHE17og4T5nUB+QdMI3csDm7 ZT+8XKBFVHCEg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1FBB1604DC for ; Thu, 17 Mar 2022 11:47:55 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="XRThBQom"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [103.251.226.83]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 14AE8493; Thu, 17 Mar 2022 11:47:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647514074; bh=iLKkBESaGqHiZkbB40yEdcQIhCZYhi0GVbSkfENnjas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XRThBQomj2J9ne2/GFkiMd2ba4kw03EniPBz8bAsidGVGx4PMxNh1uo7uB1b2AXX2 IoaGUGnFMaJp1EsBJg59MC6YKWNrkHQSitR6iryck4N2OCxSCcr7HMXg5jWu3ycYIB V0eLFsmf0UqkUpycHL7JFCVZBsTdeS/A7zUr4LhA= To: libcamera-devel@lists.libcamera.org Date: Thu, 17 Mar 2022 16:17:38 +0530 Message-Id: <20220317104740.569310-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220317104740.569310-1-umang.jain@ideasonboard.com> References: <20220317104740.569310-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] libcamera: v4l2_videodevice: Remove setting of buffer sequence X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The struct v4l2_buffer documentation [1] clearly states that setting of the sequence is done by the driver. libcamera does not really need to set this field while queuing the buffer(s). [1]: https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/buffer.html#struct-v4l2-buffer Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/v4l2_videodevice.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 5f36ee20..5580269f 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1600,7 +1600,6 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer) buf.length = planes[0].length; } - buf.sequence = metadata.sequence; buf.timestamp.tv_sec = metadata.timestamp / 1000000000; buf.timestamp.tv_usec = (metadata.timestamp / 1000) % 1000000; } From patchwork Thu Mar 17 10:47:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15467 X-Patchwork-Delegate: umang.jain@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 653E4BF415 for ; Thu, 17 Mar 2022 10:48:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 172DE604E7; Thu, 17 Mar 2022 11:48:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647514080; bh=QrHewiwr1p6gh6db+ZbzoHZ+xKjSPTmddti8+OdsEPA=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Oai80aMnFNtMDBIziX+D+v3EMI2CT3kubUwg1fhb17y5ngLkD52t6gS33YkjU6xLc 2SOAEVkgrDsue4NnbzhcPrYLjTlESxyr8SOntGa3vG7fz/RQsviqb7dth2PWm5tdVV 1rvYarW+AOdwnmfjtTE7rADONm6LMnRQeYFqr6XwNQ1ppXFRPj51mWfcMBmQX7qdmN +d9ZMHEp6aZjTkvTPbF4tyQbe2MMZXosGs2zV7q247bQ8bvMQJwu6F1+WZW+LhE6Nt AL3qEDitZ8s309Odz7TjMeQSzf+TUxYb/ilOrZvdoDA3canq9isHZdz2YWyYSLYRHy s+ZqY1OptzmUA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3FEBA604DB for ; Thu, 17 Mar 2022 11:47:58 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Xs2At/4z"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [103.251.226.83]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2CE1C929; Thu, 17 Mar 2022 11:47:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647514077; bh=QrHewiwr1p6gh6db+ZbzoHZ+xKjSPTmddti8+OdsEPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xs2At/4zIM0B9VIBnANmHdDnlBoSiBprTtiI7gRSVw1aBalBoMKLZE6ztNNx6Q0Ry Uw3qT/OKUAQGUruFgxiIrjgr9gdl/ezy0Hd5eI8pR9jMoBQA2O7E6xe9m8iOfouylZ VhND34aQQxp4MzDuXuAz2qPgmqLPZHzaYFDgu1J0= To: libcamera-devel@lists.libcamera.org Date: Thu, 17 Mar 2022 16:17:39 +0530 Message-Id: <20220317104740.569310-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220317104740.569310-1-umang.jain@ideasonboard.com> References: <20220317104740.569310-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] libcamera: v4l2_videodevice: Clarify setting of v4l2_buffer timestamp X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a comment to clarify why we set v4l2_buffer timestamp while queuing the buffer (VIDIOC_QBUF). The timstamps are required to be supplied for memory-to-memory devices for output streams which then are copied to capture stream buffers with the help of V4L2_BUF_FLAG_TIMESTAMP_COPY (set by the driver). Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/v4l2_videodevice.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 5580269f..a6c54b19 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1600,6 +1600,14 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer) buf.length = planes[0].length; } + /* + * Timestamps are to be supplied if the device is a mem-to-mem + * device. The drivers will have V4L2_BUF_FLAG_TIMESTAMP_COPY + * set hence these timestamps will be copied from the output + * buffers to capture buffers. If the device is not mem-to-men, + * there is no harm in setting the timestamps as they will be + * ignored (and over-written). + */ buf.timestamp.tv_sec = metadata.timestamp / 1000000000; buf.timestamp.tv_usec = (metadata.timestamp / 1000) % 1000000; } From patchwork Thu Mar 17 10:47:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 15468 X-Patchwork-Delegate: umang.jain@ideasonboard.com Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DF443C3262 for ; Thu, 17 Mar 2022 10:48:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 802BA604DC; Thu, 17 Mar 2022 11:48:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647514080; bh=sO9+JEz3qwcUC3QbrCXg8Ts2ioYTSkrHyQdXZA6qDdM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=TQ+/83xOU/ebdMaW13st2sGlq0P5WyE7PuT4yoXy96Z7PvZn5ODjDQXaHcs/VcH8Y BxHpLW+k+GQv1Oaq6/vgMjR0dkVvaN05h98LYkDrbo3I7MSeh267/edpcWbF9Tg/FF TmEmsp2oy1rnSrBkRUqd+hROGKgsyr3mFOCyy6L3ccs86XCzAILuW9iNLbGOhnfXWW qDDf22nUoGRl1uC5xTV9dEHZrfYgMvwyrru3LcQJAifkW41vUgGZwSBPedfbGHYm4F XVpAMrfIxyvCcOkrexHTcbd5P/W26oSCHrf2HRccBGo3l/4xPwSrNPVNd0aKUaOia3 4BOeWQzySGZTg== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D6CC604DC for ; Thu, 17 Mar 2022 11:47:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UPVUqUYM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (unknown [103.251.226.83]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4ED63E2C; Thu, 17 Mar 2022 11:47:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1647514079; bh=sO9+JEz3qwcUC3QbrCXg8Ts2ioYTSkrHyQdXZA6qDdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPVUqUYM4DYyO9Zd3JNr7pNQZR7lEyPKPnYwuH8HQru1g2LCRHZaTxzUzeq3B+uBX uVGBds7hbk8zD5dB/R9Se9gKdzL8V3lwmf/KPSCnAFtvbO171m4KvQs9SHwboYdibz LrzrA27+5dy1adxOm249+y+WKcP7y5RUsl4sk7o4= To: libcamera-devel@lists.libcamera.org Date: Thu, 17 Mar 2022 16:17:40 +0530 Message-Id: <20220317104740.569310-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220317104740.569310-1-umang.jain@ideasonboard.com> References: <20220317104740.569310-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] libcamera: framebuffer: Add a missing space in documentation X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" s/bytesused/bytes used/ Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Acked-by: Kieran Bingham --- src/libcamera/framebuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp index 049b1c7e..142e2af7 100644 --- a/src/libcamera/framebuffer.cpp +++ b/src/libcamera/framebuffer.cpp @@ -30,7 +30,7 @@ LOG_DEFINE_CATEGORY(Buffer) * \brief Metadata related to a captured frame * * The FrameMetadata structure stores all metadata related to a captured frame, - * as stored in a FrameBuffer, such as capture status, timestamp and bytesused. + * as stored in a FrameBuffer, such as capture status, timestamp and bytes used. */ /**