[{"id":4374,"web_url":"https://patchwork.libcamera.org/comment/4374/","msgid":"<CADFBUU+qtCGtpM9+Ruf7LxXGJ6=roxex2e5C2ih-aBTAtsZ4YA@mail.gmail.com>","date":"2020-04-03T16:10:34","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: pixelformats: Replace\n\tset of modifiers with single value","submitter":{"id":39,"url":"https://patchwork.libcamera.org/api/people/39/","name":"Kaaira Gupta","email":"kgupta@es.iitr.ac.in"},"content":"Sorry, forgot to add the 'Reviewed by' tag :/\n\nOn Fri, 3 Apr, 2020, 21:36 Kaaira Gupta, <kgupta@es.iitr.ac.in> wrote:\n\n> DRM fourccs look like they have a per-plane modifier, but in fact each\n> of them should be same. Hence instead of passing a set of modifiers for\n> each fourcc in PixelFormat class, we can pass just a single modifier.\n> So, replace the set with a single value.\n>\n> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n> ---\n> Changes since v1:\n>         - reformat the code.\n>         - Make commit message more articulate.\n>\n>  include/libcamera/pixelformats.h     |  6 +++---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp |  2 +-\n>  src/libcamera/pixelformats.cpp       | 24 ++++++++++++------------\n>  3 files changed, 16 insertions(+), 16 deletions(-)\n>\n> diff --git a/include/libcamera/pixelformats.h\n> b/include/libcamera/pixelformats.h\n> index 9ce6f7f..89966e5 100644\n> --- a/include/libcamera/pixelformats.h\n> +++ b/include/libcamera/pixelformats.h\n> @@ -19,7 +19,7 @@ class PixelFormat\n>  {\n>  public:\n>         PixelFormat();\n> -       explicit PixelFormat(uint32_t fourcc, const std::set<uint64_t>\n> &modifiers = {});\n> +       explicit PixelFormat(uint32_t fourcc, uint64_t modifier = 0);\n>\n>         bool operator==(const PixelFormat &other) const;\n>         bool operator!=(const PixelFormat &other) const { return !(*this\n> == other); }\n> @@ -29,13 +29,13 @@ public:\n>\n>         operator uint32_t() const { return fourcc_; }\n>         uint32_t fourcc() const { return fourcc_; }\n> -       const std::set<uint64_t> &modifiers() const { return modifiers_; }\n> +       uint64_t modifier() const { return modifier_; }\n>\n>         std::string toString() const;\n>\n>  private:\n>         uint32_t fourcc_;\n> -       std::set<uint64_t> modifiers_;\n> +       uint64_t modifier_;\n>  };\n>\n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 1e114ca..219b90b 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -365,7 +365,7 @@ CameraConfiguration::Status\n> IPU3CameraConfiguration::validate()\n>                 const Size size = cfg.size;\n>                 const IPU3Stream *stream;\n>\n> -               if\n> (cfg.pixelFormat.modifiers().count(IPU3_FORMAT_MOD_PACKED))\n> +               if (cfg.pixelFormat.modifier() == IPU3_FORMAT_MOD_PACKED)\n>                         stream = &data_->rawStream_;\n>                 else if (cfg.size == sensorFormat_.size)\n>                         stream = &data_->outStream_;\n> diff --git a/src/libcamera/pixelformats.cpp\n> b/src/libcamera/pixelformats.cpp\n> index 87557d9..1330dc5 100644\n> --- a/src/libcamera/pixelformats.cpp\n> +++ b/src/libcamera/pixelformats.cpp\n> @@ -19,9 +19,9 @@ namespace libcamera {\n>   * \\brief libcamera image pixel format\n>   *\n>   * The PixelFormat type describes the format of images in the public\n> libcamera\n> - * API. It stores a FourCC value as a 32-bit unsigned integer and a set of\n> - * modifiers. The FourCC and modifiers values are defined in the Linux\n> kernel\n> - * DRM/KMS API (see linux/drm_fourcc.h).\n> + * API. It stores a FourCC value as a 32-bit unsigned integer and a\n> modifier.\n> + * The FourCC and modifier values are defined in the Linux kernel DRM/KMS\n> API\n> + * (see linux/drm_fourcc.h).\n>   */\n>\n>  /**\n> @@ -36,12 +36,12 @@ PixelFormat::PixelFormat()\n>  }\n>\n>  /**\n> - * \\brief Construct a PixelFormat from a DRM FourCC and a set of modifiers\n> + * \\brief Construct a PixelFormat from a DRM FourCC and a modifier\n>   * \\param[in] fourcc A DRM FourCC\n> - * \\param[in] modifiers A set of DRM FourCC modifiers\n> + * \\param[in] modifier A DRM FourCC modifier\n>   */\n> -PixelFormat::PixelFormat(uint32_t fourcc, const std::set<uint64_t>\n> &modifiers)\n> -       : fourcc_(fourcc), modifiers_(modifiers)\n> +PixelFormat::PixelFormat(uint32_t fourcc, uint64_t modifier)\n> +       : fourcc_(fourcc), modifier_(modifier)\n>  {\n>  }\n>\n> @@ -51,7 +51,7 @@ PixelFormat::PixelFormat(uint32_t fourcc, const\n> std::set<uint64_t> &modifiers)\n>   */\n>  bool PixelFormat::operator==(const PixelFormat &other) const\n>  {\n> -       return fourcc_ == other.fourcc() && modifiers_ == other.modifiers_;\n> +       return fourcc_ == other.fourcc() && modifier_ == other.modifier_;\n>  }\n>\n>  /**\n> @@ -70,7 +70,7 @@ bool PixelFormat::operator<(const PixelFormat &other)\n> const\n>                 return true;\n>         if (fourcc_ > other.fourcc_)\n>                 return false;\n> -       return modifiers_ < modifiers_;\n> +       return modifier_ < other.modifier_;\n>  }\n>\n>  /**\n> @@ -97,9 +97,9 @@ bool PixelFormat::operator<(const PixelFormat &other)\n> const\n>   */\n>\n>  /**\n> - * \\fn PixelFormat::modifiers() const\n> - * \\brief Retrieve the pixel format modifiers\n> - * \\return Set of DRM modifiers\n> + * \\fn PixelFormat::modifier() const\n> + * \\brief Retrieve the pixel format modifier\n> + * \\return DRM modifier\n>   */\n>\n>  /**\n> --\n> 2.17.1\n>\n>","headers":{"Return-Path":"<kgupta@es.iitr.ac.in>","Received":["from mail-pl1-x641.google.com (mail-pl1-x641.google.com\n\t[IPv6:2607:f8b0:4864:20::641])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA2B1600FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Apr 2020 18:10:47 +0200 (CEST)","by mail-pl1-x641.google.com with SMTP id t4so2842114plq.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Apr 2020 09:10:47 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=es-iitr-ac-in.20150623.gappssmtp.com\n\theader.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b=\"mmJ6XkPw\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to;\n\tbh=yueHZM6BRCiRRaBumXL/VT6cyoeTiQLwnZESxrHv+KM=;\n\tb=mmJ6XkPwpD7Guh1tlsxngDR/xL2fa2cDMWfT1dioPPKuz1PEe4iAv2HFtEdvTqbxNc\n\t3rruwOvXD9c2MuKGzNIHQvO+Fea6JIxeU4v5LhLjnEPPMzCsegcuLyESVVW7EiCYrRxe\n\tCxbFd18ql/NKKYMcn5pVrFvrdUvlKRKqEvMBGArdsG3fpHOH7vqN7ASDBz3QzSQMXjLq\n\t4NgeN9F9a8UYrfvPX9R+JquFDhZLttY64pWZX4QrF8YbpqbSWgmIX5zTUbX+7aDTEd8S\n\tKAlWH33Ev74mPMzLdUMK5sYeEitn/C/jgqR3oYNZmtnHbyLDvXDuuBdHFcNeGWClweid\n\tpnQQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to;\n\tbh=yueHZM6BRCiRRaBumXL/VT6cyoeTiQLwnZESxrHv+KM=;\n\tb=HYd1rEAGjT/8b/xL9riQQfW5WJ40Kzg9wKG6oEABG4elrwH7qjin4cc21InGYlHSgj\n\tPjSuOAcG/1dHaW5COvcH4vUQWbqDrUpquqMdJy9aNZAMitdkvT+DMw0vGSSMzcWsYhER\n\trj1+YptLIuUhskvdbhsKyvDzGhtofhTf5420lOm4LKxNQrUVD1TifexqmenBitnpwQzD\n\tuNs0GjV57YdG+AwCYY9kxGwFJb0xgqs3IJN6QIgWnZOkk1uE5kq8A7sZDLhMn97PAiKx\n\tFSVIkwy796AbEESIUXp5PtvlpXBzROYvTpJSUzg73K290kPnkBvLbuC5Qr2ZMr1Z6h/Q\n\tiV5A==","X-Gm-Message-State":"AGi0PuYHq25C98A8QnvCrsWyHp6LO4+hobwMxuP2fDSLV6TF8jBmnvwH\n\trnz4aKKC8b+bq7PfM1dBYn979W1/VIalAy5BKyPwd/kG8PU=","X-Google-Smtp-Source":"APiQypI0EecDBiaYEfapjido6mc+WRxtorZLCEmdmvrIQlrFTNzCLtFwikDtB/y47wVy2Eoz74oTkv1rd+Tkcw84jpI=","X-Received":"by 2002:a17:90a:a414:: with SMTP id\n\ty20mr10747057pjp.124.1585930245971; \n\tFri, 03 Apr 2020 09:10:45 -0700 (PDT)","MIME-Version":"1.0","References":"<20200403160623.GA6354@kaaira-HP-Pavilion-Notebook>","In-Reply-To":"<20200403160623.GA6354@kaaira-HP-Pavilion-Notebook>","From":"KAAIRA GUPTA <kgupta@es.iitr.ac.in>","Date":"Fri, 3 Apr 2020 21:40:34 +0530","Message-ID":"<CADFBUU+qtCGtpM9+Ruf7LxXGJ6=roxex2e5C2ih-aBTAtsZ4YA@mail.gmail.com>","To":"libcamera-devel@lists.libcamera.org, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHelen Koike <helen.koike@collabora.com>, \n\tVaishali Thakkar <vthakkar@vaishalithakkar.in>","Content-Type":"multipart/alternative; boundary=\"000000000000f3388c05a265280c\"","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: pixelformats: Replace\n\tset of modifiers with single value","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>","X-List-Received-Date":"Fri, 03 Apr 2020 16:10:48 -0000"}},{"id":4375,"web_url":"https://patchwork.libcamera.org/comment/4375/","msgid":"<20200403211712.GE20301@pendragon.ideasonboard.com>","date":"2020-04-03T21:17:12","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: pixelformats: Replace\n\tset of modifiers with single value","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kaaira,\n\nThank you for the patch.\n\nOn Fri, Apr 03, 2020 at 09:36:23PM +0530, Kaaira Gupta wrote:\n> DRM fourccs look like they have a per-plane modifier, but in fact each\n> of them should be same. Hence instead of passing a set of modifiers for\n> each fourcc in PixelFormat class, we can pass just a single modifier.\n> So, replace the set with a single value.\n> \n> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n> Changes since v1:\n> \t- reformat the code.\n> \t- Make commit message more articulate.\n> \n>  include/libcamera/pixelformats.h     |  6 +++---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp |  2 +-\n>  src/libcamera/pixelformats.cpp       | 24 ++++++++++++------------\n>  3 files changed, 16 insertions(+), 16 deletions(-)\n> \n> diff --git a/include/libcamera/pixelformats.h b/include/libcamera/pixelformats.h\n> index 9ce6f7f..89966e5 100644\n> --- a/include/libcamera/pixelformats.h\n> +++ b/include/libcamera/pixelformats.h\n> @@ -19,7 +19,7 @@ class PixelFormat\n>  {\n>  public:\n>  \tPixelFormat();\n> -\texplicit PixelFormat(uint32_t fourcc, const std::set<uint64_t> &modifiers = {});\n> +\texplicit PixelFormat(uint32_t fourcc, uint64_t modifier = 0);\n>  \n>  \tbool operator==(const PixelFormat &other) const;\n>  \tbool operator!=(const PixelFormat &other) const { return !(*this == other); }\n> @@ -29,13 +29,13 @@ public:\n>  \n>  \toperator uint32_t() const { return fourcc_; }\n>  \tuint32_t fourcc() const { return fourcc_; }\n> -\tconst std::set<uint64_t> &modifiers() const { return modifiers_; }\n> +\tuint64_t modifier() const { return modifier_; }\n>  \n>  \tstd::string toString() const;\n>  \n>  private:\n>  \tuint32_t fourcc_;\n> -\tstd::set<uint64_t> modifiers_;\n> +\tuint64_t modifier_;\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 1e114ca..219b90b 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -365,7 +365,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\tconst Size size = cfg.size;\n>  \t\tconst IPU3Stream *stream;\n>  \n> -\t\tif (cfg.pixelFormat.modifiers().count(IPU3_FORMAT_MOD_PACKED))\n> +\t\tif (cfg.pixelFormat.modifier() == IPU3_FORMAT_MOD_PACKED)\n>  \t\t\tstream = &data_->rawStream_;\n>  \t\telse if (cfg.size == sensorFormat_.size)\n>  \t\t\tstream = &data_->outStream_;\n> diff --git a/src/libcamera/pixelformats.cpp b/src/libcamera/pixelformats.cpp\n> index 87557d9..1330dc5 100644\n> --- a/src/libcamera/pixelformats.cpp\n> +++ b/src/libcamera/pixelformats.cpp\n> @@ -19,9 +19,9 @@ namespace libcamera {\n>   * \\brief libcamera image pixel format\n>   *\n>   * The PixelFormat type describes the format of images in the public libcamera\n> - * API. It stores a FourCC value as a 32-bit unsigned integer and a set of\n> - * modifiers. The FourCC and modifiers values are defined in the Linux kernel\n> - * DRM/KMS API (see linux/drm_fourcc.h).\n> + * API. It stores a FourCC value as a 32-bit unsigned integer and a modifier.\n> + * The FourCC and modifier values are defined in the Linux kernel DRM/KMS API\n> + * (see linux/drm_fourcc.h).\n>   */\n>  \n>  /**\n> @@ -36,12 +36,12 @@ PixelFormat::PixelFormat()\n>  }\n>  \n>  /**\n> - * \\brief Construct a PixelFormat from a DRM FourCC and a set of modifiers\n> + * \\brief Construct a PixelFormat from a DRM FourCC and a modifier\n>   * \\param[in] fourcc A DRM FourCC\n> - * \\param[in] modifiers A set of DRM FourCC modifiers\n> + * \\param[in] modifier A DRM FourCC modifier\n>   */\n> -PixelFormat::PixelFormat(uint32_t fourcc, const std::set<uint64_t> &modifiers)\n> -\t: fourcc_(fourcc), modifiers_(modifiers)\n> +PixelFormat::PixelFormat(uint32_t fourcc, uint64_t modifier)\n> +\t: fourcc_(fourcc), modifier_(modifier)\n>  {\n>  }\n>  \n> @@ -51,7 +51,7 @@ PixelFormat::PixelFormat(uint32_t fourcc, const std::set<uint64_t> &modifiers)\n>   */\n>  bool PixelFormat::operator==(const PixelFormat &other) const\n>  {\n> -\treturn fourcc_ == other.fourcc() && modifiers_ == other.modifiers_;\n> +\treturn fourcc_ == other.fourcc() && modifier_ == other.modifier_;\n>  }\n>  \n>  /**\n> @@ -70,7 +70,7 @@ bool PixelFormat::operator<(const PixelFormat &other) const\n>  \t\treturn true;\n>  \tif (fourcc_ > other.fourcc_)\n>  \t\treturn false;\n> -\treturn modifiers_ < modifiers_;\n> +\treturn modifier_ < other.modifier_;\n>  }\n>  \n>  /**\n> @@ -97,9 +97,9 @@ bool PixelFormat::operator<(const PixelFormat &other) const\n>   */\n>  \n>  /**\n> - * \\fn PixelFormat::modifiers() const\n> - * \\brief Retrieve the pixel format modifiers\n> - * \\return Set of DRM modifiers\n> + * \\fn PixelFormat::modifier() const\n> + * \\brief Retrieve the pixel format modifier\n> + * \\return DRM modifier\n>   */\n>  \n>  /**","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F3B4600FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Apr 2020 23:17:22 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B4E47321;\n\tFri,  3 Apr 2020 23:17:21 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"QJtbJYil\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1585948641;\n\tbh=4KO4mgqemGkjZGo7vYjWUhjPaf6SiGa802gi+exmXVk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QJtbJYilmGqlwB4uCgX7B0EO++slVVz+QIaACRPSFJDlF4xjVsaqlcSeKec3qttWY\n\taIbFzmjhMX6vxX3MvUs3JP6nUGeSLt99y25F/RFhNSgiasZz9n/Jh8K9wfHK6UB+bd\n\tqTWorKvIErl12LmEvpu7GDnZmQmUld5Q29mL8bdg=","Date":"Sat, 4 Apr 2020 00:17:12 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kaaira Gupta <kgupta@es.iitr.ac.in>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHelen Koike <helen.koike@collabora.com>,\n\tVaishali Thakkar <vthakkar@vaishalithakkar.in>","Message-ID":"<20200403211712.GE20301@pendragon.ideasonboard.com>","References":"<20200403160623.GA6354@kaaira-HP-Pavilion-Notebook>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200403160623.GA6354@kaaira-HP-Pavilion-Notebook>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: pixelformats: Replace\n\tset of modifiers with single value","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>","X-List-Received-Date":"Fri, 03 Apr 2020 21:17:22 -0000"}},{"id":4376,"web_url":"https://patchwork.libcamera.org/comment/4376/","msgid":"<20200403215023.GF20301@pendragon.ideasonboard.com>","date":"2020-04-03T21:50:23","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: pixelformats: Replace\n\tset of modifiers with single value","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Kaaira,\n\nOn Sat, Apr 04, 2020 at 12:17:12AM +0300, Laurent Pinchart wrote:\n> On Fri, Apr 03, 2020 at 09:36:23PM +0530, Kaaira Gupta wrote:\n> > DRM fourccs look like they have a per-plane modifier, but in fact each\n> > of them should be same. Hence instead of passing a set of modifiers for\n> > each fourcc in PixelFormat class, we can pass just a single modifier.\n> > So, replace the set with a single value.\n> > \n> > Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nI'm actually getting compilation errors with clang :-S\n\n../../src/libcamera/pipeline/ipu3/ipu3.cpp:37:64: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init]\n        { MEDIA_BUS_FMT_SBGGR10_1X10, PixelFormat(DRM_FORMAT_SBGGR10, { IPU3_FORMAT_MOD_PACKED }) },\n                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~\n../../src/libcamera/pipeline/ipu3/ipu3.cpp:38:64: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init]\n        { MEDIA_BUS_FMT_SGBRG10_1X10, PixelFormat(DRM_FORMAT_SGBRG10, { IPU3_FORMAT_MOD_PACKED }) },\n                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~\n../../src/libcamera/pipeline/ipu3/ipu3.cpp:39:64: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init]\n        { MEDIA_BUS_FMT_SGRBG10_1X10, PixelFormat(DRM_FORMAT_SGRBG10, { IPU3_FORMAT_MOD_PACKED }) },\n                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~\n../../src/libcamera/pipeline/ipu3/ipu3.cpp:40:64: error: braces around scalar initializer [-Werror,-Wbraced-scalar-init]\n        { MEDIA_BUS_FMT_SRGGB10_1X10, PixelFormat(DRM_FORMAT_SRGGB10, { IPU3_FORMAT_MOD_PACKED }) },\n\nThat's easy enough to fix by removing the braces. I've done so and\npushed the patch.\n\nPlease record it in your contributions.\n\n> > ---\n> > Changes since v1:\n> > \t- reformat the code.\n> > \t- Make commit message more articulate.\n> > \n> >  include/libcamera/pixelformats.h     |  6 +++---\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp |  2 +-\n> >  src/libcamera/pixelformats.cpp       | 24 ++++++++++++------------\n> >  3 files changed, 16 insertions(+), 16 deletions(-)\n> > \n> > diff --git a/include/libcamera/pixelformats.h b/include/libcamera/pixelformats.h\n> > index 9ce6f7f..89966e5 100644\n> > --- a/include/libcamera/pixelformats.h\n> > +++ b/include/libcamera/pixelformats.h\n> > @@ -19,7 +19,7 @@ class PixelFormat\n> >  {\n> >  public:\n> >  \tPixelFormat();\n> > -\texplicit PixelFormat(uint32_t fourcc, const std::set<uint64_t> &modifiers = {});\n> > +\texplicit PixelFormat(uint32_t fourcc, uint64_t modifier = 0);\n> >  \n> >  \tbool operator==(const PixelFormat &other) const;\n> >  \tbool operator!=(const PixelFormat &other) const { return !(*this == other); }\n> > @@ -29,13 +29,13 @@ public:\n> >  \n> >  \toperator uint32_t() const { return fourcc_; }\n> >  \tuint32_t fourcc() const { return fourcc_; }\n> > -\tconst std::set<uint64_t> &modifiers() const { return modifiers_; }\n> > +\tuint64_t modifier() const { return modifier_; }\n> >  \n> >  \tstd::string toString() const;\n> >  \n> >  private:\n> >  \tuint32_t fourcc_;\n> > -\tstd::set<uint64_t> modifiers_;\n> > +\tuint64_t modifier_;\n> >  };\n> >  \n> >  } /* namespace libcamera */\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 1e114ca..219b90b 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -365,7 +365,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n> >  \t\tconst Size size = cfg.size;\n> >  \t\tconst IPU3Stream *stream;\n> >  \n> > -\t\tif (cfg.pixelFormat.modifiers().count(IPU3_FORMAT_MOD_PACKED))\n> > +\t\tif (cfg.pixelFormat.modifier() == IPU3_FORMAT_MOD_PACKED)\n> >  \t\t\tstream = &data_->rawStream_;\n> >  \t\telse if (cfg.size == sensorFormat_.size)\n> >  \t\t\tstream = &data_->outStream_;\n> > diff --git a/src/libcamera/pixelformats.cpp b/src/libcamera/pixelformats.cpp\n> > index 87557d9..1330dc5 100644\n> > --- a/src/libcamera/pixelformats.cpp\n> > +++ b/src/libcamera/pixelformats.cpp\n> > @@ -19,9 +19,9 @@ namespace libcamera {\n> >   * \\brief libcamera image pixel format\n> >   *\n> >   * The PixelFormat type describes the format of images in the public libcamera\n> > - * API. It stores a FourCC value as a 32-bit unsigned integer and a set of\n> > - * modifiers. The FourCC and modifiers values are defined in the Linux kernel\n> > - * DRM/KMS API (see linux/drm_fourcc.h).\n> > + * API. It stores a FourCC value as a 32-bit unsigned integer and a modifier.\n> > + * The FourCC and modifier values are defined in the Linux kernel DRM/KMS API\n> > + * (see linux/drm_fourcc.h).\n> >   */\n> >  \n> >  /**\n> > @@ -36,12 +36,12 @@ PixelFormat::PixelFormat()\n> >  }\n> >  \n> >  /**\n> > - * \\brief Construct a PixelFormat from a DRM FourCC and a set of modifiers\n> > + * \\brief Construct a PixelFormat from a DRM FourCC and a modifier\n> >   * \\param[in] fourcc A DRM FourCC\n> > - * \\param[in] modifiers A set of DRM FourCC modifiers\n> > + * \\param[in] modifier A DRM FourCC modifier\n> >   */\n> > -PixelFormat::PixelFormat(uint32_t fourcc, const std::set<uint64_t> &modifiers)\n> > -\t: fourcc_(fourcc), modifiers_(modifiers)\n> > +PixelFormat::PixelFormat(uint32_t fourcc, uint64_t modifier)\n> > +\t: fourcc_(fourcc), modifier_(modifier)\n> >  {\n> >  }\n> >  \n> > @@ -51,7 +51,7 @@ PixelFormat::PixelFormat(uint32_t fourcc, const std::set<uint64_t> &modifiers)\n> >   */\n> >  bool PixelFormat::operator==(const PixelFormat &other) const\n> >  {\n> > -\treturn fourcc_ == other.fourcc() && modifiers_ == other.modifiers_;\n> > +\treturn fourcc_ == other.fourcc() && modifier_ == other.modifier_;\n> >  }\n> >  \n> >  /**\n> > @@ -70,7 +70,7 @@ bool PixelFormat::operator<(const PixelFormat &other) const\n> >  \t\treturn true;\n> >  \tif (fourcc_ > other.fourcc_)\n> >  \t\treturn false;\n> > -\treturn modifiers_ < modifiers_;\n> > +\treturn modifier_ < other.modifier_;\n> >  }\n> >  \n> >  /**\n> > @@ -97,9 +97,9 @@ bool PixelFormat::operator<(const PixelFormat &other) const\n> >   */\n> >  \n> >  /**\n> > - * \\fn PixelFormat::modifiers() const\n> > - * \\brief Retrieve the pixel format modifiers\n> > - * \\return Set of DRM modifiers\n> > + * \\fn PixelFormat::modifier() const\n> > + * \\brief Retrieve the pixel format modifier\n> > + * \\return DRM modifier\n> >   */\n> >  \n> >  /**","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 B8C2C60104\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Apr 2020 23:50:32 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A4D2321;\n\tFri,  3 Apr 2020 23:50:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"fCK7I3aA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1585950632;\n\tbh=Q2sw1aa0pHbputGnBPy5x4cTS1CNDJxXtGg/bMReN2A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fCK7I3aA89zQVuneDpHE/FQJS9UcqgInS8kNSkMtDq50/WzmLL529CxU4oDkTB8yj\n\tyKwpxMfhzFvfo/kkF0hVDn4OI9FF9sZVXNoHqXJnxFGEMOf75tZdPAqbTrIQxvGcus\n\t1p6hmXzQ3s6w8b0d+X6XZNBA2ewFJaNrDj3vbRJo=","Date":"Sat, 4 Apr 2020 00:50:23 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kaaira Gupta <kgupta@es.iitr.ac.in>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tHelen Koike <helen.koike@collabora.com>,\n\tVaishali Thakkar <vthakkar@vaishalithakkar.in>","Message-ID":"<20200403215023.GF20301@pendragon.ideasonboard.com>","References":"<20200403160623.GA6354@kaaira-HP-Pavilion-Notebook>\n\t<20200403211712.GE20301@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200403211712.GE20301@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: pixelformats: Replace\n\tset of modifiers with single value","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>","X-List-Received-Date":"Fri, 03 Apr 2020 21:50:32 -0000"}}]