Patch Detail
Show a patch.
GET /api/1.1/patches/22718/?format=api
{ "id": 22718, "url": "https://patchwork.libcamera.org/api/1.1/patches/22718/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22718/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20250131191838.47661-1-mzamazal@redhat.com>", "date": "2025-01-31T19:18:38", "name": "[v2] libcamera: software_isp: Handle signals in the proper thread", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d529a477f1368e61792fc5127fc00b0fc7edd218", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/1.1/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22718/mbox/", "series": [ { "id": 4983, "url": "https://patchwork.libcamera.org/api/1.1/series/4983/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4983", "date": "2025-01-31T19:18:38", "name": "[v2] libcamera: software_isp: Handle signals in the proper thread", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4983/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22718/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22718/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 F01CBBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 Jan 2025 19:18:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4935668562;\n\tFri, 31 Jan 2025 20:18:53 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63DFF60353\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 Jan 2025 20:18:51 +0100 (CET)", "from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-613-HNFMtl8pPCej2qCGp4U3Hw-1;\n\tFri, 31 Jan 2025 14:18:47 -0500", "from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.17])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id C43F71956087; Fri, 31 Jan 2025 19:18:45 +0000 (UTC)", "from mzamazal-thinkpadp1gen3.tpbc.com (unknown [10.45.224.38])\n\tby mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 7A33B19560A3; Fri, 31 Jan 2025 19:18:43 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"Bxd/PoG0\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1738351130;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding;\n\tbh=8345HAgJj4p2w3Qm4C+dUCpQHYXnmMx6BGAK0zMibbU=;\n\tb=Bxd/PoG0aOKTGw3GWhuYYrPotWkDZCLsBsXr0dbsQt50ou1pibDdGtMD24z+fwWX+jMb22\n\t1vHE6fbprULLtUhYW7pQw+4VrYj6KHeb0UBZUOrm4zvxijo38tAyq1gOVRLEqcdrXCBWJl\n\tqxzQviOps9XljpCrerd++fD4lAsspxc=", "X-MC-Unique": "HNFMtl8pPCej2qCGp4U3Hw-1", "X-Mimecast-MFC-AGG-ID": "HNFMtl8pPCej2qCGp4U3Hw", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>, Stanislaw Gruszka\n\t<stanislaw.gruszka@linux.intel.com>, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <pobrn@protonmail.com>", "Subject": "[PATCH v2] libcamera: software_isp: Handle signals in the proper\n\tthread", "Date": "Fri, 31 Jan 2025 20:18:38 +0100", "Message-ID": "<20250131191838.47661-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.17", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "r5S3VjHqxFHhw_pNU4eWQsA5kwWm8gyHPGELSfAmj88_1738351126", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "content-type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "inputBufferReady ready signal in the simple pipeline is handled in the\npipeline handler thread. outputBufferReady and ispStatsReady signals\nshould be handled there too.\n\nRather than relying on the user of the SoftwareIsp instance, let\nSoftwareIsp inherits Object. SoftwareIsp serves as a signal proxy, the\nsignals above are emitted from signal handlers. This means that if\nSoftwareIsp inherits Object then the slots are invoked in SoftwareIsp\nthread. Which is the camera manager thread because the SoftwareIsp\ninstance is created there.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n .../internal/software_isp/software_isp.h | 3 ++-\n src/libcamera/pipeline/simple/simple.cpp | 19 ++++++-------------\n 2 files changed, 8 insertions(+), 14 deletions(-)", "diff": "diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\nindex d51b03fd..440a296d 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -18,6 +18,7 @@\n \n #include <libcamera/base/class.h>\n #include <libcamera/base/log.h>\n+#include <libcamera/base/object.h>\n #include <libcamera/base/signal.h>\n #include <libcamera/base/thread.h>\n \n@@ -43,7 +44,7 @@ struct StreamConfiguration;\n \n LOG_DECLARE_CATEGORY(SoftwareIsp)\n \n-class SoftwareIsp\n+class SoftwareIsp : public Object\n {\n public:\n \tSoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 8ac24e6e..fade8fda 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -538,20 +538,13 @@ int SimpleCameraData::init()\n \t\t\tswIsp_.reset();\n \t\t} else {\n \t\t\t/*\n-\t\t\t * The inputBufferReady signal is emitted from the soft ISP thread,\n-\t\t\t * and needs to be handled in the pipeline handler thread. Signals\n-\t\t\t * implement queued delivery, but this works transparently only if\n-\t\t\t * the receiver is bound to the target thread. As the\n-\t\t\t * SimpleCameraData class doesn't inherit from the Object class, it\n-\t\t\t * is not bound to any thread, and the signal would be delivered\n-\t\t\t * synchronously. Instead, connect the signal to a lambda function\n-\t\t\t * bound explicitly to the pipe, which is bound to the pipeline\n-\t\t\t * handler thread. The function then simply forwards the call to\n-\t\t\t * conversionInputDone().\n+\t\t\t * The connected signals should be handled by the camera manager\n+\t\t\t * thread. This method is called in the camera manager thread and\n+\t\t\t * instantiates the SoftwareIsp instance, which inherits Object and\n+\t\t\t * emits the signals from the instance's own signal handlers; thus\n+\t\t\t * the slots here are invoked in the camera manager thread.\n \t\t\t */\n-\t\t\tswIsp_->inputBufferReady.connect(pipe, [this](FrameBuffer *buffer) {\n-\t\t\t\tthis->conversionInputDone(buffer);\n-\t\t\t});\n+\t\t\tswIsp_->inputBufferReady.connect(this, &SimpleCameraData::conversionInputDone);\n \t\t\tswIsp_->outputBufferReady.connect(this, &SimpleCameraData::conversionOutputDone);\n \t\t\tswIsp_->ispStatsReady.connect(this, &SimpleCameraData::ispStatsReady);\n \t\t\tswIsp_->setSensorControls.connect(this, &SimpleCameraData::setSensorControls);\n", "prefixes": [ "v2" ] }