{"id":21667,"url":"https://patchwork.libcamera.org/api/patches/21667/?format=json","web_url":"https://patchwork.libcamera.org/patch/21667/","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":"<20241018075942.1150378-3-chenghaoyang@chromium.org>","date":"2024-10-18T07:57:35","name":"[2/4] libcamera: Use disconnect signal in ipa proxy worker","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"890214cf3364b596a5670bed8cb48f819b967a5d","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/?format=json","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21667/mbox/","series":[{"id":4715,"url":"https://patchwork.libcamera.org/api/series/4715/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4715","date":"2024-10-18T07:57:33","name":"IPC disconnect signals","version":1,"mbox":"https://patchwork.libcamera.org/series/4715/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21667/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21667/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 B3B2CC32FC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 18 Oct 2024 07:59:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D44565390;\n\tFri, 18 Oct 2024 09:59:57 +0200 (CEST)","from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9556D65387\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Oct 2024 09:59:53 +0200 (CEST)","by mail-pf1-x42f.google.com with SMTP id\n\td2e1a72fcca58-71e592d7f6eso1173452b3a.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Oct 2024 00:59:53 -0700 (PDT)","from chenghaoyang-low.c.googlers.com.com\n\t(27.247.221.35.bc.googleusercontent.com. [35.221.247.27])\n\tby smtp.gmail.com with ESMTPSA id\n\td2e1a72fcca58-71ea345b0c3sm901274b3a.172.2024.10.18.00.59.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 18 Oct 2024 00:59:51 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"cyQbgRdW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1729238392; x=1729843192;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=lW2cNMVwigeRVpF1Gtevk7QOmbQNzwnJV93oTQIgePA=;\n\tb=cyQbgRdWZyRhYR/MGNwmX1f6CMxxIJ4uXqhVsTov/OIJfeeC2o6ceqHYX9++PtO1vf\n\tjf5IvT4LxbmLbk+W7YOGBCBKRJb96bYa7v/eitaqPZM9hTTdV89YV+oMthwk6ZONVSSj\n\tFzuo+u92aI9CgJaXR7VEk4Q5Srwqt4p6feCWQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1729238392; x=1729843192;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=lW2cNMVwigeRVpF1Gtevk7QOmbQNzwnJV93oTQIgePA=;\n\tb=S6HRhC6u+xpkqueAjmj2MR8qwF/HeWYy/vMmzgMAydafY3q8isXQhti6zvYivH3sIx\n\t9mj2U+cquAFGoh8blQ0t0DYO9wlys9cOgS0DZIcVzmE2/oMOi6fsovtLez4C3Q0Xdcdt\n\t02zy2FG5cPPF0eLGFxFVBIahcktrJG537xPvgbU9lg1N7XQC1jA9xGioWJynasgqx2XR\n\tk8OE+D1AyU2xDHIDPVOhcqP6WrXT41wf8k90fUHtJcMc/xAfOOffMkwbhNUlYTGnCBFq\n\tnTZvbZJUhcy5seCG3R4A7LIsT5XExoADkcTSe9zgvQSPD3tkwgSvGetAR+o5mgTr/Gva\n\temrg==","X-Gm-Message-State":"AOJu0Yz4aySmXvjNuo3fIOMZMUmoG4EjDMhSjkNSkIdkhTFvzTcVcmQq\n\tyMyN180683Fa0ha+kjzcbSWaWLClrrgPMA1p5h2O1CmweXDQt/JLUA/NURqfCKuTAPN1sm6nU6A\n\t=","X-Google-Smtp-Source":"AGHT+IHR5SRAbTYxjDC+C2Q9IuiA5Ye+afUHDmi24J+SbFTqB6Rtfomfc1YFZnOG9Nu7A3MWNwgKQQ==","X-Received":"by 2002:a05:6a00:1993:b0:718:ea3c:35c3 with SMTP id\n\td2e1a72fcca58-71ea316a93bmr2280495b3a.15.1729238391599; \n\tFri, 18 Oct 2024 00:59:51 -0700 (PDT)","From":"Harvey Yang <chenghaoyang@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Cc":"Harvey Yang <chenghaoyang@chromium.org>,\n\tYudhistira Erlandinata <yerlandinata@chromium.org>","Subject":"[PATCH 2/4] libcamera: Use disconnect signal in ipa proxy worker","Date":"Fri, 18 Oct 2024 07:57:35 +0000","Message-ID":"<20241018075942.1150378-3-chenghaoyang@chromium.org>","X-Mailer":"git-send-email 2.47.0.rc1.288.g06298d1525-goog","In-Reply-To":"<20241018075942.1150378-1-chenghaoyang@chromium.org>","References":"<20241018075942.1150378-1-chenghaoyang@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"Previously the worker might not receive the disconnect signal, and the\nforked process might stay alive forever.\n\nThis CL also helps DMA buf recycling, as the algo process might hold DMA\nbuf file descriptors.\n\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\nCo-developed-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\nSigned-off-by: Yudhistira Erlandinata <yerlandinata@chromium.org>\n---\n .../libcamera_templates/module_ipa_proxy_worker.cpp.tmpl     | 5 +++++\n 1 file changed, 5 insertions(+)","diff":"diff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl\nindex 1f990d3f9..68d68c4a5 100644\n--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl\n+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_proxy_worker.cpp.tmpl\n@@ -60,6 +60,10 @@ public:\n \n \t~{{proxy_worker_name}}() {}\n \n+\tvoid disconnected() {\n+\t\texit_ = true;\n+\t}\n+\n \tvoid readyRead()\n \t{\n \t\tIPCUnixSocket::Payload _message;\n@@ -131,6 +135,7 @@ public:\n \t\t\treturn EXIT_FAILURE;\n \t\t}\n \t\tsocket_.readyRead.connect(this, &{{proxy_worker_name}}::readyRead);\n+\t\tsocket_.disconnected.connect(this, &{{proxy_worker_name}}::disconnected);\n \n \t\tipa_ = dynamic_cast<{{interface_name}} *>(ipam->createInterface());\n \t\tif (!ipa_) {\n","prefixes":["2/4"]}