[{"id":38733,"web_url":"https://patchwork.libcamera.org/comment/38733/","msgid":"<20260505213125.GC1598374@killaraus.ideasonboard.com>","date":"2026-05-05T21:31:25","subject":"Re: [PATCH v1] libcamera: framebuffer: Fix cookie arg type","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, May 05, 2026 at 10:33:32AM +0200, Barnabás Pőcze wrote:\n> The cookie has type `uint64_t`, but the constructor argument is of type\n> `unsigned int`. Fix that.\n> \n> Unfortunately this is a public API and ABI change.\n\nWe just need to convince Linus to rename v7.2 to v8.0 to stay in sync\n:-)\n\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  include/libcamera/framebuffer.h | 2 +-\n>  src/libcamera/framebuffer.cpp   | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\n> index 723525d05..c633d22a6 100644\n> --- a/include/libcamera/framebuffer.h\n> +++ b/include/libcamera/framebuffer.h\n> @@ -58,7 +58,7 @@ public:\n>  \t\tunsigned int length;\n>  \t};\n>  \n> -\tFrameBuffer(Span<const Plane> planes, unsigned int cookie = 0);\n> +\tFrameBuffer(Span<const Plane> planes, uint64_t cookie = 0);\n>  \tFrameBuffer(std::unique_ptr<Private> d);\n>  \tvirtual ~FrameBuffer() {}\n>  \n> diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\n> index 765dab95a..d61319030 100644\n> --- a/src/libcamera/framebuffer.cpp\n> +++ b/src/libcamera/framebuffer.cpp\n> @@ -315,7 +315,7 @@ ino_t fileDescriptorInode(const SharedFD &fd)\n>   * \\param[in] planes The frame memory planes\n>   * \\param[in] cookie Cookie\n>   */\n> -FrameBuffer::FrameBuffer(Span<const Plane> planes, unsigned int cookie)\n> +FrameBuffer::FrameBuffer(Span<const Plane> planes, uint64_t cookie)\n>  \t: FrameBuffer(std::make_unique<Private>(planes, cookie))\n>  {\n>  }\n\nThis looks good, but I wonder if it's enough. The cookie is also passed\nto IPA modules as a way to identify buffers. It is used by mapBuffers(),\nunmapBuffers(), fillParams() and processStats(), and IPA modules\ncurrently use a 32-bit value.\n\nAs we only map stats and params buffers in IPA modules, and those are\nalways created by pipeline handlers, there's a guarantee the cookies\nwill fit in 32 bits. Still, this may be a time bomb, maybe we should fix\nit now instead of waiting for weird bugs ?\n\nThere's no point in delaying this patch, so\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThe IPA issue can be fixed on top.","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 50E81BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  5 May 2026 21:31:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7589462DC4;\n\tTue,  5 May 2026 23:31:28 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4955E62DC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 May 2026 23:31:27 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 424C81F8;\n\tTue,  5 May 2026 23:31:24 +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=\"HTT1CLZO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778016684;\n\tbh=7XG1ZRHjVZiY0C1/K4ETFLHakQVLcwgeVSpf7XdrqxQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HTT1CLZOYmJQU4KDrg17lJB4oAxKbLCIWok+nKimFQh57q3HHIy+QDdAYjBzeTbep\n\tw2lrN5Y3BMYSpIJe3W4B9HtkI0rR0sRO7/QhmfMKEBdWNsbogk8eCEtQux7bkorXaQ\n\tzS6dOGD/4pZoIB9bvRq6DtJU0nsG4xOZPGoGUnPI=","Date":"Wed, 6 May 2026 00:31:25 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1] libcamera: framebuffer: Fix cookie arg type","Message-ID":"<20260505213125.GC1598374@killaraus.ideasonboard.com>","References":"<20260505083332.610829-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260505083332.610829-1-barnabas.pocze@ideasonboard.com>","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":38739,"web_url":"https://patchwork.libcamera.org/comment/38739/","msgid":"<177805814011.3225262.2006259166703311211@ping.linuxembedded.co.uk>","date":"2026-05-06T09:02:20","subject":"Re: [PATCH v1] libcamera: framebuffer: Fix cookie arg type","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2026-05-05 22:31:25)\n> On Tue, May 05, 2026 at 10:33:32AM +0200, Barnabás Pőcze wrote:\n> > The cookie has type `uint64_t`, but the constructor argument is of type\n> > `unsigned int`. Fix that.\n> > \n> > Unfortunately this is a public API and ABI change.\n> \n> We just need to convince Linus to rename v7.2 to v8.0 to stay in sync\n> :-)\n> \n> > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> > ---\n> >  include/libcamera/framebuffer.h | 2 +-\n> >  src/libcamera/framebuffer.cpp   | 2 +-\n> >  2 files changed, 2 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\n> > index 723525d05..c633d22a6 100644\n> > --- a/include/libcamera/framebuffer.h\n> > +++ b/include/libcamera/framebuffer.h\n> > @@ -58,7 +58,7 @@ public:\n> >               unsigned int length;\n> >       };\n> >  \n> > -     FrameBuffer(Span<const Plane> planes, unsigned int cookie = 0);\n> > +     FrameBuffer(Span<const Plane> planes, uint64_t cookie = 0);\n\nI see the other usages in public API indeed use a uint64_t, so this\ndefinitely makes sense.\n\nIn my burden to try to protect the ABI, could we either put this on an\n'accepted for next ABI breakage branch' (maybe we'll end up with a\nlibcamera/next ?)\n\nor we could simply add the new uint64_t constructor now, and keep the\nunsigned int cookie constructor as a call to the uint64_t type ? That\nwould prevent ABI breakage ?\n\nWe could then drop the deprecated constructor later.\n\n\n> >       FrameBuffer(std::unique_ptr<Private> d);\n> >       virtual ~FrameBuffer() {}\n> >  \n> > diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\n> > index 765dab95a..d61319030 100644\n> > --- a/src/libcamera/framebuffer.cpp\n> > +++ b/src/libcamera/framebuffer.cpp\n> > @@ -315,7 +315,7 @@ ino_t fileDescriptorInode(const SharedFD &fd)\n> >   * \\param[in] planes The frame memory planes\n> >   * \\param[in] cookie Cookie\n> >   */\n> > -FrameBuffer::FrameBuffer(Span<const Plane> planes, unsigned int cookie)\n> > +FrameBuffer::FrameBuffer(Span<const Plane> planes, uint64_t cookie)\n> >       : FrameBuffer(std::make_unique<Private>(planes, cookie))\n> >  {\n> >  }\n> \n> This looks good, but I wonder if it's enough. The cookie is also passed\n> to IPA modules as a way to identify buffers. It is used by mapBuffers(),\n> unmapBuffers(), fillParams() and processStats(), and IPA modules\n> currently use a 32-bit value.\n> \n> As we only map stats and params buffers in IPA modules, and those are\n> always created by pipeline handlers, there's a guarantee the cookies\n> will fit in 32 bits. Still, this may be a time bomb, maybe we should fix\n> it now instead of waiting for weird bugs ?\n> \n> There's no point in delaying this patch, so\n\nExcept the ABI breakage!\n\n\n\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> The IPA issue can be fixed on top.\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 DB25CBDCB5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  6 May 2026 09:02:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BA51B6301E;\n\tWed,  6 May 2026 11:02:23 +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 6558762FE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  6 May 2026 11:02:22 +0200 (CEST)","from monstersaurus.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 199C178E;\n\tWed,  6 May 2026 11:02:19 +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=\"a2aQjoc0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1778058139;\n\tbh=6ffXTNnlVZ2+qUNMoAXuZIBl3tJqACVmrmi5zDydXI8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=a2aQjoc0XvMHtFHXbIwZecHVVekc5iHRdkiCgcDy3iIyIvcAIyY/3pGNl6be7uJph\n\tNWvSZjr8H/2F7QVBSuNyLN/MAELU2yNa/5E37hhEeVNevGftoKAjIXLMjGOlKuIbPx\n\tMaAfnrqPjlbA5q9MP0fd+Jf2wMZUVyF2iH7//I8A=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260505213125.GC1598374@killaraus.ideasonboard.com>","References":"<20260505083332.610829-1-barnabas.pocze@ideasonboard.com>\n\t<20260505213125.GC1598374@killaraus.ideasonboard.com>","Subject":"Re: [PATCH v1] libcamera: framebuffer: Fix cookie arg type","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Wed, 06 May 2026 10:02:20 +0100","Message-ID":"<177805814011.3225262.2006259166703311211@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>"}}]