From patchwork Mon Dec 12 15:02:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 17980 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 4A6A1BDE6B for ; Mon, 12 Dec 2022 15:03:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AE43463354; Mon, 12 Dec 2022 16:03:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670857387; bh=hnE+osVCc7GW+1sAuM+u74lOmJbiLyA9NUJddz+WdMc=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CSe5wbPptsx9PImXGMvKM99VH5mvD2B6Ef+Vg4axmaun0Z8iAb6tFQ74IC7/dHkRt bGTDnr/xt997L2UKtXKh0u3PIJ4tS25Gyy/52pxbxkWPPajymfw+lYTy0qhZTK7IWa jFJ0C1LkH/y8LGZfG8PumrM9NwR13DJqPisPv0MYrdyh2KjoM5Ek996NOYuYNze5wr al3n2/PS46XyDYeJBosVL6cGxT+DOzrV6z0tKX3+TVNMzb07qxUB76jtK4Sv2LbnCW 0pyu4oxfFFyuIez7LZjvSxTBe4WsoDLpA+V82AHUB8xM+4JagffrGBRo1hC1QdcoTk RzImwKcFn05XQ== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2474B6333F for ; Mon, 12 Dec 2022 16:03:06 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PZxYR+eP"; dkim-atps=neutral Received: from umang.jainideasonboard.com (unknown [IPv6:2401:4900:1f3e:7d24:3f0:3e81:fb16:ab4d]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 727C96CF; Mon, 12 Dec 2022 16:03:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1670857385; bh=hnE+osVCc7GW+1sAuM+u74lOmJbiLyA9NUJddz+WdMc=; h=From:To:Cc:Subject:Date:From; b=PZxYR+ePvzm9a/4nZDISGKiNrOAJGly4Z3wvQ4smW17R8o5ro3hiFoqswxUPXLN0M NKN033bgbKd1mP0y20xUvmE8V0dRY2fV1Mtl0jJyr2wX44LyaFnJBuqumKTEiMXrIU FzlrhXzyLUISe0BidE3fRiJxSZX+49wwSUJNWUT4= To: libcamera-devel@lists.libcamera.org Date: Mon, 12 Dec 2022 20:32:54 +0530 Message-Id: <20221212150256.69004-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/2] pipeline-handler: Consider in-flight max requests 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: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series address the issue where over-queuing of FCQueue (or similar) can happen by the pipeline-handler class if not taken care of. The idea is each platform can define its max in-flight requests it can handle at any given point. Set that as a constraint in pipeline-handler base class. The pipeline-handler base class will enforce that constraint so that, over-queue of requests does not happen. Patch 1/2 moves kMaxframeContexts for IPU3 and RkISP1 to .mojom interface (common ground between IPA/PH). This will help respective pipeline-handlers to access the global variable. Patch 2/2 implements the constraint. It basically uses a counter to keep track of how many requests are currently queued to the hardware based on which - it decides whether to queue the next request or not. Umang Jain (2): ipa: Move kMaxFrameContexts to mojom interface libcamera: pipeline-handler: Consider max in-flight requests constraint include/libcamera/internal/pipeline_handler.h | 4 ++ include/libcamera/ipa/ipu3.mojom | 3 ++ include/libcamera/ipa/rkisp1.mojom | 3 ++ src/ipa/ipu3/ipu3.cpp | 3 -- src/ipa/rkisp1/rkisp1.cpp | 3 -- src/libcamera/pipeline/ipu3/ipu3.cpp | 1 + src/libcamera/pipeline/rkisp1/rkisp1.cpp | 1 + src/libcamera/pipeline_handler.cpp | 51 ++++++++++++++++++- 8 files changed, 62 insertions(+), 7 deletions(-)