From patchwork Fri Mar 12 06:11:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11566 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 63DDCBD1F1 for ; Fri, 12 Mar 2021 06:11:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 11BA868C75; Fri, 12 Mar 2021 07:11:44 +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="uJ9B4kQd"; dkim-atps=neutral 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 3F89268C76 for ; Fri, 12 Mar 2021 07:11:38 +0100 (CET) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C581588F; Fri, 12 Mar 2021 07:11:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615529498; bh=BmNdLAWejPuHrU3gWw6s6ZHjwSS7pi1sF0vPBIL1VBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uJ9B4kQdE4xbASQ4TWx1is0C8HBbJo0KZKbps0J9XXEh9Kjb6MLzi+ipQlr9qkefk lfD8wNfiTY8gT5EjRsuHCP/g+Fko7r5RshJVk8/vDNeF5V8y/GsUf7axNoie3E35Zc 6WVRrqkp+mB6PK0oW27zZ5QLZWMxSRUYuB4kbSH4= From: Kieran Bingham To: libcamera devel Date: Fri, 12 Mar 2021 06:11:29 +0000 Message-Id: <20210312061131.854849-7-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210312061131.854849-1-kieran.bingham@ideasonboard.com> References: <20210312061131.854849-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/8] libcamera: pipeline: ipu3: frames: Group FrameBuffer operations 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" Ensure that checks on resource availability are handled first, and then operate on the queues only after the resources are confirmed as available. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/frames.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp index b8b471c3c561..7a7c5643df43 100644 --- a/src/libcamera/pipeline/ipu3/frames.cpp +++ b/src/libcamera/pipeline/ipu3/frames.cpp @@ -47,12 +47,13 @@ IPU3Frames::Info *IPU3Frames::create(Request *request) LOG(IPU3, Error) << "Parameters buffer underrun"; return nullptr; } - FrameBuffer *paramBuffer = availableParamBuffers_.front(); if (availableStatBuffers_.empty()) { LOG(IPU3, Error) << "Statistics buffer underrun"; return nullptr; } + + FrameBuffer *paramBuffer = availableParamBuffers_.front(); FrameBuffer *statBuffer = availableStatBuffers_.front(); availableParamBuffers_.pop();