{"id":22405,"url":"https://patchwork.libcamera.org/api/patches/22405/?format=json","web_url":"https://patchwork.libcamera.org/patch/22405/","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":"<20241219103108.244243-1-mzamazal@redhat.com>","date":"2024-12-19T10:31:08","name":"libcamera: software_isp: Handle signals in the proper thread","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b072adf40765d6b13dddb8ff3bb05fc0f248b46f","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/?format=json","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22405/mbox/","series":[{"id":4916,"url":"https://patchwork.libcamera.org/api/series/4916/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4916","date":"2024-12-19T10:31:08","name":"libcamera: software_isp: Handle signals in the proper thread","version":1,"mbox":"https://patchwork.libcamera.org/series/4916/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22405/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22405/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 63BE7C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Dec 2024 10:31:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B105468463;\n\tThu, 19 Dec 2024 11:31:19 +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 006E467FA7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Dec 2024 11:31:17 +0100 (CET)","from mx-prod-mc-03.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-445-aFBcZdudMCGTDW_uYHHWbg-1;\n\tThu, 19 Dec 2024 05:31:15 -0500","from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS id 0C4F91955E7F; Thu, 19 Dec 2024 10:31:14 +0000 (UTC)","from nuthatch.brq.redhat.com (unknown [10.43.17.31])\n\tby mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 75EEC30044C1; Thu, 19 Dec 2024 10:31:12 +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=\"IFQV8YHn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1734604276;\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=mrKt7eQvSmAJWLa2CpZgVm5pU/2d+dDaZc4oIG8IDJI=;\n\tb=IFQV8YHnLZBeFvmDZcZ559hvG27soRJBTnXahPbMSpXd8EV7Kp42ZHqJYsq7dJzSGrRT2u\n\tcIOjf103MjvaNXSW6ypx7TOoaZ2Eh/gA3aCIE74agSgwH48fe96obvseanFsYhyRf0n5BQ\n\tBh4hIbhSoxZyzGLL5CqSyvVBbYBQqmM=","X-MC-Unique":"aFBcZdudMCGTDW_uYHHWbg-1","X-Mimecast-MFC-AGG-ID":"aFBcZdudMCGTDW_uYHHWbg","From":"Milan Zamazal <mzamazal@redhat.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>","Subject":"[PATCH] libcamera: software_isp: Handle signals in the proper thread","Date":"Thu, 19 Dec 2024 11:31:08 +0100","Message-ID":"<20241219103108.244243-1-mzamazal@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.4","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"ifCQApr5dglpNLti6FN4SfApl1rzAbJTIKakeXb0EPk_1734604274","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.  Similarly, outputBufferReady and ispStatsReady\nsignals should be handled there too, everything should be called from\nthe right thread and not block the callers.\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 8ac24e6e..280112f4 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -548,12 +548,17 @@ int SimpleCameraData::init()\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 * Similarly for outputBufferReady and ispStatsReady signals.\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_->outputBufferReady.connect(this, &SimpleCameraData::conversionOutputDone);\n-\t\t\tswIsp_->ispStatsReady.connect(this, &SimpleCameraData::ispStatsReady);\n+\t\t\tswIsp_->outputBufferReady.connect(this, [this](FrameBuffer *buffer) {\n+\t\t\t\tthis->conversionOutputDone(buffer);\n+\t\t\t});\n+\t\t\tswIsp_->ispStatsReady.connect(this, [this](uint32_t frame, uint32_t bufferId) {\n+\t\t\t\tthis->ispStatsReady(frame, bufferId);\n+\t\t\t});\n \t\t\tswIsp_->setSensorControls.connect(this, &SimpleCameraData::setSensorControls);\n \t\t}\n \t}\n","prefixes":[]}