[{"id":38923,"web_url":"https://patchwork.libcamera.org/comment/38923/","msgid":"<2d6a4851-374d-470f-b679-5e5f0d437364@nxsw.ie>","date":"2026-05-19T15:58:32","subject":"Re: [PATCH v2 3/4] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":226,"url":"https://patchwork.libcamera.org/api/people/226/","name":"Bryan O'Donoghue","email":"bod.linux@nxsw.ie"},"content":"On 18/05/2026 21:15, Robert Mader wrote:\n> +\tif (egl_.createInputDMABufTexture2D(*eglImageBayerIn_, input->planes()[0].fd.get()) != 0) {\n> +\t\tLOG(Debayer, Debug) << \"Importing input buffer with DMABuf import failed, falling back to upload\";\n> +\n> +\t\tinputBufferDmaSyncer->emplace(input->planes()[0].fd, DmaSyncer::SyncType::Read);\n> +\t\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n> +\t\tif (!in.isValid()) {\n> +\t\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n> +\t\t\treturn -ENODEV;\n> +\t\t}\n> +\t\tegl_.createTexture2D(*eglImageBayerIn_, in.planes()[0].data());\n> +\t}\n\nSo for this set a flag in the DebayerEGL class to flag the behavior - \ntry once and then keep to the detected behaviour.\n\n---\nbod","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 7547CBDCBC\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 May 2026 15:58:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7D75463026;\n\tTue, 19 May 2026 17:58:41 +0200 (CEST)","from mail-10624.protonmail.ch (mail-10624.protonmail.ch\n\t[79.135.106.24])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B3F262DC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 May 2026 17:58:39 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=nxsw.ie header.i=@nxsw.ie header.b=\"hm4p3rUU\";\n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxsw.ie;\n\ts=protonmail; t=1779206318; x=1779465518;\n\tbh=sqVwFAeCj6WYWoDMsdo4YMibZtCxO8EnO9GyaWzpdds=;\n\th=Date:To:From:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector;\n\tb=hm4p3rUUh/bAWswKoziy/kCprCzie5pnoc77kyo1BtFiid5wr8EIsir3Nq6v8OaaS\n\tdiRM1c9VXaMEyLXQWt8DyGr45cVaRRIhmyhwfsYfjYWb6jH23gTVWk6kmErzOJvDf1\n\tkj53j2PKa6LkyqUMAOML6ch3fMt1rlZc9maBTILNBS3RVH4ySM+CIuWAmupaIwdUob\n\tsCBR087OvqVcILO8XQolpvCYj9v3yiI4X9sFkMkQLWwaODhkdo5uZQH0wYk6WvOcvc\n\tVmmyakHtGnBcb/UNOEHqImlBGPHPwexk6NcLXr6qVdCyLftF2JlBfLrtmFdwFngpJE\n\t68to/EbXdwxaA==","Date":"Tue, 19 May 2026 15:58:32 +0000","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","From":"Bryan O'Donoghue <bod.linux@nxsw.ie>","Subject":"Re: [PATCH v2 3/4] debayer_egl: Implement dmabuf import for input\n\tbuffers","Message-ID":"<2d6a4851-374d-470f-b679-5e5f0d437364@nxsw.ie>","In-Reply-To":"<20260518201508.140849-4-robert.mader@collabora.com>","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<20260518201508.140849-4-robert.mader@collabora.com>","Feedback-ID":"136405006:user:proton","X-Pm-Message-ID":"9c4b87a2ec260cc042b39c2ed32f8b25765446d0","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}},{"id":38928,"web_url":"https://patchwork.libcamera.org/comment/38928/","msgid":"<29448eef-c7bc-4ac4-990a-897de0c9ec50@collabora.com>","date":"2026-05-19T19:44:27","subject":"Re: [PATCH v2 3/4] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 19.05.26 17:58, Bryan O'Donoghue wrote:\n> On 18/05/2026 21:15, Robert Mader wrote:\n>> +\tif (egl_.createInputDMABufTexture2D(*eglImageBayerIn_, input->planes()[0].fd.get()) != 0) {\n>> +\t\tLOG(Debayer, Debug) << \"Importing input buffer with DMABuf import failed, falling back to upload\";\n>> +\n>> +\t\tinputBufferDmaSyncer->emplace(input->planes()[0].fd, DmaSyncer::SyncType::Read);\n>> +\t\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n>> +\t\tif (!in.isValid()) {\n>> +\t\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n>> +\t\t\treturn -ENODEV;\n>> +\t\t}\n>> +\t\tegl_.createTexture2D(*eglImageBayerIn_, in.planes()[0].data());\n>> +\t}\n> So for this set a flag in the DebayerEGL class to flag the behavior -\n> try once and then keep to the detected behaviour.\n\nDid that in v3.\n\nFTR.: I *think* the overhead of trying the import every time is \nnegligible - that was the reason I didn't add such a flag in the first \nplace.","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 CDB67BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 May 2026 19:44:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 195F163020;\n\tTue, 19 May 2026 21:44:37 +0200 (CEST)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8FC962FEC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 May 2026 21:44:34 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1779219869758417.826577258738;\n\tTue, 19 May 2026 12:44:29 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"Sp1RM2ea\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1779219871; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=chEFj63dGeT2fv2AvdkVyoyNdGMfDEEtXlSFHq23kQVbvhDDrl8E5zXvsaBRX/K45SWcj3NYBu0k6hO+8s0sIJYT25o4293JglTVAfqVrus5uNxpCB6XMlBUir7UozYnPC/fNuIJiwDqJiqv9FeXfIM7jcpDaXHZqY8XtvEQdNY=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1779219871;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=NmRloIhs5jiDw0c7L49g2RIVKIALxsGvOXi6Ch8bYt4=; \n\tb=WPWw/Ky5Djm+xksbMGp9SEWs3a4zdr0MNmQEF8o3oYBLzutnaxEEFgRcRDHOvwDIiM7+aX7VnT1x4mvvL8rvXcnOQ6Qw8RMW8mtcx1W+J050rNJvkTiDIiHXA4YB7/DfXtr5i8cOVLXJVMt8vN77GjZIhRNrxILFQN1R0QYAwBA=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779219871;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=NmRloIhs5jiDw0c7L49g2RIVKIALxsGvOXi6Ch8bYt4=;\n\tb=Sp1RM2eajtUsnkeDPFBAGn8N1ltQ5EYFs1S0+9sw2gTRsMhFwzD30jNlM2bhLeyx\n\tZrl/Spzw9daUgJ+4aFDN3gv2to414Hfu2DigE2A4mGfxX2n+IUJKNJ51pZC1mW/OsrJ\n\t1vAxSwbqihQoa1ikQGGeyk5/ZIKvqFYh2mbxyjQE=","Message-ID":"<29448eef-c7bc-4ac4-990a-897de0c9ec50@collabora.com>","Date":"Tue, 19 May 2026 21:44:27 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 3/4] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"Bryan O'Donoghue <bod.linux@nxsw.ie>, libcamera-devel@lists.libcamera.org","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<20260518201508.140849-4-robert.mader@collabora.com>\n\t<2d6a4851-374d-470f-b679-5e5f0d437364@nxsw.ie>","Content-Language":"en-US, de-DE, en-GB","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<2d6a4851-374d-470f-b679-5e5f0d437364@nxsw.ie>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}},{"id":38930,"web_url":"https://patchwork.libcamera.org/comment/38930/","msgid":"<73c6ce36-433c-48c1-b5fd-7bd37972428f@ideasonboard.com>","date":"2026-05-19T20:36:48","subject":"Re: [PATCH v2 3/4] debayer_egl: Implement dmabuf import for input\n\tbuffers","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 05. 19. 17:58 keltezéssel, Bryan O'Donoghue írta:\n> On 18/05/2026 21:15, Robert Mader wrote:\n>> +\tif (egl_.createInputDMABufTexture2D(*eglImageBayerIn_, input->planes()[0].fd.get()) != 0) {\n>> +\t\tLOG(Debayer, Debug) << \"Importing input buffer with DMABuf import failed, falling back to upload\";\n>> +\n>> +\t\tinputBufferDmaSyncer->emplace(input->planes()[0].fd, DmaSyncer::SyncType::Read);\n>> +\t\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n>> +\t\tif (!in.isValid()) {\n>> +\t\t\tLOG(Debayer, Error) << \"mmap-ing buffer(s) failed\";\n>> +\t\t\treturn -ENODEV;\n>> +\t\t}\n>> +\t\tegl_.createTexture2D(*eglImageBayerIn_, in.planes()[0].data());\n>> +\t}\n> \n> So for this set a flag in the DebayerEGL class to flag the behavior -\n> try once and then keep to the detected behaviour.\n\nI think that opens an interesting question. At the moment, in libcamera, applications\nare not constrained in any way what buffers they might use. Meaning that some might be\nappropriate, some might not. There is no \"buffer import\" step that would provide\ninformation about the set of possible buffers. So disabling it on the first failure\nmight be a pessimization. But of course they will generally cycle through a single\nset of buffers, so it's most likely fine to have a flag and stop trying after\nthe first failure.\n\n\n> \n> ---\n> bod\n>","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 E481FBDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 May 2026 20:36:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EE246302D;\n\tTue, 19 May 2026 22:36:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 17DE763024\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 May 2026 22:36:52 +0200 (CEST)","from [IPV6:2a01:cb1d:8f2:800:9eb6:570e:4fb2:add3] (unknown\n\t[IPv6:2a01:cb1d:8f2:800:9eb6:570e:4fb2:add3])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C87D412BB;\n\tTue, 19 May 2026 22:36:38 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uw2dH8MQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1779222998;\n\tbh=VOj2XMV6TTEo0enkk6d+X6xPvssHX3SJrrOlM1JX4P8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=uw2dH8MQ6x4qVxRNfokXucPPM08U0ZGdISKFQltDpJDtBdk+SFcgsz9It6tRWAJRt\n\tNm4IeZTeSuin4ymks+PFrjiXJ46sWCM3cV5t8FK5CjyYp3Wy1sUhO0hN8XnolQH8q1\n\txhEDR/IRDoRRZtiilGgc4GV29FuaYeHjnv8+OKv4=","Message-ID":"<73c6ce36-433c-48c1-b5fd-7bd37972428f@ideasonboard.com>","Date":"Tue, 19 May 2026 22:36:48 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v2 3/4] debayer_egl: Implement dmabuf import for input\n\tbuffers","To":"Bryan O'Donoghue <bod.linux@nxsw.ie>,\n\tRobert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260518201508.140849-1-robert.mader@collabora.com>\n\t<20260518201508.140849-4-robert.mader@collabora.com>\n\t<2d6a4851-374d-470f-b679-5e5f0d437364@nxsw.ie>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<2d6a4851-374d-470f-b679-5e5f0d437364@nxsw.ie>","Content-Type":"text/plain; charset=UTF-8; format=flowed","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>"}}]