From patchwork Tue Dec 13 09:38:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17993 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 A565EC31E9 for ; Tue, 13 Dec 2022 09:38:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 68B5163369; Tue, 13 Dec 2022 10:38:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670924298; bh=7d6tePXZ0Z99ZziKOsYZVhwwWsTn9Jj1eOd5UQlwcNo=; 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=kqM75YZAd+Mlpb/6agawMRho0Ap3U67eG04DQQgxyyR170Hob20SPaYpb2aHZRJ8t QVTnA9FQo0m34Ojh7zb9pZ9nDGb9Owz6srHcxq6BZqjgYdHB2ORbwzi609cygiJFa1 BvcGmDAzzVM1VvacKHOzPb8XSdvJ+yHT/3ovN9Con2SjEzmLVl8EBOpq7KIb5aPsSm BoDnVM6KJBf7OmZH6FjdFRE2/IAix37MmEE9u7AfXWxeczHIOnQxF9tyL6j2bSCmFI SO97lDFQ07tspr9DLGzTUcjbdm1KyDjmUpklSZssRJEaTfjC4g8jQTTmapa5fpfNGt nm8ECw5iypSww== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9787563354 for ; Tue, 13 Dec 2022 10:38:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PPV6AGNq"; dkim-atps=neutral Received: from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6D01C7C5; Tue, 13 Dec 2022 10:38:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670924295; bh=7d6tePXZ0Z99ZziKOsYZVhwwWsTn9Jj1eOd5UQlwcNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PPV6AGNql92jv31Eq4tvGMcNs3YVcZUpmLA9McFH73k+wyvuZ4PRSePpPE3dDUO+X NDFj3YXvpMGTbigoaLptr1zVWmqQa0gMLckpN1m2dM2sHYF7COaFztejxtsz7/xqY8 WdymELHoBR7CTZ6mPEKfbxwo0/ojMe6cRBXPn1Ns= To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 18:38:01 +0900 Message-Id: <20221213093802.704177-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221213093802.704177-1-paul.elder@ideasonboard.com> References: <20221213093802.704177-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] Documentation: application-developer: Elaborate on request reuse 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: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" It recently came to our attention that marking a Request for reuse and *not* queueing it causes segfaults at Request deallocation time, if it happens after framebuffer deallocation. Add a note to warn against this in the application-developer documentation. Signed-off-by: Paul Elder --- Documentation/guides/application-developer.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst index 1b2d7727..26d5fc1d 100644 --- a/Documentation/guides/application-developer.rst +++ b/Documentation/guides/application-developer.rst @@ -490,6 +490,10 @@ device: request->reuse(Request::ReuseBuffers); camera->queueRequest(request); +Note that a request should only be marked for re-use if and only if the request +will be re-queued to the camera device. Marking a request for re-use and not +queuing it causes undefined behavior. + Request queueing ----------------