From patchwork Mon Mar 4 23:25:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 703 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 46180610B3 for ; Tue, 5 Mar 2019 00:25:37 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9C5D02F2; Tue, 5 Mar 2019 00:25:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1551741936; bh=P7yYr5XpL7yU8KBee7WYDyME2eM0//5YV92Ph+cg80w=; h=From:To:Cc:Subject:Date:From; b=NWc+Q+E7XBcbDE9LbgvaGQdb4JOidvBI9LlAyxLO47H8pEEQp/ed8UphzWTRHFVoN DvaEujENnhBdq98k4aaY0KVj7TPXK/s38KxvzVWPK3o/ocM2h9oe4pI+xyjvfu7TjE EpQ+Hvr8M4+EpMs7SEryEQ7lJaZvvi2bmcW5Yn2Y= From: Kieran Bingham To: LibCamera Devel Date: Mon, 4 Mar 2019 23:25:28 +0000 Message-Id: <20190304232530.4427-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] libcamera: Fix unmapping of buffers X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2019 23:25:38 -0000 When closing down an active stream, the V4L2Device reports that buffers can not be released. This turns out to be a two part problem. Firstly, exported buffers duplicate the dmabuf file handle for internal storage - but the first handle was not released. The first patch solves this by releasing the handle after it has been associated with the buffer. The second issue is that the V4L2Device is asked to free buffers /before/ they have been released. Resolve this issue by destroying the bufferpool contents before calling down to the pipeline handler to free all buffers. Kieran Bingham (2): libcamera: v4l2_device: Close Plane dmabuf fd libcamera: camera: Unmap buffers before release src/libcamera/camera.cpp | 7 ++++++- src/libcamera/v4l2_device.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-)