[{"id":34477,"web_url":"https://patchwork.libcamera.org/comment/34477/","msgid":"<85a567lhyx.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-06-16T17:22:14","subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Bryan,\n\nBryan O'Donoghue <bryan.odonoghue@linaro.org> writes:\n\n> Add MappedFrameBuffer::getPlaneFD() which takes a plane index and returns\n> the file descriptor associated with it.\n>\n> This fd will be used to feed into eglCreateImageKHR for both texture\n> creation on upload and directly render-to-texture where the texture buffer\n> comes from the fd given to eglCreateImageKHR.\n\nSo it's for future improvements not present in the current version,\nright?\n\n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  include/libcamera/internal/mapped_framebuffer.h | 1 +\n>  src/libcamera/mapped_framebuffer.cpp            | 5 +++++\n>  2 files changed, 6 insertions(+)\n>\n> diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h\n> index 75ac2c8f..9a5355c7 100644\n> --- a/include/libcamera/internal/mapped_framebuffer.h\n> +++ b/include/libcamera/internal/mapped_framebuffer.h\n> @@ -55,6 +55,7 @@ public:\n>  \tusing MapFlags = Flags<MapFlag>;\n>  \n>  \tMappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags);\n> +\tint getPlaneFD(int plane);\n\nThe argument shouldn't be negative -- should it be unsigned int?\n\n>  private:\n>  \tconst FrameBuffer *buffer_;\n> diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp\n> index f5ee770c..d5f347d4 100644\n> --- a/src/libcamera/mapped_framebuffer.cpp\n> +++ b/src/libcamera/mapped_framebuffer.cpp\n> @@ -242,4 +242,9 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)\n>  \tbuffer_ = buffer;\n>  }\n>  \n> +int MappedFrameBuffer::getPlaneFD(int plane)\n> +{\n> +\treturn buffer_->planes()[plane].fd.get();\n> +}\n> +\n>  } /* namespace libcamera */","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 3D370BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Jun 2025 17:22:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6447568DCB;\n\tMon, 16 Jun 2025 19:22:22 +0200 (CEST)","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 9FC8E68DC0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 19:22:20 +0200 (CEST)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-219-ZvY_W9KHP5KZDLXpA66Yzg-1; Mon, 16 Jun 2025 13:22:18 -0400","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-43eed325461so30631095e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 10:22:18 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4532e14f283sm151086445e9.27.2025.06.16.10.22.14\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 16 Jun 2025 10:22:15 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"hAoOAzIy\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1750094539;\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\tin-reply-to:in-reply-to:references:references;\n\tbh=baw81FFPE0k5CuDvsNlJyR+ybtkeWdU36ACrOp20Pz0=;\n\tb=hAoOAzIy4dP/fjKNN1NFISbqOhsmWxTkpBgF1LGW3fV/Sp3ZI+H5J6PfxoF1LKG+L/vBHJ\n\t2tjGEUQNo5mndNHdT9Oo0IwjWgjrS6Ktyw1Jjkc3CJGsJz/Ns8sKXiH4FC02OKht+onmAo\n\t/I0rtoiKiSEu1zHcsyZzws9KiGt4xog=","X-MC-Unique":"ZvY_W9KHP5KZDLXpA66Yzg-1","X-Mimecast-MFC-AGG-ID":"ZvY_W9KHP5KZDLXpA66Yzg_1750094537","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1750094537; x=1750699337;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=baw81FFPE0k5CuDvsNlJyR+ybtkeWdU36ACrOp20Pz0=;\n\tb=GRqsvTVb456yQ6o3rMM0XquxW3Ft5EC4JIBMEkjvSHLtVperzPElsMghf3crC1cqPa\n\tvUkiJetK9gDiDyTEjjP9Df/yiL4j7R2FjC9b39gyUDAIkpw7suX/Ihw6FxArouUTw/gN\n\tqDvK6SkRnI8W2mU9SqnoMjLEz79svKXZXUAKnxORov7wu+e0RlljDGeR9sjc3k7ZDoZn\n\tx9ug5QF+YIc26kOjt/cpPelhv8ps3jeGT7+Nm5mub7cpR7VJUQx2mnzxCMvpNcl7Gtev\n\tig8YpnZOrJXRsYnnbwrxMgoOEpToKXQyEtHm0jJyoT+o/6YkhhVFZr5eCsTSEmZ/Iz8Q\n\tSR7g==","X-Gm-Message-State":"AOJu0YwUP1426S7ATtKn4VLecaCPHWPokSLkKlDya84AAHUTw8NfOldI\n\tZRi2KCKTMUQ6HjMfI0bVLL3qC6zwN+bxF/8g5AoicxLNwnT4wlXkCs2OyfEq+S7ywVxIL+0YwiD\n\tKUkD9tov1dYwkbUZQCYYQYyWVHxrUw9VavDjUNB/eXgTkkh7KVqNDHro5Iqd8MMO0KYdZQTJmta\n\tqntJKwHtvfF1XUV9XMnVXuiIWnZUApakjimV/11S1Z2YeugfPlkIu3kp2+M3E=","X-Gm-Gg":"ASbGncuLMMXp6qAGkdkoZVDqxBfIq4DZEaMDjrz7vmfJtlGxLNaUVck44FPoYJjpznA\n\t5ZYm7EyQB4eYNmXCHo6zBkJtDUAF0YiXOfp0HuYQefxwI9bHvxeuiU5ckX1vQcFID9MOUkSDepr\n\tCG70gP9pgtBqYN7Kbr8DJcZTfTtoRKRBxKoqeDKdg9E1yfAco8wETPZwHuotoI7gW9/oyo1Gw7D\n\tWX9khMCdqzCZv33nUHPMtQOIF4SkRXMtwxrHv97ch+emZCBkj02/GoQB3tbyUztZtzLAOglyjqh\n\tJmRwA7D8iqiSBSVo+Trw8MrYzzA1bxcemirKODQ8xn2OWpvlKsUjbJFcz5DDR3Boe0doghE4NRM\n\t=","X-Received":["by 2002:a05:600c:8b61:b0:441:b3eb:570a with SMTP id\n\t5b1f17b1804b1-4533cacf371mr98197075e9.2.1750094536702; \n\tMon, 16 Jun 2025 10:22:16 -0700 (PDT)","by 2002:a05:600c:8b61:b0:441:b3eb:570a with SMTP id\n\t5b1f17b1804b1-4533cacf371mr98196775e9.2.1750094536141; \n\tMon, 16 Jun 2025 10:22:16 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFslbJWBTlM3pyVCRl4TqgJySfhVE2tqOJwugNu1ibvz6D66nhm+RapGRb0RHAhrSFQk1AU7g==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","In-Reply-To":"<20250611013245.133785-8-bryan.odonoghue@linaro.org> (Bryan\n\tO'Donoghue's message of \"Wed, 11 Jun 2025 02:32:17 +0100\")","References":"<20250611013245.133785-1-bryan.odonoghue@linaro.org>\n\t<20250611013245.133785-8-bryan.odonoghue@linaro.org>","Date":"Mon, 16 Jun 2025 19:22:14 +0200","Message-ID":"<85a567lhyx.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"rJJwGnbZ4QjKhkbgIHDQwqF0JJ9GaqwtmV7FYqnVKtM_1750094537","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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":34483,"web_url":"https://patchwork.libcamera.org/comment/34483/","msgid":"<f1b0af21-bd5f-43f2-8f30-ec467c1515f2@nxsw.ie>","date":"2025-06-16T18:55:52","subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","submitter":{"id":226,"url":"https://patchwork.libcamera.org/api/people/226/","name":"Bryan O'Donoghue","email":"bod.linux@nxsw.ie"},"content":"On 16/06/2025 18:22, Milan Zamazal wrote:\n>> comes from the fd given to eglCreateImageKHR.\n> So it's for future improvements not present in the current version,\n> right?\n\nRight.\n\n>> Signed-off-by: Bryan O'Donoghue<bryan.odonoghue@linaro.org>\n>> ---\n>>   include/libcamera/internal/mapped_framebuffer.h | 1 +\n>>   src/libcamera/mapped_framebuffer.cpp            | 5 +++++\n>>   2 files changed, 6 insertions(+)\n>>\n>> diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h\n>> index 75ac2c8f..9a5355c7 100644\n>> --- a/include/libcamera/internal/mapped_framebuffer.h\n>> +++ b/include/libcamera/internal/mapped_framebuffer.h\n>> @@ -55,6 +55,7 @@ public:\n>>   \tusing MapFlags = Flags<MapFlag>;\n>>\n>>   \tMappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags);\n>> +\tint getPlaneFD(int plane);\n> The argument shouldn't be negative -- should it be unsigned int?\n\nAh maybe, I thought I was returning the type \"int\" of the fd handle.\n\nI'll check again for the next version.\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 55DEEC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Jun 2025 18:56:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1C1CD68DCB;\n\tMon, 16 Jun 2025 20:56:00 +0200 (CEST)","from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C8B5468DC0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 20:55:57 +0200 (CEST)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n\tby dfw.source.kernel.org (Postfix) with ESMTP id 185805C5598;\n\tMon, 16 Jun 2025 18:53:40 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 4458AC4CEEA;\n\tMon, 16 Jun 2025 18:55:54 +0000 (UTC)"],"Message-ID":"<f1b0af21-bd5f-43f2-8f30-ec467c1515f2@nxsw.ie>","Date":"Mon, 16 Jun 2025 19:55:52 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","To":"Milan Zamazal <mzamazal@redhat.com>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20250611013245.133785-1-bryan.odonoghue@linaro.org>\n\t<20250611013245.133785-8-bryan.odonoghue@linaro.org>\n\t<PSn53lCI1lubS2g0F31Pg-sIyJrrD5I2AXXNXNsaYrs9Khm9Bov8uxbDqOTPHNFBYXPa-BwGnDc5yy4DvyJ-DQ==@protonmail.internalid>\n\t<85a567lhyx.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","Content-Language":"en-US","From":"Bryan O'Donoghue <bod.linux@nxsw.ie>","In-Reply-To":"<85a567lhyx.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","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":34495,"web_url":"https://patchwork.libcamera.org/comment/34495/","msgid":"<85jz5bjxus.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-06-16T19:22:03","subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Bryan O'Donoghue <bod.linux@nxsw.ie> writes:\n\n> On 16/06/2025 18:22, Milan Zamazal wrote:\n>>> comes from the fd given to eglCreateImageKHR.\n>> So it's for future improvements not present in the current version,\n>> right?\n>\n> Right.\n>\n>>> Signed-off-by: Bryan O'Donoghue<bryan.odonoghue@linaro.org>\n>>> ---\n>>>   include/libcamera/internal/mapped_framebuffer.h | 1 +\n>>>   src/libcamera/mapped_framebuffer.cpp            | 5 +++++\n>>>   2 files changed, 6 insertions(+)\n>>>\n>>> diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h\n>>> index 75ac2c8f..9a5355c7 100644\n>>> --- a/include/libcamera/internal/mapped_framebuffer.h\n>>> +++ b/include/libcamera/internal/mapped_framebuffer.h\n>>> @@ -55,6 +55,7 @@ public:\n>>>   \tusing MapFlags = Flags<MapFlag>;\n>>>\n>>>   \tMappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags);\n>>> +\tint getPlaneFD(int plane);\n>> The argument shouldn't be negative -- should it be unsigned int?\n>\n> Ah maybe, I thought I was returning the type \"int\" of the fd handle.\n\nTo avoid contingent confusion: I'm talking about `plane' type, not about\nthe return value of the function.\n\n> I'll check again for the next version.\n>\n> ---\n> bod","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 451F3BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Jun 2025 19:22:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E6D2C68DCF;\n\tMon, 16 Jun 2025 21:22:10 +0200 (CEST)","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 67B0268DC0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 21:22:09 +0200 (CEST)","from mail-wr1-f72.google.com (mail-wr1-f72.google.com\n\t[209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-685-MbHzycVbOQixP2bPuchwdw-1; Mon, 16 Jun 2025 15:22:07 -0400","by mail-wr1-f72.google.com with SMTP id\n\tffacd0b85a97d-3a4eee2398bso2067454f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Jun 2025 12:22:07 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-4531ff595b7sm134190015e9.2.2025.06.16.12.22.04\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 16 Jun 2025 12:22:04 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"ArRpUH4V\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1750101728;\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\tin-reply-to:in-reply-to:references:references;\n\tbh=QJyg6irup4stfi8UlXJJh0veZj9ce2YUZGo8I/rIQo0=;\n\tb=ArRpUH4VMgci3v4bVTHfhS/BTSSX3LVhcj+oeCpGXiXXKx0kedD0s5vV73Q7502m4+/Dhv\n\tUNe/VQgWYfFYZwOtGKoJIzMSWFzYfx+UR9ULkQeDlpO3QLVV4EHXXy0GoZzxp9AkC+xZRN\n\tCNYYJBBe4Gyi4L8s+sIPPoKllnVqRfM=","X-MC-Unique":"MbHzycVbOQixP2bPuchwdw-1","X-Mimecast-MFC-AGG-ID":"MbHzycVbOQixP2bPuchwdw_1750101726","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1750101725; x=1750706525;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=QJyg6irup4stfi8UlXJJh0veZj9ce2YUZGo8I/rIQo0=;\n\tb=NERvH3bKN5cPIVa7GglimMBZLPWnF6yFbaJq4fKRLlr3Gbp+6fkloYUslm5c1T4MVJ\n\tQS5vU6tvMCoBABb3FxA41R3aygBxOxSnxo6ZKn9J+4mi9QcxFwJI5qOFkKKjp8HYT7Qb\n\t8fZGZK0X4Diw8EIXvIDghL4ahBHb6u8HPo2SnvfGqVQDbT5fczQ879Y+DcGBoSppXvL8\n\tE+RWxDvGlSdMs1Ue7m8NBvb4e59qOII8Zxsl7NJC91uiaWFupKhSYcXx7lCaZKTUnV+R\n\t1RK0Q3mF8snDLk31Tc9FHQxLrC29joiJRyTJIfxkg99VdPmsnpMgwj8DQc/lGe6ruub1\n\tufHQ==","X-Gm-Message-State":"AOJu0YwjRL/Vam7Dd1z4fUMGJIkRl0UHp+6tw4wtB35DGwfexSxfOgMn\n\tbSaUBm2UFsi2pRNpVzVAzOEwp6Mr3Cmzoa8onC0WUgbS73JMq+LJMKwPQHWOpWtHJ6XDiNefrMA\n\tTdN+m5jAPv2zU2hB5AHv79TVss+d4WGnPkpvaRdmPAr0QrYbuiQTRzACsrWU20cb+bAfy0lmNgg\n\t8JsUSRg4lcAfzE8uY04GUr39giwkhcnRHrhYlSPLwKLfynSO7NNrPJ9LeyO0U=","X-Gm-Gg":"ASbGncvsST9CzhW6XLqa1o3EgwYwTqu/YOLTOPG0vvyjQfJsaNd0fs32vXVgyK0STk4\n\txnDrG+22DhqSnvguBhu/8g6n+b0G8gHitwQIBeYnzRAE+xf4T31EZE0mBYE1CNJOpBhhBL3UuO7\n\tMJI8Vqonv20+XyI3rDhMXmnz51NUcXP5QF9qydDBVo9hRCaaFMJGPTFTGDg0Sf3tlThShZ2V0Wj\n\t5pfSeLhPNV4YDuzTMVOZlMEQyBPCcf8Ry4LpWmqhoHgQ8X1D4W9aChW6928pNdTk+1eiEKrsBMc\n\tyJcDirYbPmP3tI4Wcxl8my8VlF+GdUOE2jcZFloPakPheJBV2JmcSOZXvZVoFUOF4aEfmtX7jTo\n\t=","X-Received":["by 2002:a5d:64c2:0:b0:3a5:2d42:aa25 with SMTP id\n\tffacd0b85a97d-3a572e55b64mr8040737f8f.50.1750101725603; \n\tMon, 16 Jun 2025 12:22:05 -0700 (PDT)","by 2002:a5d:64c2:0:b0:3a5:2d42:aa25 with SMTP id\n\tffacd0b85a97d-3a572e55b64mr8040727f8f.50.1750101725164; \n\tMon, 16 Jun 2025 12:22:05 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGtIf7qKKVKgsbGTs4U/pLxImgohMWsBnrjku4h1gJEwAf5uNrht94dHQnHp1G99lugVnrgbg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","In-Reply-To":"<f1b0af21-bd5f-43f2-8f30-ec467c1515f2@nxsw.ie> (Bryan\n\tO'Donoghue's message of \"Mon, 16 Jun 2025 19:55:52 +0100\")","References":"<20250611013245.133785-1-bryan.odonoghue@linaro.org>\n\t<20250611013245.133785-8-bryan.odonoghue@linaro.org>\n\t<PSn53lCI1lubS2g0F31Pg-sIyJrrD5I2AXXNXNsaYrs9Khm9Bov8uxbDqOTPHNFBYXPa-BwGnDc5yy4DvyJ-DQ==@protonmail.internalid>\n\t<85a567lhyx.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>\n\t<f1b0af21-bd5f-43f2-8f30-ec467c1515f2@nxsw.ie>","Date":"Mon, 16 Jun 2025 21:22:03 +0200","Message-ID":"<85jz5bjxus.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"PN2GcBQjsoz3yVKQ2Tds8xRliOhDBuhRDSPtHiDg2Hs_1750101726","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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":34542,"web_url":"https://patchwork.libcamera.org/comment/34542/","msgid":"<175024707652.3871677.4728059208668864698@ping.linuxembedded.co.uk>","date":"2025-06-18T11:44:36","subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Bryan O'Donoghue (2025-06-11 02:32:17)\n> Add MappedFrameBuffer::getPlaneFD() which takes a plane index and returns\n> the file descriptor associated with it.\n> \n> This fd will be used to feed into eglCreateImageKHR for both texture\n> creation on upload and directly render-to-texture where the texture buffer\n> comes from the fd given to eglCreateImageKHR.\n> \n> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>\n> ---\n>  include/libcamera/internal/mapped_framebuffer.h | 1 +\n>  src/libcamera/mapped_framebuffer.cpp            | 5 +++++\n>  2 files changed, 6 insertions(+)\n> \n> diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h\n> index 75ac2c8f..9a5355c7 100644\n> --- a/include/libcamera/internal/mapped_framebuffer.h\n> +++ b/include/libcamera/internal/mapped_framebuffer.h\n> @@ -55,6 +55,7 @@ public:\n>         using MapFlags = Flags<MapFlag>;\n>  \n>         MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags);\n> +       int getPlaneFD(int plane);\n>  \n>  private:\n>         const FrameBuffer *buffer_;\n> diff --git a/src/libcamera/mapped_framebuffer.cpp b/src/libcamera/mapped_framebuffer.cpp\n> index f5ee770c..d5f347d4 100644\n> --- a/src/libcamera/mapped_framebuffer.cpp\n> +++ b/src/libcamera/mapped_framebuffer.cpp\n> @@ -242,4 +242,9 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)\n>         buffer_ = buffer;\n>  }\n>  \n> +int MappedFrameBuffer::getPlaneFD(int plane)\n> +{\n> +       return buffer_->planes()[plane].fd.get();\n\nGiven the intrinsic usage of buffer_ here and how buffer_ isn't used in\nthe previous patch - I think I'd ask to merge these two patches to keep\nthe rationale together.\n\nThere should also probably be a if plane > buffer_->planes().size()\nreturn -EINVAL; too, though I expect that shouldn't ever get hit.\n\nAnd one reason for merging the two patches is I'm wondering here, will\nthe lifetime of buffer_ be sufficiently tied to the MappedFrameBuffer to\nensure it's accessible and valid? I suspect so - but I haven't checked\nit through.\n\nIt feels a bit odd that we're actually passing through the underlying\ninternals of the FrameBuffer here through the MappedFrameBuffer ... but\nI presume that's because at the stage you are operating on a\nMappedFrameBuffer - you do not have a direct reference to the underlying\nFrameBuffer?\n\n\n\n> +}\n> +\n>  } /* namespace libcamera */\n> -- \n> 2.49.0\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 83F32BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Jun 2025 11:44:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C592068DCC;\n\tWed, 18 Jun 2025 13:44:40 +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 A496668DC1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jun 2025 13:44:39 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7109A593;\n\tWed, 18 Jun 2025 13:44:26 +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=\"lIXkPYx6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750247066;\n\tbh=TbEE0dNgn3M5zNHprjbAXkpc2IAREg4Ae0diLLiLljA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=lIXkPYx6bSgE3Ix/y/nvp59wD8hc3pdarRV4Oj+8Le6Fl3EEVvu48SqnyTQc+eRHr\n\t8mUzb2mBbiQiuWx5ec//M6V2Uw3SItfGAWjHbkHw/SrTKNBkiFuQ9uArC6yz2nJgDf\n\tm0IhsDY9TbnWoht+bim+ccvLbZUfzEkJaHR3wCCE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250611013245.133785-8-bryan.odonoghue@linaro.org>","References":"<20250611013245.133785-1-bryan.odonoghue@linaro.org>\n\t<20250611013245.133785-8-bryan.odonoghue@linaro.org>","Subject":"Re: [PATCH 07/35] libcamera: MappedFrameBuffer: Add\n\tMappedFrameBuffer::getPlaneFD()","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>","To":"Bryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 18 Jun 2025 12:44:36 +0100","Message-ID":"<175024707652.3871677.4728059208668864698@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>"}}]