[{"id":26524,"web_url":"https://patchwork.libcamera.org/comment/26524/","msgid":"<20230302093939.2kmlh4ljlatzi5u3@uno.localdomain>","date":"2023-03-02T09:39:39","subject":"Re: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream\n\thints to StreamConfiguration","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nI've seen (and read) the huge backlog on this series, as I don't want\nto start the discussion over I will only review the most trivial\nthings if any but I guess the design has been debated already in great\ndetail\n\nOn Fri, Feb 03, 2023 at 09:44:17AM +0000, Naushir Patuck via libcamera-devel wrote:\n> Add a new hints flags field in the StreamConfiguration structure to allow the\n> application to specify certain intended behavior when driving libcamera.\n> Pipeline handlers are expected to look at these hint flags and may optimise\n> internal operations based on them.\n>\n> Currently, only one flag is listed, MandatoryStream, which the application can\n> set to inform the pipeline handler that a buffer will always be provided on\n> every Request for a given stream.\n>\n\nJust for sake of bikeshedding, the name says \"MandatoryStream\" but it\ninforms the ph that \"a buffer will always be provided with every\nrequest\". I would name it \"MandatoryBuffer\"\n\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  include/libcamera/stream.h |  8 ++++++++\n>  src/libcamera/stream.cpp   | 25 +++++++++++++++++++++++++\n>  2 files changed, 33 insertions(+)\n>\n> diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> index 29235ddf0d8a..56e5a74b2aab 100644\n> --- a/include/libcamera/stream.h\n> +++ b/include/libcamera/stream.h\n> @@ -13,6 +13,8 @@\n>  #include <string>\n>  #include <vector>\n>\n> +#include <libcamera/base/flags.h>\n> +\n>  #include <libcamera/color_space.h>\n>  #include <libcamera/framebuffer.h>\n>  #include <libcamera/geometry.h>\n> @@ -51,6 +53,12 @@ struct StreamConfiguration {\n>\n>  \tstd::optional<ColorSpace> colorSpace;\n>\n> +\tenum class Hint {\n> +\t\tNone = 0,\n> +\t\tMandatoryStream = (1 << 0),\n> +\t};\n> +\tFlags<Hint> hints;\n> +\n>  \tStream *stream() const { return stream_; }\n>  \tvoid setStream(Stream *stream) { stream_ = stream; }\n>  \tconst StreamFormats &formats() const { return formats_; }\n> diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> index 67f308157fbf..9b0e8dd548cf 100644\n> --- a/src/libcamera/stream.cpp\n> +++ b/src/libcamera/stream.cpp\n> @@ -349,6 +349,31 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n>   * color spaces can be supported and in what combinations.\n>   */\n>\n> +/**\n> + * \\enum StreamConfiguration::Hint\n> + * \\brief List of available hint flags provided by the application for a stream\n> + *\n> + * \\var StreamConfiguration::Hint::None\n> + * No hints for this stream.\n> + * \\var StreamConfiguration::Hint::MandatoryStream\n> + * Informs the pipeline handler that the application will always provide a\n> + * buffer for the configured stream in every Request. This may ensure the\n> + * pipeline handler does not need any additional stream buffer allocations for\n> + * internal use.\n\nI'm not sure if the last part is actually platform specific or not.\nOther pipeline migh use the hint for other reasons ? It can be changed\nlater if/when other PH will eventually use it\n\n> + */\n> +\n> +/**\n> + * \\var StreamConfiguration::hints\n> + * \\brief Application provided StreamConfiguration::Hint flags for specific\n> + * stream behavior\n\nI would just drop \"for specific stram behavior\"\n\n> + *\n> + * Provides hints from the application to the pipeline handlers on how it\n> + * intends on handling a given configured stream. These hints may alter the\n> + * behavior of the pipeline handlers, for example, by not allocating additional\n> + * buffers for internal use if an application guarantees buffers will be\n> + * provided in every Request for a stream.\n\nThis repeats the StreamConfiguration::Hint::MandatoryStream\ndocumentation.\n\nI would rather describe what happens if a hint is not supported by a\nplatform. Will the field be zeroed or adjusted ?\n\n> + */\n> +\n>  /**\n>   * \\fn StreamConfiguration::stream()\n>   * \\brief Retrieve the stream associated with the configuration\n> --\n> 2.25.1\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 58315BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Mar 2023 09:39:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C668F626C6;\n\tThu,  2 Mar 2023 10:39:44 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 634F1626A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Mar 2023 10:39:43 +0100 (CET)","from ideasonboard.com (host-87-18-61-24.retail.telecomitalia.it\n\t[87.18.61.24])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A04D156A;\n\tThu,  2 Mar 2023 10:39:42 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1677749984;\n\tbh=80juAIcv0gY+98XiUNHE53LsyypfqO0sHrBVZC9J60M=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=NWq5z+DUcN9vGKTq0PBMEKK5f86NnlQXCxaU4x9dz8FJmcD9Bifo4pyo1A8cbHq0Z\n\tapYLIo66P/OZw4f+BE5IcgAVBGWtlgxEG0CLGnu5nUOgPgEb2QpqZU/vYkp9A/jChZ\n\tFgEOlT19cV9+aSUhUWm7Pnz14jOweA6A83JUk8zKRzlQcMS3qgWJKSZQf0cH4bFX+n\n\tvNSYPel9qX+Pr5fsnjExknHHOYga6vjiZLFJDObT+oCwRoSGNl9bug/26nB63jYtlj\n\t7cHTQulyLBc1T8ddyylViKp/e5RVXt+/dh76AIisAZ5m5/1rLqFWht4V6Ab9AzaxO3\n\teG1s4sdl56veA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1677749982;\n\tbh=80juAIcv0gY+98XiUNHE53LsyypfqO0sHrBVZC9J60M=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=JLR9seNbSwBjS0yDntxeeaaz2+liyxniYSJJrpOpcfGr/Zi+jF4Yf94K3RdZ2d3n9\n\t25Blpy09lj/1GUmkdZR8IAZr9E6BSQI24xqS4pdM5KoULM7c8NirZUtyijBNSXIYCD\n\tlh5Cx2lodKac9yRsJ4JSVfCCel7DckeKKaiQtkDw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JLR9seNb\"; dkim-atps=neutral","Date":"Thu, 2 Mar 2023 10:39:39 +0100","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20230302093939.2kmlh4ljlatzi5u3@uno.localdomain>","References":"<20230203094424.25243-1-naush@raspberrypi.com>\n\t<20230203094424.25243-2-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230203094424.25243-2-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream\n\thints to StreamConfiguration","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26582,"web_url":"https://patchwork.libcamera.org/comment/26582/","msgid":"<167818433992.93391.10872860904430358079@Monstersaurus>","date":"2023-03-07T10:18:59","subject":"Re: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream\n\thints to StreamConfiguration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi via libcamera-devel (2023-03-02 09:39:39)\n> Hi Naush\n> \n> I've seen (and read) the huge backlog on this series, as I don't want\n> to start the discussion over I will only review the most trivial\n> things if any but I guess the design has been debated already in great\n> detail\n> \n> On Fri, Feb 03, 2023 at 09:44:17AM +0000, Naushir Patuck via libcamera-devel wrote:\n> > Add a new hints flags field in the StreamConfiguration structure to allow the\n> > application to specify certain intended behavior when driving libcamera.\n> > Pipeline handlers are expected to look at these hint flags and may optimise\n> > internal operations based on them.\n> >\n> > Currently, only one flag is listed, MandatoryStream, which the application can\n> > set to inform the pipeline handler that a buffer will always be provided on\n> > every Request for a given stream.\n> >\n> \n> Just for sake of bikeshedding, the name says \"MandatoryStream\" but it\n> informs the ph that \"a buffer will always be provided with every\n> request\". I would name it \"MandatoryBuffer\"\n\nBecause it's on the StreamConfiguration, My vote would be to stick with\nMandatoryStream.\n\n> \n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  include/libcamera/stream.h |  8 ++++++++\n> >  src/libcamera/stream.cpp   | 25 +++++++++++++++++++++++++\n> >  2 files changed, 33 insertions(+)\n> >\n> > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> > index 29235ddf0d8a..56e5a74b2aab 100644\n> > --- a/include/libcamera/stream.h\n> > +++ b/include/libcamera/stream.h\n> > @@ -13,6 +13,8 @@\n> >  #include <string>\n> >  #include <vector>\n> >\n> > +#include <libcamera/base/flags.h>\n> > +\n> >  #include <libcamera/color_space.h>\n> >  #include <libcamera/framebuffer.h>\n> >  #include <libcamera/geometry.h>\n> > @@ -51,6 +53,12 @@ struct StreamConfiguration {\n> >\n> >       std::optional<ColorSpace> colorSpace;\n> >\n> > +     enum class Hint {\n> > +             None = 0,\n> > +             MandatoryStream = (1 << 0),\n> > +     };\n> > +     Flags<Hint> hints;\n> > +\n> >       Stream *stream() const { return stream_; }\n> >       void setStream(Stream *stream) { stream_ = stream; }\n> >       const StreamFormats &formats() const { return formats_; }\n> > diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> > index 67f308157fbf..9b0e8dd548cf 100644\n> > --- a/src/libcamera/stream.cpp\n> > +++ b/src/libcamera/stream.cpp\n> > @@ -349,6 +349,31 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n> >   * color spaces can be supported and in what combinations.\n> >   */\n> >\n> > +/**\n> > + * \\enum StreamConfiguration::Hint\n> > + * \\brief List of available hint flags provided by the application for a stream\n> > + *\n> > + * \\var StreamConfiguration::Hint::None\n> > + * No hints for this stream.\n> > + * \\var StreamConfiguration::Hint::MandatoryStream\n> > + * Informs the pipeline handler that the application will always provide a\n> > + * buffer for the configured stream in every Request. This may ensure the\n> > + * pipeline handler does not need any additional stream buffer allocations for\n> > + * internal use.\n> \n> I'm not sure if the last part is actually platform specific or not.\n> Other pipeline migh use the hint for other reasons ? It can be changed\n> later if/when other PH will eventually use it\n\nI would expect the hint to be consistent on other platforms if it's used.\nWe would have the same restrictions/requirements.\n\n\n\n> \n> > + */\n> > +\n> > +/**\n> > + * \\var StreamConfiguration::hints\n> > + * \\brief Application provided StreamConfiguration::Hint flags for specific\n> > + * stream behavior\n> \n> I would just drop \"for specific stram behavior\"\n> \n> > + *\n> > + * Provides hints from the application to the pipeline handlers on how it\n> > + * intends on handling a given configured stream. These hints may alter the\n> > + * behavior of the pipeline handlers, for example, by not allocating additional\n> > + * buffers for internal use if an application guarantees buffers will be\n> > + * provided in every Request for a stream.\n> \n> This repeats the StreamConfiguration::Hint::MandatoryStream\n> documentation.\n> \n> I would rather describe what happens if a hint is not supported by a\n> platform. Will the field be zeroed or adjusted ?\n\nThat's an interesting idea. I had presumed hints were 'optional'\ndirections ... but zeroing out unsupported flags when it gets validated\nwould make sense as a way for the application to know if something would\nactually happen from the flag. But it probably wouldn't make much\ndifference? I guess it depends on how it's usage grows.\n\n\n\n> \n> > + */\n> > +\n> >  /**\n> >   * \\fn StreamConfiguration::stream()\n> >   * \\brief Retrieve the stream associated with the configuration\n> > --\n> > 2.25.1\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 E658BBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Mar 2023 10:19:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5124E626B0;\n\tTue,  7 Mar 2023 11:19:04 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE24D6265E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Mar 2023 11:19:02 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B53B4AD;\n\tTue,  7 Mar 2023 11:19:02 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678184344;\n\tbh=39pQY4tp4N9QNLJHjWIDGKKo+A4+BLVKFsFIFGDMb+c=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=u+FXGEyP0LpeYU8HKK1fWwSSGkAap+iSnrX0OF9XU01tQCAI/6qVD79VQTOmAOwMy\n\td/q0AbG2opSf+920a5jxBsooFljiynpzfpZo6TIY4olSV7ebKq5Jqm8cOIZF/xqT4q\n\tHbhuPwi4QqU/fJr6Ja3el0n0LSxFXLWtyQK9FEyqVx3KYN5RIfcMk6m2Ce0paFCV76\n\tMOBkukzY96tjkxukwAGKwX7oWn8jmoXC0uQkiICPgrHRzGkYANQ6c57/Rvy+4b1cY0\n\tqp1uGJSG/OIMFNP/eiXVy7RCcUii8kFqHr9Ec+ve9nM0Y+sjuIB3f2epK73EedcQbG\n\teQ+FTyTy7sNSA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678184342;\n\tbh=39pQY4tp4N9QNLJHjWIDGKKo+A4+BLVKFsFIFGDMb+c=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ISH5+FB8v3jBLCWzNoz2xke+M47eMhQLwx5j1xpffUcIYo6mhkFAHud8HlsCmLFqh\n\t5czPxdJj2ew8Lb4Hm5egoTgL3nxSIM3fqQLRkeP1i6i5Chn0dnd80K1tLEgzFrS3W8\n\tl/mXbFloQFGiKxWP3rhNMw0xTSkjSLDRLsngxf5k="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ISH5+FB8\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230302093939.2kmlh4ljlatzi5u3@uno.localdomain>","References":"<20230203094424.25243-1-naush@raspberrypi.com>\n\t<20230203094424.25243-2-naush@raspberrypi.com>\n\t<20230302093939.2kmlh4ljlatzi5u3@uno.localdomain>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tJacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>, \n\tNaushir Patuck <naush@raspberrypi.com>","Date":"Tue, 07 Mar 2023 10:18:59 +0000","Message-ID":"<167818433992.93391.10872860904430358079@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream\n\thints to StreamConfiguration","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26583,"web_url":"https://patchwork.libcamera.org/comment/26583/","msgid":"<CAEmqJPpA1Y0ttyPxuUa+7wxeyQRUz7iDD2v=RL4ow9ROZ5ESAg@mail.gmail.com>","date":"2023-03-07T10:38:11","subject":"Re: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream\n\thints to StreamConfiguration","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Kieran and Jacopo,\n\nOn Tue, 7 Mar 2023 at 10:19, Kieran Bingham <kieran.bingham@ideasonboard.com>\nwrote:\n\n> Quoting Jacopo Mondi via libcamera-devel (2023-03-02 09:39:39)\n> > Hi Naush\n> >\n> > I've seen (and read) the huge backlog on this series, as I don't want\n> > to start the discussion over I will only review the most trivial\n> > things if any but I guess the design has been debated already in great\n> > detail\n> >\n> > On Fri, Feb 03, 2023 at 09:44:17AM +0000, Naushir Patuck via\n> libcamera-devel wrote:\n> > > Add a new hints flags field in the StreamConfiguration structure to\n> allow the\n> > > application to specify certain intended behavior when driving\n> libcamera.\n> > > Pipeline handlers are expected to look at these hint flags and may\n> optimise\n> > > internal operations based on them.\n> > >\n> > > Currently, only one flag is listed, MandatoryStream, which the\n> application can\n> > > set to inform the pipeline handler that a buffer will always be\n> provided on\n> > > every Request for a given stream.\n> > >\n> >\n> > Just for sake of bikeshedding, the name says \"MandatoryStream\" but it\n> > informs the ph that \"a buffer will always be provided with every\n> > request\". I would name it \"MandatoryBuffer\"\n>\n> Because it's on the StreamConfiguration, My vote would be to stick with\n> MandatoryStream.\n>\n> >\n> > > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > > ---\n> > >  include/libcamera/stream.h |  8 ++++++++\n> > >  src/libcamera/stream.cpp   | 25 +++++++++++++++++++++++++\n> > >  2 files changed, 33 insertions(+)\n> > >\n> > > diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\n> > > index 29235ddf0d8a..56e5a74b2aab 100644\n> > > --- a/include/libcamera/stream.h\n> > > +++ b/include/libcamera/stream.h\n> > > @@ -13,6 +13,8 @@\n> > >  #include <string>\n> > >  #include <vector>\n> > >\n> > > +#include <libcamera/base/flags.h>\n> > > +\n> > >  #include <libcamera/color_space.h>\n> > >  #include <libcamera/framebuffer.h>\n> > >  #include <libcamera/geometry.h>\n> > > @@ -51,6 +53,12 @@ struct StreamConfiguration {\n> > >\n> > >       std::optional<ColorSpace> colorSpace;\n> > >\n> > > +     enum class Hint {\n> > > +             None = 0,\n> > > +             MandatoryStream = (1 << 0),\n> > > +     };\n> > > +     Flags<Hint> hints;\n> > > +\n> > >       Stream *stream() const { return stream_; }\n> > >       void setStream(Stream *stream) { stream_ = stream; }\n> > >       const StreamFormats &formats() const { return formats_; }\n> > > diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\n> > > index 67f308157fbf..9b0e8dd548cf 100644\n> > > --- a/src/libcamera/stream.cpp\n> > > +++ b/src/libcamera/stream.cpp\n> > > @@ -349,6 +349,31 @@ StreamConfiguration::StreamConfiguration(const\n> StreamFormats &formats)\n> > >   * color spaces can be supported and in what combinations.\n> > >   */\n> > >\n> > > +/**\n> > > + * \\enum StreamConfiguration::Hint\n> > > + * \\brief List of available hint flags provided by the application\n> for a stream\n> > > + *\n> > > + * \\var StreamConfiguration::Hint::None\n> > > + * No hints for this stream.\n> > > + * \\var StreamConfiguration::Hint::MandatoryStream\n> > > + * Informs the pipeline handler that the application will always\n> provide a\n> > > + * buffer for the configured stream in every Request. This may ensure\n> the\n> > > + * pipeline handler does not need any additional stream buffer\n> allocations for\n> > > + * internal use.\n> >\n> > I'm not sure if the last part is actually platform specific or not.\n> > Other pipeline migh use the hint for other reasons ? It can be changed\n> > later if/when other PH will eventually use it\n>\n> I would expect the hint to be consistent on other platforms if it's used.\n> We would have the same restrictions/requirements.\n>\n\nSee below :)\n\n\n>\n>\n>\n> >\n> > > + */\n> > > +\n> > > +/**\n> > > + * \\var StreamConfiguration::hints\n> > > + * \\brief Application provided StreamConfiguration::Hint flags for\n> specific\n> > > + * stream behavior\n> >\n> > I would just drop \"for specific stram behavior\"\n> >\n> > > + *\n> > > + * Provides hints from the application to the pipeline handlers on\n> how it\n> > > + * intends on handling a given configured stream. These hints may\n> alter the\n> > > + * behavior of the pipeline handlers, for example, by not allocating\n> additional\n> > > + * buffers for internal use if an application guarantees buffers will\n> be\n> > > + * provided in every Request for a stream.\n> >\n> > This repeats the StreamConfiguration::Hint::MandatoryStream\n> > documentation.\n> >\n> > I would rather describe what happens if a hint is not supported by a\n> > platform. Will the field be zeroed or adjusted ?\n>\n> That's an interesting idea. I had presumed hints were 'optional'\n> directions ... but zeroing out unsupported flags when it gets validated\n> would make sense as a way for the application to know if something would\n> actually happen from the flag. But it probably wouldn't make much\n> difference? I guess it depends on how it's usage grows.\n>\n\nMy intention for the \"hints\" is that they are all entirely optional to\nsupport\nin any pipeline handler.  Applications cannot and should not expect specific\nbehavioral change from the pipeline handlers based on the hints. They are\nexplicitly for the pipeline handler to understand how the application might\nbe\ndriving the API, and optimise some things (resource allocations in this\ncase) if\npossible.  As such, I didn't see a need for advertising hints that are\nhandled\nout of the pipeline handler.\n\nRegards,\nNaush\n\n\n>\n>\n> >\n> > > + */\n> > > +\n> > >  /**\n> > >   * \\fn StreamConfiguration::stream()\n> > >   * \\brief Retrieve the stream associated with the configuration\n> > > --\n> > > 2.25.1\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 E5734BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Mar 2023 10:38:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E086626B0;\n\tTue,  7 Mar 2023 11:38:21 +0100 (CET)","from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com\n\t[IPv6:2607:f8b0:4864:20::112f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A6A26265E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Mar 2023 11:38:19 +0100 (CET)","by mail-yw1-x112f.google.com with SMTP id\n\t00721157ae682-536bbe5f888so236706677b3.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Mar 2023 02:38:19 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678185501;\n\tbh=4LrGW5+7hc1todk1RBsfV13VHKtptBoJhVMwn3aefE8=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Oty5lfL6KT2o0QBSoJxL0nd/sphv3JcmrUz/tdov8YrNx41otfeTXRxr2SOQB9hsx\n\t+eVW6EKeag34+xKY2vlxRQD2YgPJW5XkVcMupszMpcYyXdB1UGcIxTVkFXmyMo74Xe\n\t7epBqx5kBwKJoezLcT7aLf+ynhHVnpEXj7yw2tFFDjjaS5BqdNya1L/X/mu5KY0frX\n\tUgg2Tle6fme8Na/nv06xiUkmGLuPZ+X+EEodpvbsVfJ4tgIhEjElWpXCxvmAVqk/HU\n\t226cRxVk98p7FAlTIUHkwOkt6Ic9KmnqpzhWzjZyUf4Zu7Vj/eq/RfqlOemw1LHjsY\n\tqAlzCvAp5GlHQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1678185498;\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=GbNm799UFseYPKbPhUYWKaF+OAPwrEYvlwNYXSmo1/U=;\n\tb=kLSUbPAF0X04tptqLcB6iKA1Rvx3NJtX0dvOd9+ZtCl9pEpYav/nE8Y088EiwLQEYx\n\tE1qo1XzuW8ywZc0Qp9Aq2J/DuMy2QrJ2uVeysxdtqB6b1Sx3Yy64o5auHCYzddLqg+Oy\n\tyLpfgl8ZP6K0LxqS/DOUGUnmdUNc6qOi7aAVCaXdCw1sIIehlMGZhzyuExQWfmHK5tas\n\tFuPCLBf1BJk6srYYDkHroip3w9muXcDD2zezzISuk68N/feTOEWVoJleVCIjxR7ZHxtN\n\thtA4xrjsPLoG1aQtfUqtZYwdzN7Em8h9OppzmtH0IT1OWG6WkMGHb6PJiRgX771Lh3Cr\n\tei0g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"kLSUbPAF\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678185498;\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=GbNm799UFseYPKbPhUYWKaF+OAPwrEYvlwNYXSmo1/U=;\n\tb=V3zt3vy7BUWZhfzRuzuAupkacL+U1KQrVwawFViysWK993arRSvmM1n/yq8FoTS7m3\n\tmoURUOJVQK+Z1FQRWqJCwxvkQLaUBpvjevei/lX+/tTho/K9J7ps8Cv1HZy3Qan2gok4\n\tY7/nNObmfysiVMaFPWITN7LCyejOaObyRta9l7V36BZSnB1yvQL8PwLBxn0xKTV8yTdO\n\teRRl4aZ9kusURtxHVTOqeszfIcCR+DBns8J3AD9ydGOjJeJsbPtGL1BB3sd7eqSjt5dv\n\tzxe5G8JDvuZpByMRdnyFQkEBDVpEQ5bTgvKob1wRBJd3jS4YNofL/L0u1/Zzem8o3Qju\n\tQALg==","X-Gm-Message-State":"AO0yUKW32ULATLD5p6eP5A1s8dx6o6PtgtYlr7KDbAXqd3go5cH0xF8Y\n\tVCXrlnNiddiTQitZiJOwrno2R/c/HyM1W+y5CqBP5p0CcKhulLP27b1xOA==","X-Google-Smtp-Source":"AK7set/w+B4+c+GxgIy+NmH/INeTJubt/Fvgw+AVG8CsAUmD251w+iTpHmYJnA5Kr+zeoJf5rGs3eSDS1N9ap6Vj9k4=","X-Received":"by 2002:a81:b717:0:b0:52f:45a:5b00 with SMTP id\n\tv23-20020a81b717000000b0052f045a5b00mr9039368ywh.2.1678185498160;\n\tTue, 07 Mar 2023 02:38:18 -0800 (PST)","MIME-Version":"1.0","References":"<20230203094424.25243-1-naush@raspberrypi.com>\n\t<20230203094424.25243-2-naush@raspberrypi.com>\n\t<20230302093939.2kmlh4ljlatzi5u3@uno.localdomain>\n\t<167818433992.93391.10872860904430358079@Monstersaurus>","In-Reply-To":"<167818433992.93391.10872860904430358079@Monstersaurus>","Date":"Tue, 7 Mar 2023 10:38:11 +0000","Message-ID":"<CAEmqJPpA1Y0ttyPxuUa+7wxeyQRUz7iDD2v=RL4ow9ROZ5ESAg@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"0000000000007c42c205f64d02a8\"","Subject":"Re: [libcamera-devel] [PATCH v1 1/8] libcamera: stream: Add stream\n\thints to StreamConfiguration","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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tJacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]