Skip to content

Commit b22d5cc

Browse files
naushirpopcornmix
authored andcommitted
media: uapi: v4l2-core: Add ISP statistics output V4L2 fourcc type
Add V4L2_META_FMT_BCM2835_ISP_STATS V4L2 format type. This new format will be used by the BCM2835 ISP device to return out ISP statistics for 3A. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
1 parent c62bb1b commit b22d5cc

4 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎Documentation/userspace-api/media/v4l/meta-formats.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ These formats are used for the :ref:`metadata` interface only.
1212
.. toctree::
1313
:maxdepth: 1
1414

15+
pixfmt-meta-bcm2835-isp-stats
1516
pixfmt-meta-d4xx
1617
pixfmt-meta-intel-ipu3
1718
pixfmt-meta-rkisp1
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.. Permission is granted to copy, distribute and/or modify this
2+
.. document under the terms of the GNU Free Documentation License,
3+
.. Version 1.1 or any later version published by the Free Software
4+
.. Foundation, with no Invariant Sections, no Front-Cover Texts
5+
.. and no Back-Cover Texts. A copy of the license is included at
6+
.. Documentation/media/uapi/fdl-appendix.rst.
7+
..
8+
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9+
10+
.. _v4l2-meta-fmt-bcm2835-isp-stats:
11+
12+
*****************************************
13+
V4L2_META_FMT_BCM2835_ISP_STATS ('BSTA')
14+
*****************************************
15+
16+
BCM2835 ISP Statistics
17+
18+
Description
19+
===========
20+
21+
The BCM2835 ISP hardware calculate image statistics for an input Bayer frame.
22+
These statistics are obtained from the "bcm2835-isp0-capture3" device node
23+
using the :c:type:`v4l2_meta_format` interface. They are formatted as described
24+
by the :c:type:`bcm2835_isp_stats` structure below.
25+
26+
.. code-block:: c
27+
28+
#define DEFAULT_AWB_REGIONS_X 16
29+
#define DEFAULT_AWB_REGIONS_Y 12
30+
31+
#define NUM_HISTOGRAMS 2
32+
#define NUM_HISTOGRAM_BINS 128
33+
#define AWB_REGIONS (DEFAULT_AWB_REGIONS_X * DEFAULT_AWB_REGIONS_Y)
34+
#define FLOATING_REGIONS 16
35+
#define AGC_REGIONS 16
36+
#define FOCUS_REGIONS 12
37+
38+
.. kernel-doc:: include/uapi/linux/bcm2835-isp.h
39+
:functions: bcm2835_isp_stats_hist bcm2835_isp_stats_region
40+
bcm2835_isp_stats_focus bcm2835_isp_stats
41+

‎drivers/media/v4l2-core/v4l2-ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,6 +1405,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
14051405
case V4L2_META_FMT_D4XX: descr = "Intel D4xx UVC Metadata"; break;
14061406
case V4L2_META_FMT_VIVID: descr = "Vivid Metadata"; break;
14071407
case V4L2_META_FMT_SENSOR_DATA: descr = "Sensor Ancillary Metadata"; break;
1408+
case V4L2_META_FMT_BCM2835_ISP_STATS: descr = "BCM2835 ISP Image Statistics"; break;
14081409

14091410
default:
14101411
/* Compressed formats */

‎include/uapi/linux/videodev2.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,7 @@ struct v4l2_pix_format {
779779
#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */
780780
#define V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
781781
#define V4L2_META_FMT_SENSOR_DATA v4l2_fourcc('S', 'E', 'N', 'S') /* Sensor Ancillary metadata */
782+
#define V4L2_META_FMT_BCM2835_ISP_STATS v4l2_fourcc('B', 'S', 'T', 'A') /* BCM2835 ISP image statistics output */
782783

783784
/* priv field value to indicates that subsequent fields are valid. */
784785
#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe

0 commit comments

Comments
 (0)