[{"id":5162,"web_url":"https://patchwork.libcamera.org/comment/5162/","msgid":"<20200610142701.GC192296@oden.dyn.berto.se>","date":"2020-06-10T14:27:01","subject":"Re: [libcamera-devel] [PATCH v2 1/7] libcamera: Define constants\n\tfor pixel formats in the public API","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-06-10 02:23:17 +0300, Laurent Pinchart wrote:\n> libcamera uses pixel format FourCC and modifier values from DRM. This\n> requires inclusion of drm_fourcc.h, creating a dependency on a header\n> that is packaged differently between distributions, and causing possible\n> issues with third-party applications.\n> \n> Define constants for the supported pixel formats in the new formats.h\n> public API header, in order to remove the dependency on drm_fourcc.h.\n> The header is generated by a Python script from a list of supported\n> formats. The numerical values for the FourCC and modifier are extracted\n> from drm_fourcc.h by the script, ensuring that numerical values are not\n> inadvertently modified and preserving the direct interoperability.\n> \n> The pixel formats constants can't be generated solely from drm_fourcc.h,\n> as that header defines FourCC values and modifier values, but doesn't\n> list the valid combinations. The supported formats are thus stored in a\n> YAML file, which contains the FourCC and optional modifier for each\n> supported format. We may later extend the YAML file to include formats\n> documentation, and possibly formats metadata to populate the\n> pixelFormatInfo map (in formats.cpp) automatically.\n> \n> Now that two formats.h header are present (one in include/libcamera/ and\n> one in include/libcamera/internal/), we need to explicitly qualify the\n> Doxygen \\file directive with a path.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n> Changes since v1:\n> \n> - Add a note about the Doxygen \\file change to the commit message\n> - Generate formats.h from formats.yaml\n> - Dropped Kieran's R-b tag due to the switch to auto-generation\n> - Mention libcamera/formats.h in the PixelFormat class documentation\n> - Add IPU3-packed Bayer formats\n> ---\n>  include/libcamera/formats.h.in   |  44 +++++++++++\n>  include/libcamera/gen-formats.py | 118 +++++++++++++++++++++++++++++\n>  include/libcamera/meson.build    |  22 ++++++\n>  src/libcamera/formats.cpp        |   2 +-\n>  src/libcamera/formats.yaml       | 124 +++++++++++++++++++++++++++++++\n>  src/libcamera/pixel_format.cpp   |   4 +-\n>  6 files changed, 312 insertions(+), 2 deletions(-)\n>  create mode 100644 include/libcamera/formats.h.in\n>  create mode 100755 include/libcamera/gen-formats.py\n>  create mode 100644 src/libcamera/formats.yaml\n> \n> diff --git a/include/libcamera/formats.h.in b/include/libcamera/formats.h.in\n> new file mode 100644\n> index 000000000000..8e7b95812afa\n> --- /dev/null\n> +++ b/include/libcamera/formats.h.in\n> @@ -0,0 +1,44 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2020, Google Inc.\n> + *\n> + * formats.h - Formats\n> + *\n> + * This file is auto-generated. Do not edit.\n> + */\n> +#ifndef __LIBCAMERA_FORMATS_H__\n> +#define __LIBCAMERA_FORMATS_H__\n> +\n> +#include <stdint.h>\n> +\n> +#include <libcamera/pixel_format.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace formats {\n> +\n> +namespace {\n> +\n> +constexpr uint32_t __fourcc(char a, char b, char c, char d)\n> +{\n> +\treturn (static_cast<uint32_t>(a) <<  0) |\n> +\t       (static_cast<uint32_t>(b) <<  8) |\n> +\t       (static_cast<uint32_t>(c) << 16) |\n> +\t       (static_cast<uint32_t>(d) << 24);\n> +}\n> +\n> +constexpr uint64_t __mod(unsigned int vendor, unsigned int mod)\n> +{\n> +\treturn (static_cast<uint64_t>(vendor) << 56) |\n> +\t       (static_cast<uint64_t>(mod) << 0);\n> +}\n> +\n> +} /* namespace */\n> +\n> +${formats}\n> +\n> +} /* namespace formats */\n> +\n> +} /* namespace libcamera */\n> +\n> +#endif /* __LIBCAMERA_FORMATS_H__ */\n> diff --git a/include/libcamera/gen-formats.py b/include/libcamera/gen-formats.py\n> new file mode 100755\n> index 000000000000..9bbff5f1cf6f\n> --- /dev/null\n> +++ b/include/libcamera/gen-formats.py\n> @@ -0,0 +1,118 @@\n> +#!/usr/bin/env python3\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +# Copyright (C) 2020, Google Inc.\n> +#\n> +# Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> +#\n> +# gen-formatss.py - Generate formats definitions from YAML\n> +\n> +import argparse\n> +import re\n> +import string\n> +import sys\n> +import yaml\n> +\n> +\n> +class DRMFourCC(object):\n> +    format_regex = re.compile(r\"#define (DRM_FORMAT_[A-Z0-9_]+)[ \\t]+fourcc_code\\(('.', '.', '.', '.')\\)\")\n> +    mod_vendor_regex = re.compile(r\"#define DRM_FORMAT_MOD_VENDOR_([A-Z0-9_]+)[ \\t]+([0-9a-fA-Fx]+)\")\n> +    mod_regex = re.compile(r\"#define ([A-Za-z0-9_]+)[ \\t]+fourcc_mod_code\\(([A-Z0-9_]+), ([0-9a-fA-Fx]+)\\)\")\n> +\n> +    def __init__(self, filename):\n> +        self.formats = {}\n> +        self.vendors = {}\n> +        self.mods = {}\n> +\n> +        for line in open(filename, 'rb').readlines():\n> +            line = line.decode('utf-8')\n> +\n> +            match = DRMFourCC.format_regex.match(line)\n> +            if match:\n> +                format, fourcc = match.groups()\n> +                self.formats[format] = fourcc\n> +                continue\n> +\n> +            match = DRMFourCC.mod_vendor_regex.match(line)\n> +            if match:\n> +                vendor, value = match.groups()\n> +                self.vendors[vendor] = int(value, 0)\n> +                continue\n> +\n> +            match = DRMFourCC.mod_regex.match(line)\n> +            if match:\n> +                mod, vendor, value = match.groups()\n> +                self.mods[mod] = (vendor, int(value, 0))\n> +                continue\n> +\n> +    def fourcc(self, name):\n> +        return self.formats[name]\n> +\n> +    def mod(self, name):\n> +        vendor, value = self.mods[name]\n> +        return self.vendors[vendor], value\n> +\n> +\n> +def generate_h(formats, drm_fourcc):\n> +    template = string.Template('constexpr PixelFormat ${name}{ __fourcc(${fourcc}), __mod(${mod}) };')\n> +\n> +    fmts = []\n> +\n> +    for format in formats:\n> +        name, format = format.popitem()\n> +\n> +        data = {\n> +            'name': name,\n> +            'fourcc': drm_fourcc.fourcc(format['fourcc']),\n> +            'mod': '0, 0',\n> +        }\n> +\n> +        mod = format.get('mod')\n> +        if mod:\n> +            data['mod'] = '%u, %u' % drm_fourcc.mod(mod)\n> +\n> +        fmts.append(template.substitute(data))\n> +\n> +    return {'formats': '\\n'.join(fmts)}\n> +\n> +\n> +def fill_template(template, data):\n> +\n> +    template = open(template, 'rb').read()\n> +    template = template.decode('utf-8')\n> +    template = string.Template(template)\n> +    return template.substitute(data)\n> +\n> +\n> +def main(argv):\n> +\n> +    # Parse command line arguments\n> +    parser = argparse.ArgumentParser()\n> +    parser.add_argument('-o', dest='output', metavar='file', type=str,\n> +                        help='Output file name. Defaults to standard output if not specified.')\n> +    parser.add_argument('input', type=str,\n> +                        help='Input file name.')\n> +    parser.add_argument('template', type=str,\n> +                        help='Template file name.')\n> +    parser.add_argument('drm_fourcc', type=str,\n> +                        help='Path to drm_fourcc.h.')\n> +    args = parser.parse_args(argv[1:])\n> +\n> +    data = open(args.input, 'rb').read()\n> +    formats = yaml.safe_load(data)['formats']\n> +    drm_fourcc = DRMFourCC(args.drm_fourcc)\n> +\n> +    data = generate_h(formats, drm_fourcc)\n> +    data = fill_template(args.template, data)\n> +\n> +    if args.output:\n> +        output = open(args.output, 'wb')\n> +        output.write(data.encode('utf-8'))\n> +        output.close()\n> +    else:\n> +        sys.stdout.write(data)\n> +\n> +    return 0\n> +\n> +\n> +if __name__ == '__main__':\n> +    sys.exit(main(sys.argv))\n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 73c5b999acf4..cdb8e0372e77 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -29,6 +29,11 @@ subdir('ipa')\n>  install_headers(libcamera_public_headers,\n>                  subdir : include_dir)\n>  \n> +#\n> +# Generate headers from templates.\n> +#\n> +\n> +# control_ids.h and property_ids.h\n>  gen_controls = files('../../src/libcamera/gen-controls.py')\n>  \n>  control_source_files = [\n> @@ -51,6 +56,22 @@ endforeach\n>  \n>  libcamera_public_headers += control_headers\n>  \n> +# formats.h\n> +gen_formats = files('gen-formats.py')\n> +\n> +formats_h = custom_target('formats_h',\n> +                          input : files(\n> +                              '../../src/libcamera/formats.yaml',\n> +                              'formats.h.in',\n> +                              '../linux/drm_fourcc.h'\n> +                          ),\n> +                          output : 'formats.h',\n> +                          command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n> +                          install : true,\n> +                          install_dir : join_paths('include', include_dir))\n> +libcamera_public_headers += formats_h\n> +\n> +# libcamera.h\n>  gen_header = files('gen-header.sh')\n>  \n>  libcamera_h = custom_target('gen-header',\n> @@ -62,6 +83,7 @@ libcamera_h = custom_target('gen-header',\n>  \n>  libcamera_public_headers += libcamera_h\n>  \n> +# version.h\n>  version = libcamera_version.split('.')\n>  libcamera_version_config = configuration_data()\n>  libcamera_version_config.set('LIBCAMERA_VERSION_MAJOR', version[0])\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 2ac3b412ecdb..74c239a5e710 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -12,7 +12,7 @@\n>  #include \"libcamera/internal/log.h\"\n>  \n>  /**\n> - * \\file formats.h\n> + * \\file internal/formats.h\n>   * \\brief Types and helper methods to handle libcamera image formats\n>   */\n>  \n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> new file mode 100644\n> index 000000000000..a6841c618f93\n> --- /dev/null\n> +++ b/src/libcamera/formats.yaml\n> @@ -0,0 +1,124 @@\n> +# SPDX-License-Identifier: LGPL-2.1-or-later\n> +#\n> +# Copyright (C) 2020, Google Inc.\n> +#\n> +%YAML 1.2\n> +---\n> +formats:\n> +  - R8:\n> +      fourcc: DRM_FORMAT_R8\n> +\n> +  - RGB888:\n> +      fourcc: DRM_FORMAT_RGB888\n> +  - BGR888:\n> +      fourcc: DRM_FORMAT_BGR888\n> +\n> +  - XRGB8888:\n> +      fourcc: DRM_FORMAT_XRGB8888\n> +  - XBGR8888:\n> +      fourcc: DRM_FORMAT_XBGR8888\n> +  - RGBX8888:\n> +      fourcc: DRM_FORMAT_RGBX8888\n> +  - BGRX8888:\n> +      fourcc: DRM_FORMAT_BGRX8888\n> +\n> +  - ARGB8888:\n> +      fourcc: DRM_FORMAT_ARGB8888\n> +  - ABGR8888:\n> +      fourcc: DRM_FORMAT_ABGR8888\n> +  - RGBA8888:\n> +      fourcc: DRM_FORMAT_RGBA8888\n> +  - BGRA8888:\n> +      fourcc: DRM_FORMAT_BGRA8888\n> +\n> +  - YUYV:\n> +      fourcc: DRM_FORMAT_YUYV\n> +  - YVYU:\n> +      fourcc: DRM_FORMAT_YVYU\n> +  - UYVY:\n> +      fourcc: DRM_FORMAT_UYVY\n> +  - VYUY:\n> +      fourcc: DRM_FORMAT_VYUY\n> +\n> +  - NV12:\n> +      fourcc: DRM_FORMAT_NV12\n> +  - NV21:\n> +      fourcc: DRM_FORMAT_NV21\n> +  - NV16:\n> +      fourcc: DRM_FORMAT_NV16\n> +  - NV61:\n> +      fourcc: DRM_FORMAT_NV61\n> +  - NV24:\n> +      fourcc: DRM_FORMAT_NV24\n> +  - NV42:\n> +      fourcc: DRM_FORMAT_NV42\n> +\n> +  - MJPEG:\n> +      fourcc: DRM_FORMAT_MJPEG\n> +\n> +  - SRGGB8:\n> +      fourcc: DRM_FORMAT_SRGGB8\n> +  - SGRBG8:\n> +      fourcc: DRM_FORMAT_SGRBG8\n> +  - SGBRG8:\n> +      fourcc: DRM_FORMAT_SGBRG8\n> +  - SBGGR8:\n> +      fourcc: DRM_FORMAT_SBGGR8\n> +\n> +  - SRGGB10:\n> +      fourcc: DRM_FORMAT_SRGGB10\n> +  - SGRBG10:\n> +      fourcc: DRM_FORMAT_SGRBG10\n> +  - SGBRG10:\n> +      fourcc: DRM_FORMAT_SGBRG10\n> +  - SBGGR10:\n> +      fourcc: DRM_FORMAT_SBGGR10\n> +\n> +  - SRGGB12:\n> +      fourcc: DRM_FORMAT_SRGGB12\n> +  - SGRBG12:\n> +      fourcc: DRM_FORMAT_SGRBG12\n> +  - SGBRG12:\n> +      fourcc: DRM_FORMAT_SGBRG12\n> +  - SBGGR12:\n> +      fourcc: DRM_FORMAT_SBGGR12\n> +\n> +  - SRGGB10_CSI2P:\n> +      fourcc: DRM_FORMAT_SRGGB10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGRBG10_CSI2P:\n> +      fourcc: DRM_FORMAT_SGRBG10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGBRG10_CSI2P:\n> +      fourcc: DRM_FORMAT_SGBRG10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SBGGR10_CSI2P:\n> +      fourcc: DRM_FORMAT_SBGGR10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +\n> +  - SRGGB12_CSI2P:\n> +      fourcc: DRM_FORMAT_SRGGB12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGRBG12_CSI2P:\n> +      fourcc: DRM_FORMAT_SGRBG12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGBRG12_CSI2P:\n> +      fourcc: DRM_FORMAT_SGBRG12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SBGGR12_CSI2P:\n> +      fourcc: DRM_FORMAT_SBGGR12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +\n> +  - SRGGB10_IPU3:\n> +      fourcc: DRM_FORMAT_SRGGB10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +  - SGRBG10_IPU3:\n> +      fourcc: DRM_FORMAT_SGRBG10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +  - SGBRG10_IPU3:\n> +      fourcc: DRM_FORMAT_SGBRG10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +  - SBGGR10_IPU3:\n> +      fourcc: DRM_FORMAT_SBGGR10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +...\n> diff --git a/src/libcamera/pixel_format.cpp b/src/libcamera/pixel_format.cpp\n> index d501c5f09c6b..f191851ae22c 100644\n> --- a/src/libcamera/pixel_format.cpp\n> +++ b/src/libcamera/pixel_format.cpp\n> @@ -5,6 +5,7 @@\n>   * pixel_format.cpp - libcamera Pixel Format\n>   */\n>  \n> +#include <libcamera/formats.h>\n>  #include <libcamera/pixel_format.h>\n>  \n>  /**\n> @@ -21,7 +22,8 @@ namespace libcamera {\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 modifier.\n>   * The FourCC and modifier values are defined in the Linux kernel DRM/KMS API\n> - * (see linux/drm_fourcc.h).\n> + * (see linux/drm_fourcc.h). Constant expressions for all pixel formats\n> + * supported by libcamera are available in libcamera/formats.h.\n>   */\n>  \n>  /**\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 51517600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Jun 2020 16:27:03 +0200 (CEST)","by mail-lj1-x241.google.com with SMTP id a9so2736378ljn.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Jun 2020 07:27:03 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tx69sm5881157lff.19.2020.06.10.07.27.01\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Jun 2020 07:27:01 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com header.b=\"szMo6p1N\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=BREf4oFjEESTS0m4GFYSHmBscCQyNyKnZglbcwd9PCo=;\n\tb=szMo6p1N1S5U0sbnrOfYuf+uV3FUEw9fDgoFBJ41cb+xnnuInbmYXWU9WKS7fzM2Qt\n\tqhpyjUPIbURgQQsKZ0Fnwxtxg47BFaaF7h9Iedz6hrhq39ePQzt6rYrrF0cZzzEyD2r2\n\tpnld6mAKo1i5cvLHpbig7vlTg78yraERSVBam6kGY9+s2Amc5cjVZ83ZoiwPFU6EjBKl\n\tUkotFr8RNSh64wdvkgjbXnLU9ZRCZTW8qBK6i5jJ6SV84TROMhlvc5I2BpwinVnlqkHQ\n\t9QTTOpxEEAeqtXedhkiXvUbu+e2ALXhCW17iqMXE7EnnOmTg4VXW1bIz9cnIA+AyC0Dr\n\tzOSA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=BREf4oFjEESTS0m4GFYSHmBscCQyNyKnZglbcwd9PCo=;\n\tb=INVzwRvZ7wU7K8yA4OHVPB+so10jj6+55/Ude6PuEtMeI0QHtod+d511Jwg/e6SYHN\n\tyHSbZgfwS0phf5Mqwz62Qc/M1eGh6vMeUO5/xp5mw8huEWhDjhWv8vMsenx5T/RqDTJG\n\tvq3ayafLMQjxsLdcZHWgMT628aa9gf6HCj717M+ept2zgu3FH0wLkGw7848t2E9bZ/tT\n\tXkLbJtGmRJDzA+Yf5ZoFHHAHckwMBBYZbQgZYO/4D54oTPyOfJvwsBayOeUYTtjb7UY3\n\to2YrXAt/Hn0HRJNidh1/JlVN1RrOHc0L63QOxbtas1tGxHyMHSVIWokuhBTQ6scURNTj\n\tN2YQ==","X-Gm-Message-State":"AOAM5310DfZ5WcJF37+Bxd15e+lGzXQxS3TIXufbFlXDeVZn4jmoPgbD\n\tS6hUgeJSqsJGmuVErszud6A7iV9UfCE=","X-Google-Smtp-Source":"ABdhPJxOvLyCvWezA1+EVPjF6LaPx7ZvVkFlQpomi+6weGRp0v9SyJHRsNs9X0Lc275s22rxFXYCNQ==","X-Received":"by 2002:a2e:844f:: with SMTP id\n\tu15mr1823746ljh.466.1591799222544; \n\tWed, 10 Jun 2020 07:27:02 -0700 (PDT)","Date":"Wed, 10 Jun 2020 16:27:01 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200610142701.GC192296@oden.dyn.berto.se>","References":"<20200609232323.29628-1-laurent.pinchart@ideasonboard.com>\n\t<20200609232323.29628-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200609232323.29628-2-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2 1/7] libcamera: Define constants\n\tfor pixel formats in the public API","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":"Wed, 10 Jun 2020 14:27:03 -0000"}},{"id":5203,"web_url":"https://patchwork.libcamera.org/comment/5203/","msgid":"<ea7012e9-b352-58e9-5283-1013ceac9c6e@ideasonboard.com>","date":"2020-06-15T11:04:34","subject":"Re: [libcamera-devel] [PATCH v2 1/7] libcamera: Define constants\n\tfor pixel formats in the public API","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 10/06/2020 00:23, Laurent Pinchart wrote:\n> libcamera uses pixel format FourCC and modifier values from DRM. This\n> requires inclusion of drm_fourcc.h, creating a dependency on a header\n> that is packaged differently between distributions, and causing possible\n> issues with third-party applications.\n> \n> Define constants for the supported pixel formats in the new formats.h\n> public API header, in order to remove the dependency on drm_fourcc.h.\n> The header is generated by a Python script from a list of supported\n> formats. The numerical values for the FourCC and modifier are extracted\n> from drm_fourcc.h by the script, ensuring that numerical values are not\n> inadvertently modified and preserving the direct interoperability.\n> \n> The pixel formats constants can't be generated solely from drm_fourcc.h,\n> as that header defines FourCC values and modifier values, but doesn't\n> list the valid combinations. The supported formats are thus stored in a\n> YAML file, which contains the FourCC and optional modifier for each\n> supported format. We may later extend the YAML file to include formats\n> documentation, and possibly formats metadata to populate the\n> pixelFormatInfo map (in formats.cpp) automatically.\n> \n> Now that two formats.h header are present (one in include/libcamera/ and\n> one in include/libcamera/internal/), we need to explicitly qualify the\n> Doxygen \\file directive with a path.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n> Changes since v1:\n> \n> - Add a note about the Doxygen \\file change to the commit message\n> - Generate formats.h from formats.yaml\n> - Dropped Kieran's R-b tag due to the switch to auto-generation\n\n\n\n> - Mention libcamera/formats.h in the PixelFormat class documentation\n> - Add IPU3-packed Bayer formats\n> ---\n>  include/libcamera/formats.h.in   |  44 +++++++++++\n>  include/libcamera/gen-formats.py | 118 +++++++++++++++++++++++++++++\n>  include/libcamera/meson.build    |  22 ++++++\n>  src/libcamera/formats.cpp        |   2 +-\n>  src/libcamera/formats.yaml       | 124 +++++++++++++++++++++++++++++++\n>  src/libcamera/pixel_format.cpp   |   4 +-\n>  6 files changed, 312 insertions(+), 2 deletions(-)\n>  create mode 100644 include/libcamera/formats.h.in\n>  create mode 100755 include/libcamera/gen-formats.py\n>  create mode 100644 src/libcamera/formats.yaml\n> \n> diff --git a/include/libcamera/formats.h.in b/include/libcamera/formats.h.in\n> new file mode 100644\n> index 000000000000..8e7b95812afa\n> --- /dev/null\n> +++ b/include/libcamera/formats.h.in\n> @@ -0,0 +1,44 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2020, Google Inc.\n> + *\n> + * formats.h - Formats\n> + *\n> + * This file is auto-generated. Do not edit.\n> + */\n> +#ifndef __LIBCAMERA_FORMATS_H__\n> +#define __LIBCAMERA_FORMATS_H__\n> +\n> +#include <stdint.h>\n> +\n> +#include <libcamera/pixel_format.h>\n> +\n> +namespace libcamera {\n> +\n> +namespace formats {\n> +\n> +namespace {\n> +\n> +constexpr uint32_t __fourcc(char a, char b, char c, char d)\n> +{\n> +\treturn (static_cast<uint32_t>(a) <<  0) |\n> +\t       (static_cast<uint32_t>(b) <<  8) |\n> +\t       (static_cast<uint32_t>(c) << 16) |\n> +\t       (static_cast<uint32_t>(d) << 24);\n> +}\n> +\n> +constexpr uint64_t __mod(unsigned int vendor, unsigned int mod)\n> +{\n> +\treturn (static_cast<uint64_t>(vendor) << 56) |\n> +\t       (static_cast<uint64_t>(mod) << 0);\n> +}\n> +\n> +} /* namespace */\n> +\n> +${formats}\n> +\n> +} /* namespace formats */\n> +\n> +} /* namespace libcamera */\n> +\n> +#endif /* __LIBCAMERA_FORMATS_H__ */\n> diff --git a/include/libcamera/gen-formats.py b/include/libcamera/gen-formats.py\n> new file mode 100755\n> index 000000000000..9bbff5f1cf6f\n> --- /dev/null\n> +++ b/include/libcamera/gen-formats.py\n> @@ -0,0 +1,118 @@\n> +#!/usr/bin/env python3\n> +# SPDX-License-Identifier: GPL-2.0-or-later\n> +# Copyright (C) 2020, Google Inc.\n> +#\n> +# Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> +#\n> +# gen-formatss.py - Generate formats definitions from YAML\n\ns/gen-formatss/gen-formats/\n\n> +\n> +import argparse\n> +import re\n> +import string\n> +import sys\n> +import yaml\n> +\n> +\n> +class DRMFourCC(object):\n> +    format_regex = re.compile(r\"#define (DRM_FORMAT_[A-Z0-9_]+)[ \\t]+fourcc_code\\(('.', '.', '.', '.')\\)\")\n> +    mod_vendor_regex = re.compile(r\"#define DRM_FORMAT_MOD_VENDOR_([A-Z0-9_]+)[ \\t]+([0-9a-fA-Fx]+)\")\n> +    mod_regex = re.compile(r\"#define ([A-Za-z0-9_]+)[ \\t]+fourcc_mod_code\\(([A-Z0-9_]+), ([0-9a-fA-Fx]+)\\)\")\n> +\n> +    def __init__(self, filename):\n> +        self.formats = {}\n> +        self.vendors = {}\n> +        self.mods = {}\n> +\n> +        for line in open(filename, 'rb').readlines():\n> +            line = line.decode('utf-8')\n> +\n> +            match = DRMFourCC.format_regex.match(line)\n> +            if match:\n> +                format, fourcc = match.groups()\n> +                self.formats[format] = fourcc\n> +                continue\n> +\n> +            match = DRMFourCC.mod_vendor_regex.match(line)\n> +            if match:\n> +                vendor, value = match.groups()\n> +                self.vendors[vendor] = int(value, 0)\n> +                continue\n> +\n> +            match = DRMFourCC.mod_regex.match(line)\n> +            if match:\n> +                mod, vendor, value = match.groups()\n> +                self.mods[mod] = (vendor, int(value, 0))\n> +                continue\n> +\n> +    def fourcc(self, name):\n> +        return self.formats[name]\n> +\n> +    def mod(self, name):\n> +        vendor, value = self.mods[name]\n> +        return self.vendors[vendor], value\n> +\n> +\n> +def generate_h(formats, drm_fourcc):\n> +    template = string.Template('constexpr PixelFormat ${name}{ __fourcc(${fourcc}), __mod(${mod}) };')\n> +\n> +    fmts = []\n> +\n> +    for format in formats:\n> +        name, format = format.popitem()\n> +\n> +        data = {\n> +            'name': name,\n> +            'fourcc': drm_fourcc.fourcc(format['fourcc']),\n> +            'mod': '0, 0',\n> +        }\n> +\n> +        mod = format.get('mod')\n> +        if mod:\n> +            data['mod'] = '%u, %u' % drm_fourcc.mod(mod)\n> +\n> +        fmts.append(template.substitute(data))\n> +\n> +    return {'formats': '\\n'.join(fmts)}\n> +\n> +\n> +def fill_template(template, data):\n> +\n> +    template = open(template, 'rb').read()\n> +    template = template.decode('utf-8')\n> +    template = string.Template(template)\n> +    return template.substitute(data)\n\nNice, I didn't know about pythons built in string Template ..\n\n> +\n> +\n> +def main(argv):\n> +\n> +    # Parse command line arguments\n> +    parser = argparse.ArgumentParser()\n> +    parser.add_argument('-o', dest='output', metavar='file', type=str,\n> +                        help='Output file name. Defaults to standard output if not specified.')\n> +    parser.add_argument('input', type=str,\n> +                        help='Input file name.')\n> +    parser.add_argument('template', type=str,\n> +                        help='Template file name.')\n> +    parser.add_argument('drm_fourcc', type=str,\n> +                        help='Path to drm_fourcc.h.')\n> +    args = parser.parse_args(argv[1:])\n> +\n> +    data = open(args.input, 'rb').read()\n> +    formats = yaml.safe_load(data)['formats']\n> +    drm_fourcc = DRMFourCC(args.drm_fourcc)\n> +\n> +    data = generate_h(formats, drm_fourcc)\n> +    data = fill_template(args.template, data)\n> +\n> +    if args.output:\n> +        output = open(args.output, 'wb')\n> +        output.write(data.encode('utf-8'))\n> +        output.close()\n> +    else:\n> +        sys.stdout.write(data)\n> +\n> +    return 0\n> +\n> +\n> +if __name__ == '__main__':\n> +    sys.exit(main(sys.argv))\n> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build\n> index 73c5b999acf4..cdb8e0372e77 100644\n> --- a/include/libcamera/meson.build\n> +++ b/include/libcamera/meson.build\n> @@ -29,6 +29,11 @@ subdir('ipa')\n>  install_headers(libcamera_public_headers,\n>                  subdir : include_dir)\n>  \n> +#\n> +# Generate headers from templates.\n> +#\n> +\n> +# control_ids.h and property_ids.h\n>  gen_controls = files('../../src/libcamera/gen-controls.py')\n>  \n>  control_source_files = [\n> @@ -51,6 +56,22 @@ endforeach\n>  \n>  libcamera_public_headers += control_headers\n>  \n> +# formats.h\n> +gen_formats = files('gen-formats.py')\n> +\n> +formats_h = custom_target('formats_h',\n> +                          input : files(\n> +                              '../../src/libcamera/formats.yaml',\n> +                              'formats.h.in',\n> +                              '../linux/drm_fourcc.h'\n> +                          ),\n> +                          output : 'formats.h',\n> +                          command : [gen_formats, '-o', '@OUTPUT@', '@INPUT@'],\n> +                          install : true,\n> +                          install_dir : join_paths('include', include_dir))\n> +libcamera_public_headers += formats_h\n> +\n> +# libcamera.h\n>  gen_header = files('gen-header.sh')\n>  \n>  libcamera_h = custom_target('gen-header',\n> @@ -62,6 +83,7 @@ libcamera_h = custom_target('gen-header',\n>  \n>  libcamera_public_headers += libcamera_h\n>  \n> +# version.h\n>  version = libcamera_version.split('.')\n>  libcamera_version_config = configuration_data()\n>  libcamera_version_config.set('LIBCAMERA_VERSION_MAJOR', version[0])\n> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\n> index 2ac3b412ecdb..74c239a5e710 100644\n> --- a/src/libcamera/formats.cpp\n> +++ b/src/libcamera/formats.cpp\n> @@ -12,7 +12,7 @@\n>  #include \"libcamera/internal/log.h\"\n>  \n>  /**\n> - * \\file formats.h\n> + * \\file internal/formats.h\n>   * \\brief Types and helper methods to handle libcamera image formats\n>   */\n>  \n> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml\n> new file mode 100644\n> index 000000000000..a6841c618f93\n> --- /dev/null\n> +++ b/src/libcamera/formats.yaml\n> @@ -0,0 +1,124 @@\n> +# SPDX-License-Identifier: LGPL-2.1-or-later\n> +#\n> +# Copyright (C) 2020, Google Inc.\n> +#\n> +%YAML 1.2\n> +---\n> +formats:\n> +  - R8:\n> +      fourcc: DRM_FORMAT_R8\n> +\n\n\nInitially, I was going to ask why not mask out the redundant DRM_FORMAT_\nand just populate the fourcc by appending the name to the prefix,\n\nHowever, now I think I prefer being explicit as it gives a good tie to\nthe 'actual' format source.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n> +  - RGB888:\n> +      fourcc: DRM_FORMAT_RGB888\n> +  - BGR888:\n> +      fourcc: DRM_FORMAT_BGR888\n> +\n> +  - XRGB8888:\n> +      fourcc: DRM_FORMAT_XRGB8888\n> +  - XBGR8888:\n> +      fourcc: DRM_FORMAT_XBGR8888\n> +  - RGBX8888:\n> +      fourcc: DRM_FORMAT_RGBX8888\n> +  - BGRX8888:\n> +      fourcc: DRM_FORMAT_BGRX8888\n> +\n> +  - ARGB8888:\n> +      fourcc: DRM_FORMAT_ARGB8888\n> +  - ABGR8888:\n> +      fourcc: DRM_FORMAT_ABGR8888\n> +  - RGBA8888:\n> +      fourcc: DRM_FORMAT_RGBA8888\n> +  - BGRA8888:\n> +      fourcc: DRM_FORMAT_BGRA8888\n> +\n> +  - YUYV:\n> +      fourcc: DRM_FORMAT_YUYV\n> +  - YVYU:\n> +      fourcc: DRM_FORMAT_YVYU\n> +  - UYVY:\n> +      fourcc: DRM_FORMAT_UYVY\n> +  - VYUY:\n> +      fourcc: DRM_FORMAT_VYUY\n> +\n> +  - NV12:\n> +      fourcc: DRM_FORMAT_NV12\n> +  - NV21:\n> +      fourcc: DRM_FORMAT_NV21\n> +  - NV16:\n> +      fourcc: DRM_FORMAT_NV16\n> +  - NV61:\n> +      fourcc: DRM_FORMAT_NV61\n> +  - NV24:\n> +      fourcc: DRM_FORMAT_NV24\n> +  - NV42:\n> +      fourcc: DRM_FORMAT_NV42\n> +\n> +  - MJPEG:\n> +      fourcc: DRM_FORMAT_MJPEG\n> +\n> +  - SRGGB8:\n> +      fourcc: DRM_FORMAT_SRGGB8\n> +  - SGRBG8:\n> +      fourcc: DRM_FORMAT_SGRBG8\n> +  - SGBRG8:\n> +      fourcc: DRM_FORMAT_SGBRG8\n> +  - SBGGR8:\n> +      fourcc: DRM_FORMAT_SBGGR8\n> +\n> +  - SRGGB10:\n> +      fourcc: DRM_FORMAT_SRGGB10\n> +  - SGRBG10:\n> +      fourcc: DRM_FORMAT_SGRBG10\n> +  - SGBRG10:\n> +      fourcc: DRM_FORMAT_SGBRG10\n> +  - SBGGR10:\n> +      fourcc: DRM_FORMAT_SBGGR10\n> +\n> +  - SRGGB12:\n> +      fourcc: DRM_FORMAT_SRGGB12\n> +  - SGRBG12:\n> +      fourcc: DRM_FORMAT_SGRBG12\n> +  - SGBRG12:\n> +      fourcc: DRM_FORMAT_SGBRG12\n> +  - SBGGR12:\n> +      fourcc: DRM_FORMAT_SBGGR12\n> +\n> +  - SRGGB10_CSI2P:\n> +      fourcc: DRM_FORMAT_SRGGB10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGRBG10_CSI2P:\n> +      fourcc: DRM_FORMAT_SGRBG10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGBRG10_CSI2P:\n> +      fourcc: DRM_FORMAT_SGBRG10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SBGGR10_CSI2P:\n> +      fourcc: DRM_FORMAT_SBGGR10\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +\n> +  - SRGGB12_CSI2P:\n> +      fourcc: DRM_FORMAT_SRGGB12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGRBG12_CSI2P:\n> +      fourcc: DRM_FORMAT_SGRBG12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SGBRG12_CSI2P:\n> +      fourcc: DRM_FORMAT_SGBRG12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +  - SBGGR12_CSI2P:\n> +      fourcc: DRM_FORMAT_SBGGR12\n> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED\n> +\n> +  - SRGGB10_IPU3:\n> +      fourcc: DRM_FORMAT_SRGGB10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +  - SGRBG10_IPU3:\n> +      fourcc: DRM_FORMAT_SGRBG10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +  - SGBRG10_IPU3:\n> +      fourcc: DRM_FORMAT_SGBRG10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +  - SBGGR10_IPU3:\n> +      fourcc: DRM_FORMAT_SBGGR10\n> +      mod: IPU3_FORMAT_MOD_PACKED\n> +...\n> diff --git a/src/libcamera/pixel_format.cpp b/src/libcamera/pixel_format.cpp\n> index d501c5f09c6b..f191851ae22c 100644\n> --- a/src/libcamera/pixel_format.cpp\n> +++ b/src/libcamera/pixel_format.cpp\n> @@ -5,6 +5,7 @@\n>   * pixel_format.cpp - libcamera Pixel Format\n>   */\n>  \n> +#include <libcamera/formats.h>\n>  #include <libcamera/pixel_format.h>\n>  \n>  /**\n> @@ -21,7 +22,8 @@ namespace libcamera {\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 modifier.\n>   * The FourCC and modifier values are defined in the Linux kernel DRM/KMS API\n> - * (see linux/drm_fourcc.h).\n> + * (see linux/drm_fourcc.h). Constant expressions for all pixel formats\n> + * supported by libcamera are available in libcamera/formats.h.\n>   */\n>  \n>  /**\n>","headers":{"Return-Path":"<kieran.bingham@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 3920F603D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Jun 2020 13:04:38 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 65C16F9;\n\tMon, 15 Jun 2020 13:04:37 +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=\"FFUWJJ7H\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592219077;\n\tbh=iQd/gR2+En4AYAmiAM0F4+NcyFNbZd9HLB5OXsEFRSU=;\n\th=Reply-To:Subject:To:References:From:Date:In-Reply-To:From;\n\tb=FFUWJJ7HwFwvnDUMxf8+EYmCz4zoLr3VEVoqqVYs4Xm8XF58ZamibTkQX0aXTkTdL\n\tGdKi4QvqzHyq0Ti6IwCJuS3BFcMktulhgBfYH3gjutqq2BPPmy3ju2ufB8xwGnb0Fo\n\t1ISyPL3kUpjNni8ockftB3YHGB3iOJXCarUNlvQ4=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20200609232323.29628-1-laurent.pinchart@ideasonboard.com>\n\t<20200609232323.29628-2-laurent.pinchart@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\t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\n\tWZw01QYHU/GUV/zHJSFk","Organization":"Ideas on Board","Message-ID":"<ea7012e9-b352-58e9-5283-1013ceac9c6e@ideasonboard.com>","Date":"Mon, 15 Jun 2020 12:04:34 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101\n\tThunderbird/68.8.0","MIME-Version":"1.0","In-Reply-To":"<20200609232323.29628-2-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2 1/7] libcamera: Define constants\n\tfor pixel formats in the public API","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":"Mon, 15 Jun 2020 11:04:38 -0000"}}]