From patchwork Wed Mar 24 15:01:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11699 X-Patchwork-Delegate: kieran.bingham@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 5627DC32E5 for ; Wed, 24 Mar 2021 15:01:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D651368D6C; Wed, 24 Mar 2021 16:01:37 +0100 (CET) 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="BOFwVej5"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D884F602E3 for ; Wed, 24 Mar 2021 16:01:32 +0100 (CET) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 76655580; Wed, 24 Mar 2021 16:01:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616598092; bh=15bCuzLW/sYhWEqQ8t+ApQSQwoCz/TNRhi3iGNhUb4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BOFwVej5wfSMcJZqPeTJQlUnY/+nRqifBOdJhCUQbLTDD0K18R9j1VzR9GXyvaizq U7R4FdI75e/unf0mquIvKLco8M4DG4GEsI6zvsH9/2mrLnw4QRmhIs2Dw7jJbsItOX XDMFmWatDH+kF3vXlDIWorksthZCGh/Yht5Vf2Ug= From: Kieran Bingham To: libcamera devel Date: Wed, 24 Mar 2021 15:01:24 +0000 Message-Id: <20210324150125.1318325-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210324150125.1318325-1-kieran.bingham@ideasonboard.com> References: <20210324150125.1318325-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 5/6] libcamera: pipeline: ipu3: Do not mark metadata complete early 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" When the imguOutputBufferReady() detects a cancelled frame, it is reporting that the metadata has been processed in order to be able to complete the cancelled request. This causes the FrameInfo to be completed and deleted early, but then an active buffer on the IMGU can complete and be unable to find the FrameInfo for it to complete correctly. Do not mark metadataProcessed early on the event that a single buffer is detected as cancelled. The stopping of the V4L2 devices will ensure that all queued buffers are returned to us and we can follow the normal and expected shutdown sequence. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 34ee600340b1..a8edf906220b 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1232,9 +1232,6 @@ void IPU3CameraData::imguOutputBufferReady(FrameBuffer *buffer) cropRegion_ = request->controls().get(controls::ScalerCrop); request->metadata().set(controls::ScalerCrop, cropRegion_); - if (buffer->metadata().status == FrameMetadata::FrameCancelled) - info->metadataProcessed = true; - if (frameInfos_.tryComplete(info)) pipe_->completeRequest(request); }