{"id":8507,"url":"https://patchwork.libcamera.org/api/1.1/patches/8507/?format=json","web_url":"https://patchwork.libcamera.org/patch/8507/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20200629153518.3734304-1-niklas.soderlund@ragnatech.se>","date":"2020-06-29T15:35:17","name":"[libcamera-devel,1/2] libcamera: ipu3: Make it easier to read when a request may be completed","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6f6e86750607e5efa7b6b6df3bf11c6f15530cba","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/1.1/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/8507/mbox/","series":[{"id":1058,"url":"https://patchwork.libcamera.org/api/1.1/series/1058/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1058","date":"2020-06-29T15:35:17","name":"[libcamera-devel,1/2] libcamera: ipu3: Make it easier to read when a request may be completed","version":1,"mbox":"https://patchwork.libcamera.org/series/1058/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8507/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8507/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 0B409BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2020 15:35:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6CCC1609DB;\n\tMon, 29 Jun 2020 17:35:32 +0200 (CEST)","from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 82983603B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 17:35:30 +0200 (CEST)","from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de\n\t[79.202.46.202]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 25cc7727-ba1e-11ea-8fb8-005056917f90;\n\tMon, 29 Jun 2020 17:35:29 +0200 (CEST)"],"X-Halon-ID":"25cc7727-ba1e-11ea-8fb8-005056917f90","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 29 Jun 2020 17:35:17 +0200","Message-Id":"<20200629153518.3734304-1-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 1/2] libcamera: ipu3: Make it easier to\n\tread when a request may be completed","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>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"It's confusing to read the code and understand that a request is only\ncompleted before being processed by the ImgU if it only contains a\nsingle RAW buffer. Add a boolean variable with a explanatory name to\nmake this clearer, no functional change.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 1bdad209de6e47fb..4e75bd40c66f821a 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -874,10 +874,13 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)\n \t * If the request contains a buffer for the RAW stream only, complete it\n \t * now as there's no need for ImgU processing.\n \t */\n-\tif (request->findBuffer(&rawStream_) &&\n-\t    pipe_->completeBuffer(camera_, request, buffer)) {\n-\t\tpipe_->completeRequest(camera_, request);\n-\t\treturn;\n+\tif (request->findBuffer(&rawStream_)) {\n+\t\tbool requestComplete =\n+\t\t\tpipe_->completeBuffer(camera_, request, buffer);\n+\t\tif (requestComplete) {\n+\t\t\tpipe_->completeRequest(camera_, request);\n+\t\t\treturn;\n+\t\t}\n \t}\n \n \timgu_->input_->queueBuffer(buffer);\n","prefixes":["libcamera-devel","1/2"]}