[{"id":21949,"web_url":"https://patchwork.libcamera.org/comment/21949/","msgid":"<YdVsgylkDu0vyYkK@pendragon.ideasonboard.com>","date":"2022-01-05T10:01:39","subject":"Re: [libcamera-devel] [PATCH v2 1/3] include: linux: Update kernel\n\theaders to version v5.16-rc7","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nThank you for the patch.\n\nOn Wed, Jan 05, 2022 at 08:55:51AM +0000, David Plowman wrote:\n> Updated kernel headers to v5.16-rc7 using\n> utils/update-kernel-headers.sh and re-instating libcamera\n> local modifications.\n> \n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  include/linux/README          |   2 +-\n>  include/linux/dma-buf.h       |  50 ++++-\n>  include/linux/drm_fourcc.h    | 122 ++++++++++-\n>  include/linux/intel-ipu3.h    |  54 ++---\n>  include/linux/rkisp1-config.h |  16 +-\n>  include/linux/v4l2-controls.h | 383 ++++++++++++++++++++++++++++++++--\n>  include/linux/v4l2-subdev.h   |  12 +-\n>  include/linux/videodev2.h     |  59 +++++-\n>  8 files changed, 630 insertions(+), 68 deletions(-)\n\n[snip]\n\n> diff --git a/include/linux/intel-ipu3.h b/include/linux/intel-ipu3.h\n> index b18b28a0..0d197b12 100644\n> --- a/include/linux/intel-ipu3.h\n> +++ b/include/linux/intel-ipu3.h\n> @@ -1,4 +1,4 @@\n> -/* SPDX-License-Identifier: GPL-2.0 */\n> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n>  /* Copyright (C) 2017 - 2018 Intel Corporation */\n>  \n>  #ifndef __IPU3_UAPI_H\n> @@ -9,8 +9,10 @@\n>  /* from /drivers/staging/media/ipu3/include/videodev2.h */\n>  \n>  /* Vendor specific - used for IPU3 camera sub-system */\n> -#define V4L2_META_FMT_IPU3_PARAMS\tv4l2_fourcc('i', 'p', '3', 'p') /* IPU3 processing parameters */\n> -#define V4L2_META_FMT_IPU3_STAT_3A\tv4l2_fourcc('i', 'p', '3', 's') /* IPU3 3A statistics */\n> +/* IPU3 processing parameters */\n> +#define V4L2_META_FMT_IPU3_PARAMS\tv4l2_fourcc('i', 'p', '3', 'p')\n> +/* IPU3 3A statistics */\n> +#define V4L2_META_FMT_IPU3_STAT_3A\tv4l2_fourcc('i', 'p', '3', 's')\n>  \n>  /* from include/uapi/linux/v4l2-controls.h */\n>  #define V4L2_CID_INTEL_IPU3_BASE\t(V4L2_CID_USER_BASE + 0x10c0)\n> @@ -59,44 +61,21 @@ struct ipu3_uapi_grid_config {\n\nChanges from here...\n\n>  \t__u16 y_end;\n>  } __attribute__((packed));\n>  \n> -/**\n> - * struct ipu3_uapi_awb_set_item - Memory layout for each cell in AWB\n> - *\n> - * @Gr_avg:\tGreen average for red lines in the cell.\n> - * @R_avg:\tRed average in the cell.\n> - * @B_avg:\tBlue average in the cell.\n> - * @Gb_avg:\tGreen average for blue lines in the cell.\n> - * @sat_ratio:\tPercentage of pixels over a given threshold set in\n> - *\t\tipu3_uapi_awb_config_s, coded from 0 to 255.\n> - * @padding0:\tUnused byte for padding.\n> - * @padding1:\tUnused byte for padding.\n> - * @padding2:\tUnused byte for padding.\n> - */\n> -struct ipu3_uapi_awb_set_item {\n> -\tunsigned char Gr_avg;\n> -\tunsigned char R_avg;\n> -\tunsigned char B_avg;\n> -\tunsigned char Gb_avg;\n> -\tunsigned char sat_ratio;\n> -\tunsigned char padding0;\n> -\tunsigned char padding1;\n> -\tunsigned char padding2;\n> -} __attribute__((packed));\n> -\n>  /*\n>   * The grid based data is divided into \"slices\" called set, each slice of setX\n>   * refers to ipu3_uapi_grid_config width * height_per_slice.\n>   */\n>  #define IPU3_UAPI_AWB_MAX_SETS\t\t\t\t60\n>  /* Based on grid size 80 * 60 and cell size 16 x 16 */\n> -#define IPU3_UAPI_AWB_SET_SIZE\t\t\t\t160\n> +#define IPU3_UAPI_AWB_SET_SIZE\t\t\t\t1280\n> +#define IPU3_UAPI_AWB_MD_ITEM_SIZE\t\t\t8\n>  #define IPU3_UAPI_AWB_SPARE_FOR_BUBBLES \\\n> -\t(IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES)\n> +\t(IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \\\n> +\t IPU3_UAPI_AWB_MD_ITEM_SIZE)\n>  #define IPU3_UAPI_AWB_MAX_BUFFER_SIZE \\\n>  \t(IPU3_UAPI_AWB_MAX_SETS * \\\n>  \t (IPU3_UAPI_AWB_SET_SIZE + IPU3_UAPI_AWB_SPARE_FOR_BUBBLES))\n>  \n> -\n>  /**\n>   * struct ipu3_uapi_awb_raw_buffer - AWB raw buffer\n>   *\n> @@ -104,7 +83,7 @@ struct ipu3_uapi_awb_set_item {\n>   *\t\tthe average values for each color channel.\n>   */\n>  struct ipu3_uapi_awb_raw_buffer {\n> -\tstruct ipu3_uapi_awb_set_item meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n> +\t__u8 meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n>  \t\t__attribute__((aligned(32)));\n>  } __attribute__((packed));\n>  \n\n... to here are part of commit 6ab7030039241c2667f5a7ad94935878279c9370\nwhich is in linux-next but not in v5.16-rc7. We depend on this in\nlibcamera. Could you drop those two hunks ? Could you also compile-test\nlibcamera with all pipeline handlers enabled ?\n\n> @@ -255,7 +234,9 @@ struct ipu3_uapi_ae_ccm {\n>   * struct ipu3_uapi_ae_config - AE config\n>   *\n>   * @grid_cfg:\tconfig for auto exposure statistics grid. See struct\n> - *\t\t&ipu3_uapi_ae_grid_config\n> + *\t\t&ipu3_uapi_ae_grid_config, as Imgu did not support output\n> + *\t\tauto exposure statistics, so user can ignore this configuration\n> + *\t\tand use the RGB table in auto-whitebalance statistics instead.\n>   * @weights:\t&IPU3_UAPI_AE_WEIGHTS is based on 32x24 blocks in the grid.\n>   *\t\tEach grid cell has a corresponding value in weights LUT called\n>   *\t\tgrid value, global histogram is updated based on grid value and\n> @@ -266,8 +247,8 @@ struct ipu3_uapi_ae_ccm {\n>   */\n>  struct ipu3_uapi_ae_config {\n>  \tstruct ipu3_uapi_ae_grid_config grid_cfg __attribute__((aligned(32)));\n> -\tstruct ipu3_uapi_ae_weight_elem weights[\n> -\t\t\tIPU3_UAPI_AE_WEIGHTS] __attribute__((aligned(32)));\n> +\tstruct ipu3_uapi_ae_weight_elem weights[IPU3_UAPI_AE_WEIGHTS]\n> +\t\t\t\t\t\t__attribute__((aligned(32)));\n>  \tstruct ipu3_uapi_ae_ccm ae_ccm __attribute__((aligned(32)));\n>  } __attribute__((packed));\n>  \n> @@ -555,6 +536,9 @@ struct ipu3_uapi_ff_status {\n>   *\n>   * @awb_raw_buffer: auto white balance meta data &ipu3_uapi_awb_raw_buffer\n>   * @ae_raw_buffer: auto exposure raw data &ipu3_uapi_ae_raw_buffer_aligned\n> + *                 current Imgu does not output the auto exposure statistics\n> + *                 to ae_raw_buffer, the user such as 3A algorithm can use the\n> + *                 RGB table in &ipu3_uapi_awb_raw_buffer to do auto-exposure.\n>   * @af_raw_buffer: &ipu3_uapi_af_raw_buffer for auto focus meta data\n>   * @awb_fr_raw_buffer: value as specified by &ipu3_uapi_awb_fr_raw_buffer\n>   * @stats_4a_config: 4a statistics config as defined by &ipu3_uapi_4a_config.\n> @@ -652,7 +636,7 @@ struct ipu3_uapi_bnr_static_config_wb_gains_thr_config {\n>   * @cg:\tGain coefficient for threshold calculation, [0, 31], default 8.\n>   * @ci:\tIntensity coefficient for threshold calculation. range [0, 0x1f]\n>   *\tdefault 6.\n> - * \tformat: u3.2 (3 most significant bits represent whole number,\n> + *\tformat: u3.2 (3 most significant bits represent whole number,\n>   *\t2 least significant bits represent the fractional part\n>   *\twith each count representing 0.25)\n>   *\te.g. 6 in binary format is 00110, that translates to 1.5\n\n[snip]","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 DF792BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Jan 2022 10:01:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FEC360921;\n\tWed,  5 Jan 2022 11:01:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6AED660115\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jan 2022 11:01:45 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E0F71993;\n\tWed,  5 Jan 2022 11:01:44 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"p79gWyKP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1641376905;\n\tbh=51/VQsXtSK5kwPgP9OaRPPOfLjpVUuEarGJ8wqm9cGs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=p79gWyKPoA4n5K6LIejmynpj/HuN93H3Z7Pc6NERH73NGc4Ujw88vgPihgvrUw1y+\n\txxV9ehTEKCyXjzaZjLrn4pqKLT0SwSqQunYXdR/25McaeNRcY1AbOYBDiP0FYrR6BK\n\tYtqQjTy5/OcywPL4Uqhz9hDV6+IvYU+12whiRzlI=","Date":"Wed, 5 Jan 2022 12:01:39 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<YdVsgylkDu0vyYkK@pendragon.ideasonboard.com>","References":"<20220105085553.12092-1-david.plowman@raspberrypi.com>\n\t<20220105085553.12092-2-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20220105085553.12092-2-david.plowman@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2 1/3] include: linux: Update kernel\n\theaders to version v5.16-rc7","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21952,"web_url":"https://patchwork.libcamera.org/comment/21952/","msgid":"<CAHW6GYLqGmfZ_D7V8vv2f7551tzEhBgeFTwyR-=1DPu8v7s3Pw@mail.gmail.com>","date":"2022-01-05T12:25:28","subject":"Re: [libcamera-devel] [PATCH v2 1/3] include: linux: Update kernel\n\theaders to version v5.16-rc7","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Laurent\n\nThanks for the feedback. Not really sure how I got those extra bits in\nthere as I checked out the right tag before running the update script.\nEvidently there's something I don't understand. But I'll fix it up and\nmake sure everything compiles before re-posting!\n\nBest regards\nDavid\n\nOn Wed, 5 Jan 2022 at 10:01, Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hi David,\n>\n> Thank you for the patch.\n>\n> On Wed, Jan 05, 2022 at 08:55:51AM +0000, David Plowman wrote:\n> > Updated kernel headers to v5.16-rc7 using\n> > utils/update-kernel-headers.sh and re-instating libcamera\n> > local modifications.\n> >\n> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> >  include/linux/README          |   2 +-\n> >  include/linux/dma-buf.h       |  50 ++++-\n> >  include/linux/drm_fourcc.h    | 122 ++++++++++-\n> >  include/linux/intel-ipu3.h    |  54 ++---\n> >  include/linux/rkisp1-config.h |  16 +-\n> >  include/linux/v4l2-controls.h | 383 ++++++++++++++++++++++++++++++++--\n> >  include/linux/v4l2-subdev.h   |  12 +-\n> >  include/linux/videodev2.h     |  59 +++++-\n> >  8 files changed, 630 insertions(+), 68 deletions(-)\n>\n> [snip]\n>\n> > diff --git a/include/linux/intel-ipu3.h b/include/linux/intel-ipu3.h\n> > index b18b28a0..0d197b12 100644\n> > --- a/include/linux/intel-ipu3.h\n> > +++ b/include/linux/intel-ipu3.h\n> > @@ -1,4 +1,4 @@\n> > -/* SPDX-License-Identifier: GPL-2.0 */\n> > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> >  /* Copyright (C) 2017 - 2018 Intel Corporation */\n> >\n> >  #ifndef __IPU3_UAPI_H\n> > @@ -9,8 +9,10 @@\n> >  /* from /drivers/staging/media/ipu3/include/videodev2.h */\n> >\n> >  /* Vendor specific - used for IPU3 camera sub-system */\n> > -#define V4L2_META_FMT_IPU3_PARAMS    v4l2_fourcc('i', 'p', '3', 'p') /* IPU3 processing parameters */\n> > -#define V4L2_META_FMT_IPU3_STAT_3A   v4l2_fourcc('i', 'p', '3', 's') /* IPU3 3A statistics */\n> > +/* IPU3 processing parameters */\n> > +#define V4L2_META_FMT_IPU3_PARAMS    v4l2_fourcc('i', 'p', '3', 'p')\n> > +/* IPU3 3A statistics */\n> > +#define V4L2_META_FMT_IPU3_STAT_3A   v4l2_fourcc('i', 'p', '3', 's')\n> >\n> >  /* from include/uapi/linux/v4l2-controls.h */\n> >  #define V4L2_CID_INTEL_IPU3_BASE     (V4L2_CID_USER_BASE + 0x10c0)\n> > @@ -59,44 +61,21 @@ struct ipu3_uapi_grid_config {\n>\n> Changes from here...\n>\n> >       __u16 y_end;\n> >  } __attribute__((packed));\n> >\n> > -/**\n> > - * struct ipu3_uapi_awb_set_item - Memory layout for each cell in AWB\n> > - *\n> > - * @Gr_avg:  Green average for red lines in the cell.\n> > - * @R_avg:   Red average in the cell.\n> > - * @B_avg:   Blue average in the cell.\n> > - * @Gb_avg:  Green average for blue lines in the cell.\n> > - * @sat_ratio:       Percentage of pixels over a given threshold set in\n> > - *           ipu3_uapi_awb_config_s, coded from 0 to 255.\n> > - * @padding0:        Unused byte for padding.\n> > - * @padding1:        Unused byte for padding.\n> > - * @padding2:        Unused byte for padding.\n> > - */\n> > -struct ipu3_uapi_awb_set_item {\n> > -     unsigned char Gr_avg;\n> > -     unsigned char R_avg;\n> > -     unsigned char B_avg;\n> > -     unsigned char Gb_avg;\n> > -     unsigned char sat_ratio;\n> > -     unsigned char padding0;\n> > -     unsigned char padding1;\n> > -     unsigned char padding2;\n> > -} __attribute__((packed));\n> > -\n> >  /*\n> >   * The grid based data is divided into \"slices\" called set, each slice of setX\n> >   * refers to ipu3_uapi_grid_config width * height_per_slice.\n> >   */\n> >  #define IPU3_UAPI_AWB_MAX_SETS                               60\n> >  /* Based on grid size 80 * 60 and cell size 16 x 16 */\n> > -#define IPU3_UAPI_AWB_SET_SIZE                               160\n> > +#define IPU3_UAPI_AWB_SET_SIZE                               1280\n> > +#define IPU3_UAPI_AWB_MD_ITEM_SIZE                   8\n> >  #define IPU3_UAPI_AWB_SPARE_FOR_BUBBLES \\\n> > -     (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES)\n> > +     (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \\\n> > +      IPU3_UAPI_AWB_MD_ITEM_SIZE)\n> >  #define IPU3_UAPI_AWB_MAX_BUFFER_SIZE \\\n> >       (IPU3_UAPI_AWB_MAX_SETS * \\\n> >        (IPU3_UAPI_AWB_SET_SIZE + IPU3_UAPI_AWB_SPARE_FOR_BUBBLES))\n> >\n> > -\n> >  /**\n> >   * struct ipu3_uapi_awb_raw_buffer - AWB raw buffer\n> >   *\n> > @@ -104,7 +83,7 @@ struct ipu3_uapi_awb_set_item {\n> >   *           the average values for each color channel.\n> >   */\n> >  struct ipu3_uapi_awb_raw_buffer {\n> > -     struct ipu3_uapi_awb_set_item meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n> > +     __u8 meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n> >               __attribute__((aligned(32)));\n> >  } __attribute__((packed));\n> >\n>\n> ... to here are part of commit 6ab7030039241c2667f5a7ad94935878279c9370\n> which is in linux-next but not in v5.16-rc7. We depend on this in\n> libcamera. Could you drop those two hunks ? Could you also compile-test\n> libcamera with all pipeline handlers enabled ?\n>\n> > @@ -255,7 +234,9 @@ struct ipu3_uapi_ae_ccm {\n> >   * struct ipu3_uapi_ae_config - AE config\n> >   *\n> >   * @grid_cfg:        config for auto exposure statistics grid. See struct\n> > - *           &ipu3_uapi_ae_grid_config\n> > + *           &ipu3_uapi_ae_grid_config, as Imgu did not support output\n> > + *           auto exposure statistics, so user can ignore this configuration\n> > + *           and use the RGB table in auto-whitebalance statistics instead.\n> >   * @weights: &IPU3_UAPI_AE_WEIGHTS is based on 32x24 blocks in the grid.\n> >   *           Each grid cell has a corresponding value in weights LUT called\n> >   *           grid value, global histogram is updated based on grid value and\n> > @@ -266,8 +247,8 @@ struct ipu3_uapi_ae_ccm {\n> >   */\n> >  struct ipu3_uapi_ae_config {\n> >       struct ipu3_uapi_ae_grid_config grid_cfg __attribute__((aligned(32)));\n> > -     struct ipu3_uapi_ae_weight_elem weights[\n> > -                     IPU3_UAPI_AE_WEIGHTS] __attribute__((aligned(32)));\n> > +     struct ipu3_uapi_ae_weight_elem weights[IPU3_UAPI_AE_WEIGHTS]\n> > +                                             __attribute__((aligned(32)));\n> >       struct ipu3_uapi_ae_ccm ae_ccm __attribute__((aligned(32)));\n> >  } __attribute__((packed));\n> >\n> > @@ -555,6 +536,9 @@ struct ipu3_uapi_ff_status {\n> >   *\n> >   * @awb_raw_buffer: auto white balance meta data &ipu3_uapi_awb_raw_buffer\n> >   * @ae_raw_buffer: auto exposure raw data &ipu3_uapi_ae_raw_buffer_aligned\n> > + *                 current Imgu does not output the auto exposure statistics\n> > + *                 to ae_raw_buffer, the user such as 3A algorithm can use the\n> > + *                 RGB table in &ipu3_uapi_awb_raw_buffer to do auto-exposure.\n> >   * @af_raw_buffer: &ipu3_uapi_af_raw_buffer for auto focus meta data\n> >   * @awb_fr_raw_buffer: value as specified by &ipu3_uapi_awb_fr_raw_buffer\n> >   * @stats_4a_config: 4a statistics config as defined by &ipu3_uapi_4a_config.\n> > @@ -652,7 +636,7 @@ struct ipu3_uapi_bnr_static_config_wb_gains_thr_config {\n> >   * @cg:      Gain coefficient for threshold calculation, [0, 31], default 8.\n> >   * @ci:      Intensity coefficient for threshold calculation. range [0, 0x1f]\n> >   *   default 6.\n> > - *   format: u3.2 (3 most significant bits represent whole number,\n> > + *   format: u3.2 (3 most significant bits represent whole number,\n> >   *   2 least significant bits represent the fractional part\n> >   *   with each count representing 0.25)\n> >   *   e.g. 6 in binary format is 00110, that translates to 1.5\n>\n> [snip]\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 1FA31BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Jan 2022 12:25:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5725560926;\n\tWed,  5 Jan 2022 13:25:42 +0100 (CET)","from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B006060868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jan 2022 13:25:40 +0100 (CET)","by mail-wm1-x32d.google.com with SMTP id\n\tl12-20020a7bc34c000000b003467c58cbdfso1308155wmj.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 05 Jan 2022 04:25:40 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"kZ9BPBiX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=bqSKTR1LXAOx8LLuTtQMh0PxnfEFQvJnwBURBoe5aPs=;\n\tb=kZ9BPBiX5jmH7hSpOirPnxswSlJarsTnHAcRipMEk2N9DXffyfmjg0tvlK+68WeZ7w\n\tmoRAmqGvPF/sZ/j9qxPrORk7pJyAwCz629Bm3KHv2zffwUzvwheGrxYP/cz0ERnpASy7\n\tq16Xxc/kSud6NZqiJ1ZQp94eSE6hRUsnedJOHpmG+6qYmIv0FGjUCgvE0I5ON3dFUi2D\n\txh4Qdv6ZjsNo/mkw/i2g2oqu8Xk+UqQG9xJpd3JAGoFTdHmTTZayCRHuEyoLCh2FrdV4\n\tFd2emTljKcV54D7d0B7EByihh3kPqYPngnP0LWuD9wTof0av5LgyidROfrw61kirvZqI\n\tceHA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=bqSKTR1LXAOx8LLuTtQMh0PxnfEFQvJnwBURBoe5aPs=;\n\tb=kwY9TdRd1A+FQGLtKvunnhDjKvwNpirPMHR0dEEVY06dFwbcLjqrfVDQv5VxIHMB5e\n\tiHm6PiByoCgynzKYfWwfoGsfLAWTx2J1dtFwg+uUh2W9lqj2Uhjh+A/sWWI8Xk8tFbpt\n\tJV51m71jz4MCDqsRafkjcIpBdhMxlalX4JUNl0uscyLqZuSDZGCFPEG1eIG6igDE3oh1\n\tQkrSlrPuNWbUNxg0Yq8NLd1+sebmic0juldfXzA6W0OP7abaXqXS7hecCigGFf27Y/RO\n\tCigm7zA9t77htNQHIYwvplWXM4A2UXfvGAC/VCXeuDkBcoQmHpc0aaFHqqBfznJUq64X\n\tc+kw==","X-Gm-Message-State":"AOAM533+uODanVXVvepvfG0CteUxaI528VCz9TdbvnUJwhGcF5Z6yyh5\n\t76LRioKUDUMQa7Hq4nXqJMixsE40BKjD/3GESNNRxsOBqECsdA==","X-Google-Smtp-Source":"ABdhPJzT+/DWw+pruLfaU1q/ZB0DR93UdRaMePZuXdPgZHDC5iEGFOdnGYEkcb8rCGj2vF2yXIEYpbQpncF2VUMJf+w=","X-Received":"by 2002:a05:600c:3b0e:: with SMTP id\n\tm14mr2623625wms.130.1641385540130; \n\tWed, 05 Jan 2022 04:25:40 -0800 (PST)","MIME-Version":"1.0","References":"<20220105085553.12092-1-david.plowman@raspberrypi.com>\n\t<20220105085553.12092-2-david.plowman@raspberrypi.com>\n\t<YdVsgylkDu0vyYkK@pendragon.ideasonboard.com>","In-Reply-To":"<YdVsgylkDu0vyYkK@pendragon.ideasonboard.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Wed, 5 Jan 2022 12:25:28 +0000","Message-ID":"<CAHW6GYLqGmfZ_D7V8vv2f7551tzEhBgeFTwyR-=1DPu8v7s3Pw@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 1/3] include: linux: Update kernel\n\theaders to version v5.16-rc7","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21953,"web_url":"https://patchwork.libcamera.org/comment/21953/","msgid":"<YdWaRTOhSFxBZii/@pendragon.ideasonboard.com>","date":"2022-01-05T13:16:53","subject":"Re: [libcamera-devel] [PATCH v2 1/3] include: linux: Update kernel\n\theaders to version v5.16-rc7","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nOn Wed, Jan 05, 2022 at 12:25:28PM +0000, David Plowman wrote:\n> Hi Laurent\n> \n> Thanks for the feedback. Not really sure how I got those extra bits in\n> there as I checked out the right tag before running the update script.\n> Evidently there's something I don't understand. But I'll fix it up and\n> make sure everything compiles before re-posting!\n\nYou did nothing wrong, the change in the intel-ipu3.h header that we\ndepend on has been applied manually. It will be merged upstream in\nv5.17, which is why it wasn't it your v5.16-rc7 branch.\n\n> On Wed, 5 Jan 2022 at 10:01, Laurent Pinchart wrote:\n> > On Wed, Jan 05, 2022 at 08:55:51AM +0000, David Plowman wrote:\n> > > Updated kernel headers to v5.16-rc7 using\n> > > utils/update-kernel-headers.sh and re-instating libcamera\n> > > local modifications.\n> > >\n> > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > > ---\n> > >  include/linux/README          |   2 +-\n> > >  include/linux/dma-buf.h       |  50 ++++-\n> > >  include/linux/drm_fourcc.h    | 122 ++++++++++-\n> > >  include/linux/intel-ipu3.h    |  54 ++---\n> > >  include/linux/rkisp1-config.h |  16 +-\n> > >  include/linux/v4l2-controls.h | 383 ++++++++++++++++++++++++++++++++--\n> > >  include/linux/v4l2-subdev.h   |  12 +-\n> > >  include/linux/videodev2.h     |  59 +++++-\n> > >  8 files changed, 630 insertions(+), 68 deletions(-)\n> >\n> > [snip]\n> >\n> > > diff --git a/include/linux/intel-ipu3.h b/include/linux/intel-ipu3.h\n> > > index b18b28a0..0d197b12 100644\n> > > --- a/include/linux/intel-ipu3.h\n> > > +++ b/include/linux/intel-ipu3.h\n> > > @@ -1,4 +1,4 @@\n> > > -/* SPDX-License-Identifier: GPL-2.0 */\n> > > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */\n> > >  /* Copyright (C) 2017 - 2018 Intel Corporation */\n> > >\n> > >  #ifndef __IPU3_UAPI_H\n> > > @@ -9,8 +9,10 @@\n> > >  /* from /drivers/staging/media/ipu3/include/videodev2.h */\n> > >\n> > >  /* Vendor specific - used for IPU3 camera sub-system */\n> > > -#define V4L2_META_FMT_IPU3_PARAMS    v4l2_fourcc('i', 'p', '3', 'p') /* IPU3 processing parameters */\n> > > -#define V4L2_META_FMT_IPU3_STAT_3A   v4l2_fourcc('i', 'p', '3', 's') /* IPU3 3A statistics */\n> > > +/* IPU3 processing parameters */\n> > > +#define V4L2_META_FMT_IPU3_PARAMS    v4l2_fourcc('i', 'p', '3', 'p')\n> > > +/* IPU3 3A statistics */\n> > > +#define V4L2_META_FMT_IPU3_STAT_3A   v4l2_fourcc('i', 'p', '3', 's')\n> > >\n> > >  /* from include/uapi/linux/v4l2-controls.h */\n> > >  #define V4L2_CID_INTEL_IPU3_BASE     (V4L2_CID_USER_BASE + 0x10c0)\n> > > @@ -59,44 +61,21 @@ struct ipu3_uapi_grid_config {\n> >\n> > Changes from here...\n> >\n> > >       __u16 y_end;\n> > >  } __attribute__((packed));\n> > >\n> > > -/**\n> > > - * struct ipu3_uapi_awb_set_item - Memory layout for each cell in AWB\n> > > - *\n> > > - * @Gr_avg:  Green average for red lines in the cell.\n> > > - * @R_avg:   Red average in the cell.\n> > > - * @B_avg:   Blue average in the cell.\n> > > - * @Gb_avg:  Green average for blue lines in the cell.\n> > > - * @sat_ratio:       Percentage of pixels over a given threshold set in\n> > > - *           ipu3_uapi_awb_config_s, coded from 0 to 255.\n> > > - * @padding0:        Unused byte for padding.\n> > > - * @padding1:        Unused byte for padding.\n> > > - * @padding2:        Unused byte for padding.\n> > > - */\n> > > -struct ipu3_uapi_awb_set_item {\n> > > -     unsigned char Gr_avg;\n> > > -     unsigned char R_avg;\n> > > -     unsigned char B_avg;\n> > > -     unsigned char Gb_avg;\n> > > -     unsigned char sat_ratio;\n> > > -     unsigned char padding0;\n> > > -     unsigned char padding1;\n> > > -     unsigned char padding2;\n> > > -} __attribute__((packed));\n> > > -\n> > >  /*\n> > >   * The grid based data is divided into \"slices\" called set, each slice of setX\n> > >   * refers to ipu3_uapi_grid_config width * height_per_slice.\n> > >   */\n> > >  #define IPU3_UAPI_AWB_MAX_SETS                               60\n> > >  /* Based on grid size 80 * 60 and cell size 16 x 16 */\n> > > -#define IPU3_UAPI_AWB_SET_SIZE                               160\n> > > +#define IPU3_UAPI_AWB_SET_SIZE                               1280\n> > > +#define IPU3_UAPI_AWB_MD_ITEM_SIZE                   8\n> > >  #define IPU3_UAPI_AWB_SPARE_FOR_BUBBLES \\\n> > > -     (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES)\n> > > +     (IPU3_UAPI_MAX_BUBBLE_SIZE * IPU3_UAPI_MAX_STRIPES * \\\n> > > +      IPU3_UAPI_AWB_MD_ITEM_SIZE)\n> > >  #define IPU3_UAPI_AWB_MAX_BUFFER_SIZE \\\n> > >       (IPU3_UAPI_AWB_MAX_SETS * \\\n> > >        (IPU3_UAPI_AWB_SET_SIZE + IPU3_UAPI_AWB_SPARE_FOR_BUBBLES))\n> > >\n> > > -\n> > >  /**\n> > >   * struct ipu3_uapi_awb_raw_buffer - AWB raw buffer\n> > >   *\n> > > @@ -104,7 +83,7 @@ struct ipu3_uapi_awb_set_item {\n> > >   *           the average values for each color channel.\n> > >   */\n> > >  struct ipu3_uapi_awb_raw_buffer {\n> > > -     struct ipu3_uapi_awb_set_item meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n> > > +     __u8 meta_data[IPU3_UAPI_AWB_MAX_BUFFER_SIZE]\n> > >               __attribute__((aligned(32)));\n> > >  } __attribute__((packed));\n> > >\n> >\n> > ... to here are part of commit 6ab7030039241c2667f5a7ad94935878279c9370\n> > which is in linux-next but not in v5.16-rc7. We depend on this in\n> > libcamera. Could you drop those two hunks ? Could you also compile-test\n> > libcamera with all pipeline handlers enabled ?\n> >\n> > > @@ -255,7 +234,9 @@ struct ipu3_uapi_ae_ccm {\n> > >   * struct ipu3_uapi_ae_config - AE config\n> > >   *\n> > >   * @grid_cfg:        config for auto exposure statistics grid. See struct\n> > > - *           &ipu3_uapi_ae_grid_config\n> > > + *           &ipu3_uapi_ae_grid_config, as Imgu did not support output\n> > > + *           auto exposure statistics, so user can ignore this configuration\n> > > + *           and use the RGB table in auto-whitebalance statistics instead.\n> > >   * @weights: &IPU3_UAPI_AE_WEIGHTS is based on 32x24 blocks in the grid.\n> > >   *           Each grid cell has a corresponding value in weights LUT called\n> > >   *           grid value, global histogram is updated based on grid value and\n> > > @@ -266,8 +247,8 @@ struct ipu3_uapi_ae_ccm {\n> > >   */\n> > >  struct ipu3_uapi_ae_config {\n> > >       struct ipu3_uapi_ae_grid_config grid_cfg __attribute__((aligned(32)));\n> > > -     struct ipu3_uapi_ae_weight_elem weights[\n> > > -                     IPU3_UAPI_AE_WEIGHTS] __attribute__((aligned(32)));\n> > > +     struct ipu3_uapi_ae_weight_elem weights[IPU3_UAPI_AE_WEIGHTS]\n> > > +                                             __attribute__((aligned(32)));\n> > >       struct ipu3_uapi_ae_ccm ae_ccm __attribute__((aligned(32)));\n> > >  } __attribute__((packed));\n> > >\n> > > @@ -555,6 +536,9 @@ struct ipu3_uapi_ff_status {\n> > >   *\n> > >   * @awb_raw_buffer: auto white balance meta data &ipu3_uapi_awb_raw_buffer\n> > >   * @ae_raw_buffer: auto exposure raw data &ipu3_uapi_ae_raw_buffer_aligned\n> > > + *                 current Imgu does not output the auto exposure statistics\n> > > + *                 to ae_raw_buffer, the user such as 3A algorithm can use the\n> > > + *                 RGB table in &ipu3_uapi_awb_raw_buffer to do auto-exposure.\n> > >   * @af_raw_buffer: &ipu3_uapi_af_raw_buffer for auto focus meta data\n> > >   * @awb_fr_raw_buffer: value as specified by &ipu3_uapi_awb_fr_raw_buffer\n> > >   * @stats_4a_config: 4a statistics config as defined by &ipu3_uapi_4a_config.\n> > > @@ -652,7 +636,7 @@ struct ipu3_uapi_bnr_static_config_wb_gains_thr_config {\n> > >   * @cg:      Gain coefficient for threshold calculation, [0, 31], default 8.\n> > >   * @ci:      Intensity coefficient for threshold calculation. range [0, 0x1f]\n> > >   *   default 6.\n> > > - *   format: u3.2 (3 most significant bits represent whole number,\n> > > + *   format: u3.2 (3 most significant bits represent whole number,\n> > >   *   2 least significant bits represent the fractional part\n> > >   *   with each count representing 0.25)\n> > >   *   e.g. 6 in binary format is 00110, that translates to 1.5\n> >\n> > [snip]","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 987ACBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Jan 2022 13:17:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9E943608E6;\n\tWed,  5 Jan 2022 14:17:01 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A616F60868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jan 2022 14:16:59 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F927993;\n\tWed,  5 Jan 2022 14:16:59 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SqJJl/yT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1641388619;\n\tbh=iSEMtj6ZaocUp3VzktJC8mr5no/ZJ2YwQKbmfsltt9E=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SqJJl/yTAztuVtswXI6TVVSE5MyWbcNEIyudnLPoTLaE3uo+otggwpvgL1MDlbePc\n\tnzCR6PdLZP4aFxCybKet2e6kVRWgNi7BXSFLRU3lJmplyBP3y3L32tu9OpaMR22fw0\n\tdjXJd5Jjz8ha1q18u7qaqnOp69zR+tjExzlXRSmQ=","Date":"Wed, 5 Jan 2022 15:16:53 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<YdWaRTOhSFxBZii/@pendragon.ideasonboard.com>","References":"<20220105085553.12092-1-david.plowman@raspberrypi.com>\n\t<20220105085553.12092-2-david.plowman@raspberrypi.com>\n\t<YdVsgylkDu0vyYkK@pendragon.ideasonboard.com>\n\t<CAHW6GYLqGmfZ_D7V8vv2f7551tzEhBgeFTwyR-=1DPu8v7s3Pw@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAHW6GYLqGmfZ_D7V8vv2f7551tzEhBgeFTwyR-=1DPu8v7s3Pw@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v2 1/3] include: linux: Update kernel\n\theaders to version v5.16-rc7","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]