{"id":10520,"url":"https://patchwork.libcamera.org/api/1.1/patches/10520/?format=json","web_url":"https://patchwork.libcamera.org/patch/10520/","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":"<20201127145612.1105770-1-naush@raspberrypi.com>","date":"2020-11-27T14:56:12","name":"[libcamera-devel,v2] pipeline: ipa: raspberrypi: Handle failures during IPA configuration","commit_ref":"ee477efde8e49e26cc02437fd50a45cd439ee65e","pull_url":null,"state":"accepted","archived":false,"hash":"19389c082dc9878bcc54129208fd84b8d410051d","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10520/mbox/","series":[{"id":1489,"url":"https://patchwork.libcamera.org/api/1.1/series/1489/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1489","date":"2020-11-27T14:56:12","name":"[libcamera-devel,v2] pipeline: ipa: raspberrypi: Handle failures during IPA configuration","version":2,"mbox":"https://patchwork.libcamera.org/series/1489/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10520/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10520/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 65D61BE177\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Nov 2020 14:56:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33D2F6346E;\n\tFri, 27 Nov 2020 15:56:19 +0100 (CET)","from mail-wr1-x435.google.com (mail-wr1-x435.google.com\n\t[IPv6:2a00:1450:4864:20::435])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D2B6B630BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Nov 2020 15:56:17 +0100 (CET)","by mail-wr1-x435.google.com with SMTP id 23so5872315wrc.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Nov 2020 06:56:17 -0800 (PST)","from naushir-VirtualBox.pitowers.org\n\t([2a00:1098:3142:14:a00:27ff:fe4d:f6a2])\n\tby smtp.gmail.com with ESMTPSA id\n\tf16sm13121126wmh.7.2020.11.27.06.56.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Nov 2020 06:56:16 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"LtMb56+Z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=/DDJFCQc/TOkOsBjf6PBUSTKdArqBZ/Cd/CX/f9vj3M=;\n\tb=LtMb56+ZBl4W7KeZ851KxNTCuMOJ3gVaRWsgLohFQTJBh1tdDGnc7/WYV1j2VPZeyJ\n\td8jowuXl8t8UcbWtyUms4upP4X/OgspP6SmWjPOyinOET7OxUoXY7abcw8E14oE4OuaH\n\tqqmaCoEDlxRPL1Yw8i3OYTHoH3iPGdLUJt/dz+K3ABjaF+zm792n4WW9Yf50sIUJoe5/\n\tKckQ7/3d91QqibubphMnO1dudwCbiHd1sK+wIiVodhfulXORwGeXiceDuiRyl9Tv2paJ\n\t5MQdehsK8sTtObr8TcS4srSqTjlMmF1Px/5Y/k8fGbI9Q4I4IQeRNy6kruKzGmd2ZmgM\n\t0w3A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=/DDJFCQc/TOkOsBjf6PBUSTKdArqBZ/Cd/CX/f9vj3M=;\n\tb=MRKGAGgeFII8Gng/a7lNG4DWDE9VPIfGN6lwhGv9l/wSt0Dj11zfAJg4klcVtGPJad\n\tUW6OwLZfwrVIH2IULcZKqNCyN8Xfh4bWv65JrnxKTRxRhtR/CKSxK2m1Ais1sdfpWXFT\n\tM5PXQddekXWcq0s5GJ+16Fm+fZEstn/8SSU/tp4txz/cGcGJllTc7KNQVMqMMrB+GJjb\n\tS9mELNDoxvRHG4h9HAaDz/f/HC/uexOI1KGTUeV3pVuMMz+hoTjcCGLsVP7vc+UyKdtf\n\tOH+VXZl3++ZQUqvIbYkMZT5ylPfVcFpK5vGablkqNga3TbPIV3Ci5Qq0y+Foa1k5G0yq\n\tMiZA==","X-Gm-Message-State":"AOAM532TUudbtzamrTeoTGds/PM9mb0Bymu1p2d0/PbX1sMvv3HRbjxP\n\tqwZfxETO09dXSxw1ozcHAtyK8K/kKogQRg==","X-Google-Smtp-Source":"ABdhPJybF2x0NSVzd7pqQSw+tBLBTiZOtUqPTB+nnObeQGM9YIBh9/WC9VD/rlFfk/t/hzOGLFiFmg==","X-Received":"by 2002:a5d:4c4a:: with SMTP id\n\tn10mr11161732wrt.54.1606488977276; \n\tFri, 27 Nov 2020 06:56:17 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Nov 2020 14:56:12 +0000","Message-Id":"<20201127145612.1105770-1-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2] pipeline: ipa: raspberrypi: Handle\n\tfailures during IPA configuration","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=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"If the IPA fails during configuration, return an error flag to the\npipeline handler and fail the use case gracefully.\n\nAt present, the IPA configuration can fail for the following reasons:\n- The sensor is not recognised, and fails to open a CamHelper object.\n- The pipeline handler did not pass in controls for the ISP and sensor.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/ipa/raspberrypi.h                |  1 +\n src/ipa/raspberrypi/raspberrypi.cpp                | 12 +++++++++++-\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp |  5 +++++\n 3 files changed, 17 insertions(+), 1 deletion(-)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex 2b55dbfc..86c97ffa 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -21,6 +21,7 @@ enum ConfigParameters {\n \tIPA_CONFIG_STAGGERED_WRITE = (1 << 1),\n \tIPA_CONFIG_SENSOR = (1 << 2),\n \tIPA_CONFIG_DROP_FRAMES = (1 << 3),\n+\tIPA_CONFIG_FAILED = (1 << 4),\n };\n \n enum Operations {\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 9853a343..57dd9c61 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -197,8 +197,11 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\t       const IPAOperationData &ipaConfig,\n \t\t       IPAOperationData *result)\n {\n-\tif (entityControls.empty())\n+\tif (entityControls.size() != 2) {\n+\t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n+\t\tresult->operation = RPi::IPA_CONFIG_FAILED;\n \t\treturn;\n+\t}\n \n \tresult->operation = 0;\n \n@@ -217,6 +220,13 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \tif (!helper_) {\n \t\thelper_ = std::unique_ptr<RPiController::CamHelper>(RPiController::CamHelper::Create(cameraName));\n \n+\t\tif (!helper_) {\n+\t\t\tLOG(IPARPI, Error) << \"Could not create camera helper for \"\n+\t\t\t\t\t   << cameraName;\n+\t\t\tresult->operation = RPi::IPA_CONFIG_FAILED;\n+\t\t\treturn;\n+\t\t}\n+\n \t\t/*\n \t\t * Pass out the sensor config to the pipeline handler in order\n \t\t * to setup the staggered writer class.\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 6fcdf557..76252806 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1194,6 +1194,11 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \tipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n \t\t\t&result);\n \n+\tif (result.operation & RPi::IPA_CONFIG_FAILED) {\n+\t\tLOG(RPI, Error) << \"IPA configuration failed!\";\n+\t\treturn -EPIPE;\n+\t}\n+\n \tunsigned int resultIdx = 0;\n \tif (result.operation & RPi::IPA_CONFIG_STAGGERED_WRITE) {\n \t\t/*\n","prefixes":["libcamera-devel","v2"]}