All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Martina Krasteva <martinax.krasteva@linux.intel.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org,
	robh+dt@kernel.org, devicetree@vger.kernel.org,
	daniele.alessandrelli@linux.intel.com,
	paul.j.murphy@linux.intel.com,
	gjorgjix.rosikopulos@linux.intel.com
Subject: Re: [PATCH 05/10] media: v4l: Add Keem Bay Camera meta buffer formats
Date: Mon, 22 Mar 2021 20:27:44 +0200	[thread overview]
Message-ID: <20210322182743.GR3@paasikivi.fi.intel.com> (raw)
In-Reply-To: <20210319180632.585-6-martinax.krasteva@linux.intel.com>

Hi Martian and Gjorgji,

On Fri, Mar 19, 2021 at 06:06:27PM +0000, Martina Krasteva wrote:
> From: Gjorgji Rosikopulos <gjorgjix.rosikopulos@intel.com>
> 
> Add Keem Bay Camera specific meta formats for processing
> parameters and statistics:
> 
>     V4L2_META_FMT_KMB_PARAMS
>     V4L2_META_FMT_KMB_STATS
> 
> Signed-off-by: Gjorgji Rosikopulos <gjorgjix.rosikopulos@intel.com>
> Co-developed-by: Ivan Dimitrov <ivanx.dimitrov@intel.com>
> Signed-off-by: Ivan Dimitrov <ivanx.dimitrov@intel.com>
> Co-developed-by: Martina Krasteva <martinax.krasteva@intel.com>
> Signed-off-by: Martina Krasteva <martinax.krasteva@intel.com>
> Acked-by: Paul J. Murphy <paul.j.murphy@intel.com>
> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
> ---
>  .../userspace-api/media/v4l/meta-formats.rst       |  1 +
>  .../media/v4l/pixfmt-meta-intel-kmb.rst            | 98 ++++++++++++++++++++++
>  MAINTAINERS                                        |  2 +
>  include/uapi/linux/videodev2.h                     |  4 +
>  4 files changed, 105 insertions(+)
>  create mode 100644 Documentation/userspace-api/media/v4l/pixfmt-meta-intel-kmb.rst
> 
> diff --git a/Documentation/userspace-api/media/v4l/meta-formats.rst b/Documentation/userspace-api/media/v4l/meta-formats.rst
> index fff25357fe86..cb85161dc1ae 100644
> --- a/Documentation/userspace-api/media/v4l/meta-formats.rst
> +++ b/Documentation/userspace-api/media/v4l/meta-formats.rst
> @@ -14,6 +14,7 @@ These formats are used for the :ref:`metadata` interface only.
>  
>      pixfmt-meta-d4xx
>      pixfmt-meta-intel-ipu3
> +    pixfmt-meta-intel-kmb
>      pixfmt-meta-rkisp1
>      pixfmt-meta-uvc
>      pixfmt-meta-vsp1-hgo
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-meta-intel-kmb.rst b/Documentation/userspace-api/media/v4l/pixfmt-meta-intel-kmb.rst
> new file mode 100644
> index 000000000000..99615bbed106
> --- /dev/null
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-meta-intel-kmb.rst
> @@ -0,0 +1,98 @@
> +.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
> +
> +.. _v4l2-meta-fmt-params:
> +.. _v4l2-meta-fmt-stats:
> +
> +*******************************************************************
> +V4L2_META_FMT_KMB_PARAMS ('kmbp'), V4L2_META_FMT_KMB_STATS ('kmbs')
> +*******************************************************************
> +
> +.. kmb_isp_stats
> +
> +ISP statistics
> +==============
> +
> +The Keembay ISP statistics blocks collect different statistics over
> +an input Bayer frame in non-HDR mode, or up to three input Bayer frames
> +in HDR mode. Those statistics are obtained from the "keembay-metadata-stats"
> +metadata capture video node, using the :c:type:`v4l2_meta_format` interface.
> +They are formatted as described by the :c:type:`kmb_isp_stats` structure.
> +
> +The statistics collected are AE/AWB (Auto-exposure/Auto-white balance),
> +AF (Auto-focus) filter response, luma histogram, rgb histograms and dehaze statistics.
> +Dehaze statistic are collected after HDR fusion in HDR mode.
> +
> +The struct :c:type:`kmb_isp_params` contain all configurable parameters for the

The syntax has changed recently regarding references to structs, which now
are simply "struct nameofthestruct".

> +statistics:
> +
> +- The struct :c:type:`kmb_raw_params` contain enable flags for all
> +  statistics except dehaze (always enabled) and configuration for flicker rows
> +  statistics.
> +- The struct :c:type:`kmb_ae_awb_params` contain configuration parameters for AE/AWB
> +  statistics.
> +- The struct :c:type:`kmb_af_params` contain configuration for AF (Auto-focus) filter
> +  response statistics.
> +- The struct :c:type:`kmb_hist_params` contain configuration for luma and rgb histograms.
> +- The struct :c:type:`kmb_hist_params` contain configuration for luma and rgb histograms.
> +- The struct :c:type:`kmb_dehaze_params` contain configuration for dehaze statistics.

Please wrap before 80 characters per line unless there's a reason to do
otherwise.

> +
> +.. code-block:: c
> +
> +	struct kmb_isp_stats {
> +		struct {
> +			__u8 ae_awb_stats[KMB_CAM_AE_AWB_STATS_SIZE];
> +			__u8 af_stats[KMB_CAM_AF_STATS_SIZE];
> +			__u8 hist_luma[KMB_CAM_HIST_LUMA_SIZE];
> +			__u8 hist_rgb[KMB_CAM_HIST_RGB_SIZE];
> +			__u8 flicker_rows[KMB_CAM_FLICKER_ROWS_SIZE];
> +		} exposure[KMB_CAM_MAX_EXPOSURES];
> +		__u8 dehaze[MAX_DHZ_AIRLIGHT_STATS_SIZE];
> +		struct kmb_isp_stats_flags update;
> +	};
> +
> +.. kmb_isp_stats
> +
> +ISP parameters
> +==============
> +
> +The ISP parameters are passed to the "keembay-metadata-params" metadata
> +output video node, using the :c:type:`v4l2_meta_format` interface. They are
> +formatted as described by the :c:type:`kmb_isp_params` structure.
> +
> +Both ISP statistics and ISP parameters described here are closely tied to
> +the underlying camera sub-system (VPU Camera) APIs. They are usually consumed
> +and produced by dedicated user space libraries that comprise the important
> +tuning tools, thus freeing the developers from being bothered with the low
> +level hardware and algorithm details.
> +
> +.. code-block:: c
> +
> +	struct kmb_isp_params {
> +		struct kmb_isp_params_flags update;
> +		struct kmb_blc_params blc[KMB_CAM_MAX_EXPOSURES];
> +		struct kmb_sigma_dns_params sigma_dns[KMB_CAM_MAX_EXPOSURES];
> +		struct kmb_lsc_params lsc;
> +		struct kmb_raw_params raw;
> +		struct kmb_ae_awb_params ae_awb;
> +		struct kmb_af_params af;
> +		struct kmb_hist_params histogram;
> +		struct kmb_lca_params lca;
> +		struct kmb_debayer_params debayer;
> +		struct kmb_dog_dns_params dog_dns;
> +		struct kmb_luma_dns_params luma_dns;
> +		struct kmb_sharpen_params sharpen;
> +		struct kmb_chroma_gen_params chroma_gen;
> +		struct kmb_median_params median;
> +		struct kmb_chroma_dns_params chroma_dns;
> +		struct kmb_color_comb_params color_comb;
> +		struct kmb_hdr_params hdr;
> +		struct kmb_lut_params lut;
> +		struct kmb_tnf_params tnf;
> +		struct kmb_dehaze_params dehaze;
> +		struct kmb_warp_params warp;
> +	};

As this is already part of the UAPI header you don't need to repeat it
here.

> +
> +Keembay ISP uAPI data types
> +===============================
> +
> +.. kernel-doc:: include/uapi/linux/keembay-isp-ctl.h
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 955f9f6a195d..d90eaf453012 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1972,6 +1972,8 @@ L:	linux-media@vger.kernel.org
>  S:	Maintained
>  T:	git git://linuxtv.org/media_tree.git
>  F:	Documentation/devicetree/bindings/media/intel,keembay-camera.yaml
> +F:	Documentation/media/uapi/v4l/meta-formats.rst
> +F:	Documentation/media/uapi/v4l/pixfmt-meta-intel-kmb.rst

The files are under Documentation/userspace-api/media/v4l/ .

>  F:	drivers/media/platform/keembay-camera/
>  F:	include/uapi/linux/keembay-isp-ctl.h
>  
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 79dbde3bcf8d..0d32269638f6 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -769,6 +769,10 @@ struct v4l2_pix_format {
>  #define V4L2_META_FMT_RK_ISP1_PARAMS	v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */
>  #define V4L2_META_FMT_RK_ISP1_STAT_3A	v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */
>  
> +/* Vendor specific - used for Keem Bay camera sub-system */
> +#define V4L2_META_FMT_KMB_PARAMS v4l2_fourcc('K', 'M', 'B', 'P') /* Keem Bay parameters */
> +#define V4L2_META_FMT_KMB_STATS  v4l2_fourcc('K', 'M', 'B', 'S') /* Keem Bay statistics */
> +
>  /* priv field value to indicates that subsequent fields are valid. */
>  #define V4L2_PIX_FMT_PRIV_MAGIC		0xfeedcafe
>  

-- 
Kind regards,

Sakari Ailus

  reply	other threads:[~2021-03-22 18:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 18:06 [PATCH 00/10] Keem Bay Camera Subsystem Martina Krasteva
2021-03-19 18:06 ` [PATCH 01/10] dt-bindings: media: Add bindings for Keem Bay Camera Martina Krasteva
2021-03-19 21:49   ` Rob Herring
2021-03-19 18:06 ` [PATCH 02/10] media: Keem Bay Camera: Keem Bay camera driver Martina Krasteva
2021-03-19 18:06 ` [PATCH 03/10] media: Keem Bay Camera: Add VPU camera interface Martina Krasteva
2021-04-09 12:01   ` Sakari Ailus
2021-04-09 14:39     ` Martina Krasteva
2021-03-19 18:06 ` [PATCH 04/10] uapi: Keem Bay ISP Parameters data types Martina Krasteva
2021-03-19 20:58   ` kernel test robot
2021-03-19 20:58     ` kernel test robot
2021-03-22 13:32   ` Sakari Ailus
2021-03-19 18:06 ` [PATCH 05/10] media: v4l: Add Keem Bay Camera meta buffer formats Martina Krasteva
2021-03-22 18:27   ` Sakari Ailus [this message]
2021-03-24 17:20     ` Rosikopulos, GjorgjiX
2021-03-24 17:23     ` Rosikopulos, GjorgjiX
2021-03-19 18:06 ` [PATCH 06/10] media: Keem Bay Camera: Add ISP sub-device Martina Krasteva
2021-04-09  8:31   ` Sakari Ailus
2021-04-09 10:17     ` Martina Krasteva
2021-03-19 18:06 ` [PATCH 07/10] media: Keem Bay Camera: Add pipeline support Martina Krasteva
2021-03-19 18:06 ` [PATCH 08/10] media: Keem Bay Camera: Add capture video node Martina Krasteva
2021-04-09 14:32   ` Sakari Ailus
2021-03-19 18:06 ` [PATCH 09/10] media: Keem Bay Camera: Add metadata " Martina Krasteva
2021-04-09 10:24   ` Sakari Ailus
2021-04-09 14:19     ` Martina Krasteva
2021-04-09 14:36       ` 'Sakari Ailus'
2021-03-19 18:06 ` [PATCH 10/10] media: admin-guide: Add documentation for Keem Bay Camera Martina Krasteva
2021-04-16  9:37 ` [PATCH 00/10] Keem Bay Camera Subsystem Laurent Pinchart
2021-04-16 11:20   ` Rosikopulos, GjorgjiX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210322182743.GR3@paasikivi.fi.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=daniele.alessandrelli@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gjorgjix.rosikopulos@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martinax.krasteva@linux.intel.com \
    --cc=mchehab@kernel.org \
    --cc=paul.j.murphy@linux.intel.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.