[{"id":30917,"web_url":"https://patchwork.libcamera.org/comment/30917/","msgid":"<hqpwthnyvpjmepwgsmr6unsjmjpalkcclosy3pt5lmmfcbf7ag@dh6sohz6tdt2>","date":"2024-08-27T10:05:57","subject":"Re: [PATCH] libcamera: Make FrameBuffer status default to\n\tFrameSuccess","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Han-Lin\n\nOn Mon, Aug 26, 2024 at 01:46:30PM GMT, Harvey Yang wrote:\n> From: Han-Lin Chen <hanlinchen@chromium.org>\n>\n> There seems to be an assumption that a FrameBuffer is success unless\n> the pipeline handler canceled the frame, or there is a failure\n> processing the FrameBuffer.\n\nI'm not sure this is actually assumed anywhere.\n\nThe FrameMetadata status is set by the V4L2VideoDevice class at\ndequeue buffer time\n\nsrc/libcamera/v4l2_videodevice.cpp-     metadata.status = buf.flags & V4L2_BUF_FLAG_ERROR\nsrc/libcamera/v4l2_videodevice.cpp-                     ? FrameMetadata::FrameError\nsrc/libcamera/v4l2_videodevice.cpp:                     : FrameMetadata::FrameSuccess;\n\n>\n> Make the assumption specific.\n>\n> Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> ---\n>  include/libcamera/framebuffer.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\n> index 5ae2270b3..71202a1d2 100644\n> --- a/include/libcamera/framebuffer.h\n> +++ b/include/libcamera/framebuffer.h\n> @@ -33,7 +33,7 @@ struct FrameMetadata {\n>  \t\tunsigned int bytesused;\n>  \t};\n>\n> -\tStatus status;\n> +\tStatus status = FrameSuccess;\n>  \tunsigned int sequence;\n>  \tuint64_t timestamp;\n\nHowever, I don't think this hurts but I wonder why sequence or\ntimestamp are any different.\n\n>\n> --\n> 2.46.0.295.g3b9ea8a38a-goog\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 E0228C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Aug 2024 10:06:03 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A6E8D63453;\n\tTue, 27 Aug 2024 12:06:02 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C6D11633CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Aug 2024 12:06:00 +0200 (CEST)","from ideasonboard.com (mob-5-90-141-165.net.vodafone.it\n\t[5.90.141.165])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C53FD6A6;\n\tTue, 27 Aug 2024 12:04:53 +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=\"tiK3UbHE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724753093;\n\tbh=6pp2I+6pqJUcdHVNNgAU+4Eymz0HuBplP31iiVNjrfU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=tiK3UbHE7gnqvF/O+nU6RVJHmYj2EGe2UYGqGcZcROtSc20kQzPDXj+b5aaGPKdHn\n\tAM0XmrsKoKRly2deK81fdjVkFeQ1ZzPuBKNmyGDi2QnCTH0kzgKrHK02GxKL8lG/Ry\n\tlK6nm+nz/pCHY4KYuho7bewJ+SXhCHmI1hgrVI10=","Date":"Tue, 27 Aug 2024 12:05:57 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Harvey Yang <chenghaoyang@chromium.org>","Cc":"libcamera-devel@lists.libcamera.org, \n\tHan-Lin Chen <hanlinchen@chromium.org>","Subject":"Re: [PATCH] libcamera: Make FrameBuffer status default to\n\tFrameSuccess","Message-ID":"<hqpwthnyvpjmepwgsmr6unsjmjpalkcclosy3pt5lmmfcbf7ag@dh6sohz6tdt2>","References":"<20240826134639.1398830-1-chenghaoyang@google.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240826134639.1398830-1-chenghaoyang@google.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":30920,"web_url":"https://patchwork.libcamera.org/comment/30920/","msgid":"<CANJVT8dZSKUE08Y63Z2BjNFPXD=3fG7yVwcbf9LKwawByjCLpg@mail.gmail.com>","date":"2024-08-27T12:33:53","subject":"Re: [PATCH] libcamera: Make FrameBuffer status default to\n\tFrameSuccess","submitter":{"id":72,"url":"https://patchwork.libcamera.org/api/people/72/","name":"Han-lin Chen","email":"hanlinchen@google.com"},"content":"Hi Jacopo,\n\nOn Tue, Aug 27, 2024 at 6:06 PM Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nwrote:\n\n> Hi Han-Lin\n>\n> On Mon, Aug 26, 2024 at 01:46:30PM GMT, Harvey Yang wrote:\n> > From: Han-Lin Chen <hanlinchen@chromium.org>\n> >\n> > There seems to be an assumption that a FrameBuffer is success unless\n> > the pipeline handler canceled the frame, or there is a failure\n> > processing the FrameBuffer.\n>\n> I'm not sure this is actually assumed anywhere.\n>\n> The FrameMetadata status is set by the V4L2VideoDevice class at\n> dequeue buffer time\n>\n> src/libcamera/v4l2_videodevice.cpp-     metadata.status = buf.flags &\n> V4L2_BUF_FLAG_ERROR\n> src/libcamera/v4l2_videodevice.cpp-                     ?\n> FrameMetadata::FrameError\n> src/libcamera/v4l2_videodevice.cpp:                     :\n> FrameMetadata::FrameSuccess;\n>\n\nThanks!\nThe patch was a temporary workaround in our branch, and accidentally copied\nhere. Sorry for the confusion.\nThere was a time when the platform was not following the V4L2 spec and some\nbuffers may not go through the V4L2VideoDevice class, and the status\nremains undefined, causing some problems during development.\n\n>\n> > Make the assumption specific.\n> >\n> > Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org>\n> > ---\n> >  include/libcamera/framebuffer.h | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/include/libcamera/framebuffer.h\n> b/include/libcamera/framebuffer.h\n> > index 5ae2270b3..71202a1d2 100644\n> > --- a/include/libcamera/framebuffer.h\n> > +++ b/include/libcamera/framebuffer.h\n> > @@ -33,7 +33,7 @@ struct FrameMetadata {\n> >               unsigned int bytesused;\n> >       };\n> >\n> > -     Status status;\n> > +     Status status = FrameSuccess;\n> >       unsigned int sequence;\n> >       uint64_t timestamp;\n>\n> However, I don't think this hurts but I wonder why sequence or\n> timestamp are any different.\n>\n\nWe should re-format the patch to simply add default values to all fields,\nwith a clearer description.\n\n>\n> >\n> > --\n> > 2.46.0.295.g3b9ea8a38a-goog\n> >\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 F1A08C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Aug 2024 12:34:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E87E663460;\n\tTue, 27 Aug 2024 14:34:07 +0200 (CEST)","from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n\t[IPv6:2a00:1450:4864:20::330])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8415461901\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Aug 2024 14:34:06 +0200 (CEST)","by mail-wm1-x330.google.com with SMTP id\n\t5b1f17b1804b1-427fc9834deso51705e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Aug 2024 05:34:06 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"3XKAL4eV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=google.com; s=20230601; t=1724762046; x=1725366846;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=TDbr5tvBSnJRbKHUh2sIEZKSI0nSGFuhv1XJgcsQG0k=;\n\tb=3XKAL4eVZ7Ry9ITYBBzE9uXPGZoFPYU+rKcCiVyDaWJxpYbukrB5O9h/X6u5b+sEsK\n\t+I8tbIOuO+dpQsTXzm8ZbIXExvaVaBgWNX7UJmYpIrcptCJtg+1M0TtLx2StWBi9l8vs\n\tE4TpnLKOunF5HEvbLkaW7Xhm2gooTWLbKVtYtbF0KOvJeCHHDMHTDbnmWABWh8pd0mIg\n\tjP4E3Sd9mKsuDSl/DLdKNappcfjcilV3vRiNMBolrmYXvFk1EBvrSdkgNzsCU4cIr3fE\n\tJyK2FHD0nnbMPQk5d/JYT/TUjAbl8OFN+UMxwroaL/cyKye/WiNzNA6ueuaxgF4yGQOr\n\tVpBQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1724762046; x=1725366846;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=TDbr5tvBSnJRbKHUh2sIEZKSI0nSGFuhv1XJgcsQG0k=;\n\tb=Rt4y/iy21RnAbeu5eJH4WzgrGfqqwYbcRvjdxuH6OYp6OTU3F2rLrVjulQTBH6vk08\n\t4690v3VYvKJmpTEA9BW56POm1kThIhhXuDhkztpTC0xNKU0hz2Pu986Fd/Alfc3jJytD\n\tbSxBzb2TeqoVsvDjPGy5WMQB9GM+ARPm1ZxGfZ/1h+lKXPrHAhwuT5X4aZwMjDLCKbIH\n\tiy/EHFKM0ec2Q67B+oLZ3z2GA7ukyfz6rxr+XDG/e31TwoolU9CFpuTq8rHTGXN0pIye\n\tL1GlJCluMcgzfhMUJYMs7QoNuTeirX1/rvVSgNzAVbtAZ5/uB8/cA2smiGEmab6KMa34\n\tUmiQ==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCXkAI+Smu90sdEZzZuOpCcJn3bLgFtpQI3RjgYb9yPnCZUEnMbzBQN562SE9C7DuUoU/fSecDM7D2sFQCJsvXw=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YwEX6HAOTxllLysqBRw04XWL5TGN8y9qlZTOKYK1B2N+r4DNzQJ\n\ts6FDerAVirzaWQ5fL6sgGKZcbFG5uRnuWNpnDQCxsiCf/F/yHKhLyzx6j/PxcHEo5LrCYChlL3S\n\tCtQESPmEac7tLF46+06zSCI/QzKnN3wie4BWU","X-Google-Smtp-Source":"AGHT+IEtX3yERzMCg4+38WME8rt941kaT3aq+Tt3B2cMijTuR8ltCSuKgl2e+7QNidvpX6x1owrr+HuMlDTD6ITUZ4w=","X-Received":"by 2002:a05:600c:1e01:b0:42b:8ff7:bee2 with SMTP id\n\t5b1f17b1804b1-42b9db85301mr956555e9.5.1724762045348; Tue, 27 Aug 2024\n\t05:34:05 -0700 (PDT)","MIME-Version":"1.0","References":"<20240826134639.1398830-1-chenghaoyang@google.com>\n\t<hqpwthnyvpjmepwgsmr6unsjmjpalkcclosy3pt5lmmfcbf7ag@dh6sohz6tdt2>","In-Reply-To":"<hqpwthnyvpjmepwgsmr6unsjmjpalkcclosy3pt5lmmfcbf7ag@dh6sohz6tdt2>","From":"Han-lin Chen <hanlinchen@google.com>","Date":"Tue, 27 Aug 2024 20:33:53 +0800","Message-ID":"<CANJVT8dZSKUE08Y63Z2BjNFPXD=3fG7yVwcbf9LKwawByjCLpg@mail.gmail.com>","Subject":"Re: [PATCH] libcamera: Make FrameBuffer status default to\n\tFrameSuccess","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Harvey Yang <chenghaoyang@chromium.org>,\n\tlibcamera-devel@lists.libcamera.org, \n\tHan-Lin Chen <hanlinchen@chromium.org>","Content-Type":"multipart/alternative; boundary=\"000000000000095cd20620a97540\"","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>"}}]