{"id":17672,"url":"https://patchwork.libcamera.org/api/patches/17672/?format=json","web_url":"https://patchwork.libcamera.org/patch/17672/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20221024000356.29521-10-laurent.pinchart@ideasonboard.com>","date":"2022-10-24T00:03:52","name":"[libcamera-devel,v3,09/13] pipeline: rkisp1: Pass info pointer to tryCompleteRequest()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"5bb0b6dc56952eb9846075af29dc1d14246ec51a","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17672/mbox/","series":[{"id":3574,"url":"https://patchwork.libcamera.org/api/series/3574/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3574","date":"2022-10-24T00:03:43","name":"Add Bayer format support for RkISP1","version":3,"mbox":"https://patchwork.libcamera.org/series/3574/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17672/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17672/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6AEF9C3286\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 Oct 2022 00:04:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F195B62F03;\n\tMon, 24 Oct 2022 02:04:37 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A09DD62EE7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 Oct 2022 02:04:33 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 35660471;\n\tMon, 24 Oct 2022 02:04:33 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1666569878;\n\tbh=yBe8pBqOPREEH/XvWbDIRYlizdhL1BOSbtQl4x1G/N0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=vZ7b6gF5A8olhnNKr2OGS+/SQLLXKwFaB1g3SZshHyl5qCEDO6CHIGk+9FRQoS2Tr\n\tYRVfrbz99KOSbIVbDN6kcPrp0wK+SY0MAGcSTrbaUG8ePRRA53EXWDvembHUUh8MTH\n\t+DW0n+k6qq6DHmlsOibr7R2kVbMbpDtF4tv5eaEDqOtuJUa4D3s9LnP2w4ivoLsB67\n\t/frTGF3mbzKPFFs2EOx9ZdxMRkVfzFLLmjvbia3gKTlJ8V7bNJMnEEZSoIT7c5q8x5\n\tF3PtRWYNLBi74f0lA8a3THYG3rhO9sFdX4vpPspuAIFEpUVfby4cQDFFqk8FVl0hQx\n\tzC8FacUNcARhw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1666569873;\n\tbh=yBe8pBqOPREEH/XvWbDIRYlizdhL1BOSbtQl4x1G/N0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=kmOWe6VAQdVVTJzAt1Zbja14Zn/0H/nALXfpsBbs8f9j4JT3l0ud/gucD2SjuD/aC\n\tsSmZqJVeFhPCRc0BE20RcZ0IJu516w9+0qUrGuQy4zP/awGM6Qd+Zz7HQSfxAJ3Ohj\n\tz3QQ0y0NmoiNUgBxoVtPxq0UR13F01bqq3e0S7XY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"kmOWe6VA\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 24 Oct 2022 03:03:52 +0300","Message-Id":"<20221024000356.29521-10-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.37.4","In-Reply-To":"<20221024000356.29521-1-laurent.pinchart@ideasonboard.com>","References":"<20221024000356.29521-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 09/13] pipeline: rkisp1: Pass info\n\tpointer to tryCompleteRequest()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The tryCompleteRequest() function looks up the RkISP1FrameInfo that alls\nbut one of its callers already look up. Remove the double look up by\npassing the info pointer to tryCompleteRequest().\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 23 ++++++++++++++---------\n 1 file changed, 14 insertions(+), 9 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 50da92d4d6f8..cca89cc13bff 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -168,7 +168,7 @@ private:\n \tint initLinks(Camera *camera, const CameraSensor *sensor,\n \t\t      const RkISP1CameraConfiguration &config);\n \tint createCamera(MediaEntity *sensor);\n-\tvoid tryCompleteRequest(Request *request);\n+\tvoid tryCompleteRequest(RkISP1FrameInfo *info);\n \tvoid bufferReady(FrameBuffer *buffer);\n \tvoid paramReady(FrameBuffer *buffer);\n \tvoid statReady(FrameBuffer *buffer);\n@@ -391,7 +391,7 @@ void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &meta\n \tinfo->request->metadata().merge(metadata);\n \tinfo->metadataProcessed = true;\n \n-\tpipe()->tryCompleteRequest(info->request);\n+\tpipe()->tryCompleteRequest(info);\n }\n \n RkISP1CameraConfiguration::RkISP1CameraConfiguration(Camera *camera,\n@@ -1123,12 +1123,10 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n  * Buffer Handling\n  */\n \n-void PipelineHandlerRkISP1::tryCompleteRequest(Request *request)\n+void PipelineHandlerRkISP1::tryCompleteRequest(RkISP1FrameInfo *info)\n {\n \tRkISP1CameraData *data = cameraData(activeCamera_);\n-\tRkISP1FrameInfo *info = data->frameInfo_.find(request);\n-\tif (!info)\n-\t\treturn;\n+\tRequest *request = info->request;\n \n \tif (request->hasPendingBuffers())\n \t\treturn;\n@@ -1146,6 +1144,13 @@ void PipelineHandlerRkISP1::tryCompleteRequest(Request *request)\n \n void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)\n {\n+\tASSERT(activeCamera_);\n+\tRkISP1CameraData *data = cameraData(activeCamera_);\n+\n+\tRkISP1FrameInfo *info = data->frameInfo_.find(buffer);\n+\tif (!info)\n+\t\treturn;\n+\n \tRequest *request = buffer->request();\n \n \t/*\n@@ -1158,7 +1163,7 @@ void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)\n \t\t\t\tbuffer->metadata().timestamp);\n \n \tcompleteBuffer(request, buffer);\n-\ttryCompleteRequest(request);\n+\ttryCompleteRequest(info);\n }\n \n void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)\n@@ -1171,7 +1176,7 @@ void PipelineHandlerRkISP1::paramReady(FrameBuffer *buffer)\n \t\treturn;\n \n \tinfo->paramDequeued = true;\n-\ttryCompleteRequest(info->request);\n+\ttryCompleteRequest(info);\n }\n \n void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)\n@@ -1185,7 +1190,7 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)\n \n \tif (buffer->metadata().status == FrameMetadata::FrameCancelled) {\n \t\tinfo->metadataProcessed = true;\n-\t\ttryCompleteRequest(info->request);\n+\t\ttryCompleteRequest(info);\n \t\treturn;\n \t}\n \n","prefixes":["libcamera-devel","v3","09/13"]}