From patchwork Mon Jul 19 04:01:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13039 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 018C9C322B for ; Mon, 19 Jul 2021 04:02:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6B52D60278; Mon, 19 Jul 2021 06:02:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="usdTtzwm"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4344A60278 for ; Mon, 19 Jul 2021 06:02:02 +0200 (CEST) Received: from perceval.ideasonboard.com (unknown [103.251.226.64]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A05CE465; Mon, 19 Jul 2021 06:02:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1626667321; bh=6yoyi4xyfSizDLE+Xg82nDKSJAUf5St8lWj95+gPpqU=; h=From:To:Cc:Subject:Date:From; b=usdTtzwmZ/YABvJiE0XFtfkXRfDVWb6LdEprK1Xf4ITSdS+gZV1Zyak8m+oZjb1rL oGUx6UdbYHUrXhsDdu6dhQvRivJPX9ybmD5tJ+ktqsVrdj+w+SqGI+AMrSICPfZ2F8 ncvSr4kCAAa2mIZFSeRnjeeMVdHW6hr+rovnWgp4= From: Umang Jain To: libcamera-devel@lists.libcamera.org Date: Mon, 19 Jul 2021 09:31:52 +0530 Message-Id: <20210719040152.43462-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] libcamera: v4l2_videodevice: Avoid extra construction of Framebuffer 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" While populating the V4L2BufferCache, avoid the extra construction of FrameBuffer, which is currently done by passing the vector of FrameBuffer::Planes. It is not wrong per se, but futile to have another construction of FrameBuffer from a copy of buffer->planes() for the corresponding Entry. This commit does not introduce any functional changes. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- - This is v2 of the initial series under the subject: - "libcamera: v4l2_videodevice: Correctly populate V4L2BufferCache cache" - (v1->v2) Revamp commit message entirely. --- src/libcamera/v4l2_videodevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 3d2d99b4..da2af6a1 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -183,7 +183,7 @@ V4L2BufferCache::V4L2BufferCache(const std::vector> for (const std::unique_ptr &buffer : buffers) cache_.emplace_back(true, lastUsedCounter_.fetch_add(1, std::memory_order_acq_rel), - buffer->planes()); + *buffer.get()); } V4L2BufferCache::~V4L2BufferCache()