Patch Detail
Show a patch.
GET /api/patches/22719/?format=api
{ "id": 22719, "url": "https://patchwork.libcamera.org/api/patches/22719/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22719/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20250131195928.57070-1-mzamazal@redhat.com>", "date": "2025-01-31T19:59:28", "name": "[v3] libcamera: software_isp: Handle signals in the proper thread", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "50b2adb8f4bc9d77dd6d47c132a7a4587eae3a4a", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22719/mbox/", "series": [ { "id": 4984, "url": "https://patchwork.libcamera.org/api/series/4984/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4984", "date": "2025-01-31T19:59:28", "name": "[v3] libcamera: software_isp: Handle signals in the proper thread", "version": 3, "mbox": "https://patchwork.libcamera.org/series/4984/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22719/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22719/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 2B235BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 Jan 2025 20:00:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A7AB68568;\n\tFri, 31 Jan 2025 21:00:00 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5192760353\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 Jan 2025 20:59:58 +0100 (CET)", "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-590-XtbhyVMUPbO0G927q5M_HA-1;\n\tFri, 31 Jan 2025 14:59:56 -0500", "from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com\n\t[10.30.177.15])\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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 8156F1801F11; Fri, 31 Jan 2025 19:59:54 +0000 (UTC)", "from mzamazal-thinkpadp1gen3.tpbc.com (unknown [10.45.224.38])\n\tby mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 558761956094; Fri, 31 Jan 2025 19:59:52 +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=\"GImrDIqX\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1738353597;\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=60efta4GR/q0v9Q1jXcqNHsTtJ9DmjQHmNBOvDhPNSw=;\n\tb=GImrDIqXknrPTVTbd2iIpx+J9U+ADGifBW7VRocDST1nhA6aiL1XNPNf6qD7FkWk62wlQp\n\tw/IKH3+PxbdIlPHG50Ho8Ng3/g87NdTQH2tETW3Zr42oc3mVGpeWAr97Iu+im0Dz0l66qs\n\thCo/uqUp74IewS+fVzI75e3r6NlYzSs=", "X-MC-Unique": "XtbhyVMUPbO0G927q5M_HA-1", "X-Mimecast-MFC-AGG-ID": "XtbhyVMUPbO0G927q5M_HA", "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 v3] libcamera: software_isp: Handle signals in the proper\n\tthread", "Date": "Fri, 31 Jan 2025 20:59:28 +0100", "Message-ID": "<20250131195928.57070-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.15", "X-Mimecast-Spam-Score": "0", "X-Mimecast-MFC-PROC-ID": "v6_eHUb70FS9Dy2kli8SUz8YQ2plnASmYSW7bj8pdlQ_1738353594", "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>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../internal/software_isp/software_isp.h | 3 ++-\n src/libcamera/pipeline/simple/simple.cpp | 16 +---------------\n 2 files changed, 3 insertions(+), 16 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..6e039bf3 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -537,21 +537,7 @@ int SimpleCameraData::init()\n \t\t\t\t<< \"Failed to create software ISP, disabling software debayering\";\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 */\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": [ "v3" ] }