An attempt at getting image data back

This commit is contained in:
2024-07-14 00:27:33 +02:00
parent e026bc93f7
commit 6452d2e774
1314 changed files with 218350 additions and 38 deletions

View File

@@ -0,0 +1,4 @@
# SPDX-License-Identifier: CC0-1.0
Files in this directory are imported from v6.10-rc1 of the Linux kernel. Do not
modify them manually.

View File

@@ -0,0 +1,346 @@
/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
/*
* bcm2835-isp.h
*
* BCM2835 ISP driver - user space header file.
*
* Copyright © 2019-2020 Raspberry Pi Ltd
*
* Author: Naushir Patuck (naush@raspberrypi.com)
*
*/
#ifndef __BCM2835_ISP_H_
#define __BCM2835_ISP_H_
#include <linux/v4l2-controls.h>
#define V4L2_CID_USER_BCM2835_ISP_CC_MATRIX \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0001)
#define V4L2_CID_USER_BCM2835_ISP_LENS_SHADING \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0002)
#define V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0003)
#define V4L2_CID_USER_BCM2835_ISP_GEQ \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0004)
#define V4L2_CID_USER_BCM2835_ISP_GAMMA \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0005)
#define V4L2_CID_USER_BCM2835_ISP_DENOISE \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0006)
#define V4L2_CID_USER_BCM2835_ISP_SHARPEN \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0007)
#define V4L2_CID_USER_BCM2835_ISP_DPC \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0008)
#define V4L2_CID_USER_BCM2835_ISP_CDN \
(V4L2_CID_USER_BCM2835_ISP_BASE + 0x0009)
/*
* All structs below are directly mapped onto the equivalent structs in
* drivers/staging/vc04_services/vchiq-mmal/mmal-parameters.h
* for convenience.
*/
/**
* struct bcm2835_isp_rational - Rational value type.
*
* @num: Numerator.
* @den: Denominator.
*/
struct bcm2835_isp_rational {
__s32 num;
__u32 den;
};
/**
* struct bcm2835_isp_ccm - Colour correction matrix.
*
* @ccm: 3x3 correction matrix coefficients.
* @offsets: 1x3 correction offsets.
*/
struct bcm2835_isp_ccm {
struct bcm2835_isp_rational ccm[3][3];
__s32 offsets[3];
};
/**
* struct bcm2835_isp_custom_ccm - Custom CCM applied with the
* V4L2_CID_USER_BCM2835_ISP_CC_MATRIX ctrl.
*
* @enabled: Enable custom CCM.
* @ccm: Custom CCM coefficients and offsets.
*/
struct bcm2835_isp_custom_ccm {
__u32 enabled;
struct bcm2835_isp_ccm ccm;
};
/**
* enum bcm2835_isp_gain_format - format of the gains in the lens shading
* tables used with the
* V4L2_CID_USER_BCM2835_ISP_LENS_SHADING ctrl.
*
* @GAIN_FORMAT_U0P8_1: Gains are u0.8 format, starting at 1.0
* @GAIN_FORMAT_U1P7_0: Gains are u1.7 format, starting at 0.0
* @GAIN_FORMAT_U1P7_1: Gains are u1.7 format, starting at 1.0
* @GAIN_FORMAT_U2P6_0: Gains are u2.6 format, starting at 0.0
* @GAIN_FORMAT_U2P6_1: Gains are u2.6 format, starting at 1.0
* @GAIN_FORMAT_U3P5_0: Gains are u3.5 format, starting at 0.0
* @GAIN_FORMAT_U3P5_1: Gains are u3.5 format, starting at 1.0
* @GAIN_FORMAT_U4P10: Gains are u4.10 format, starting at 0.0
*/
enum bcm2835_isp_gain_format {
GAIN_FORMAT_U0P8_1 = 0,
GAIN_FORMAT_U1P7_0 = 1,
GAIN_FORMAT_U1P7_1 = 2,
GAIN_FORMAT_U2P6_0 = 3,
GAIN_FORMAT_U2P6_1 = 4,
GAIN_FORMAT_U3P5_0 = 5,
GAIN_FORMAT_U3P5_1 = 6,
GAIN_FORMAT_U4P10 = 7,
};
/**
* struct bcm2835_isp_lens_shading - Lens shading tables supplied with the
* V4L2_CID_USER_BCM2835_ISP_LENS_SHADING
* ctrl.
*
* @enabled: Enable lens shading.
* @grid_cell_size: Size of grid cells in samples (16, 32, 64, 128 or 256).
* @grid_width: Width of lens shading tables in grid cells.
* @grid_stride: Row to row distance (in grid cells) between grid cells
* in the same horizontal location.
* @grid_height: Height of lens shading tables in grid cells.
* @dmabuf: dmabuf file handle containing the table.
* @ref_transform: Reference transform - unsupported, please pass zero.
* @corner_sampled: Whether the gains are sampled at the corner points
* of the grid cells or in the cell centres.
* @gain_format: Format of the gains (see enum &bcm2835_isp_gain_format).
*/
struct bcm2835_isp_lens_shading {
__u32 enabled;
__u32 grid_cell_size;
__u32 grid_width;
__u32 grid_stride;
__u32 grid_height;
__s32 dmabuf;
__u32 ref_transform;
__u32 corner_sampled;
__u32 gain_format;
};
/**
* struct bcm2835_isp_black_level - Sensor black level set with the
* V4L2_CID_USER_BCM2835_ISP_BLACK_LEVEL ctrl.
*
* @enabled: Enable black level.
* @black_level_r: Black level for red channel.
* @black_level_g: Black level for green channels.
* @black_level_b: Black level for blue channel.
*/
struct bcm2835_isp_black_level {
__u32 enabled;
__u16 black_level_r;
__u16 black_level_g;
__u16 black_level_b;
__u8 padding[2]; /* Unused */
};
/**
* struct bcm2835_isp_geq - Green equalisation parameters set with the
* V4L2_CID_USER_BCM2835_ISP_GEQ ctrl.
*
* @enabled: Enable green equalisation.
* @offset: Fixed offset of the green equalisation threshold.
* @slope: Slope of the green equalisation threshold.
*/
struct bcm2835_isp_geq {
__u32 enabled;
__u32 offset;
struct bcm2835_isp_rational slope;
};
#define BCM2835_NUM_GAMMA_PTS 33
/**
* struct bcm2835_isp_gamma - Gamma parameters set with the
* V4L2_CID_USER_BCM2835_ISP_GAMMA ctrl.
*
* @enabled: Enable gamma adjustment.
* @X: X values of the points defining the gamma curve.
* Values should be scaled to 16 bits.
* @Y: Y values of the points defining the gamma curve.
* Values should be scaled to 16 bits.
*/
struct bcm2835_isp_gamma {
__u32 enabled;
__u16 x[BCM2835_NUM_GAMMA_PTS];
__u16 y[BCM2835_NUM_GAMMA_PTS];
};
/**
* enum bcm2835_isp_cdn_mode - Mode of operation for colour denoise.
*
* @CDN_MODE_FAST: Fast (but lower quality) colour denoise
* algorithm, typically used for video recording.
* @CDN_HIGH_QUALITY: High quality (but slower) colour denoise
* algorithm, typically used for stills capture.
*/
enum bcm2835_isp_cdn_mode {
CDN_MODE_FAST = 0,
CDN_MODE_HIGH_QUALITY = 1,
};
/**
* struct bcm2835_isp_cdn - Colour denoise parameters set with the
* V4L2_CID_USER_BCM2835_ISP_CDN ctrl.
*
* @enabled: Enable colour denoise.
* @cdn_mode: Colour denoise operating mode (see enum &bcm2835_isp_cdn_mode)
*/
struct bcm2835_isp_cdn {
__u32 enabled;
__u32 mode;
};
/**
* struct bcm2835_isp_denoise - Denoise parameters set with the
* V4L2_CID_USER_BCM2835_ISP_DENOISE ctrl.
*
* @enabled: Enable denoise.
* @constant: Fixed offset of the noise threshold.
* @slope: Slope of the noise threshold.
* @strength: Denoise strength between 0.0 (off) and 1.0 (maximum).
*/
struct bcm2835_isp_denoise {
__u32 enabled;
__u32 constant;
struct bcm2835_isp_rational slope;
struct bcm2835_isp_rational strength;
};
/**
* struct bcm2835_isp_sharpen - Sharpen parameters set with the
* V4L2_CID_USER_BCM2835_ISP_SHARPEN ctrl.
*
* @enabled: Enable sharpening.
* @threshold: Threshold at which to start sharpening pixels.
* @strength: Strength with which pixel sharpening increases.
* @limit: Limit to the amount of sharpening applied.
*/
struct bcm2835_isp_sharpen {
__u32 enabled;
struct bcm2835_isp_rational threshold;
struct bcm2835_isp_rational strength;
struct bcm2835_isp_rational limit;
};
/**
* enum bcm2835_isp_dpc_mode - defective pixel correction (DPC) strength.
*
* @DPC_MODE_OFF: No DPC.
* @DPC_MODE_NORMAL: Normal DPC.
* @DPC_MODE_STRONG: Strong DPC.
*/
enum bcm2835_isp_dpc_mode {
DPC_MODE_OFF = 0,
DPC_MODE_NORMAL = 1,
DPC_MODE_STRONG = 2,
};
/**
* struct bcm2835_isp_dpc - Defective pixel correction (DPC) parameters set
* with the V4L2_CID_USER_BCM2835_ISP_DPC ctrl.
*
* @enabled: Enable DPC.
* @strength: DPC strength (see enum &bcm2835_isp_dpc_mode).
*/
struct bcm2835_isp_dpc {
__u32 enabled;
__u32 strength;
};
/*
* ISP statistics structures.
*
* The bcm2835_isp_stats structure is generated at the output of the
* statistics node. Note that this does not directly map onto the statistics
* output of the ISP HW. Instead, the MMAL firmware code maps the HW statistics
* to the bcm2835_isp_stats structure.
*/
#define DEFAULT_AWB_REGIONS_X 16
#define DEFAULT_AWB_REGIONS_Y 12
#define NUM_HISTOGRAMS 2
#define NUM_HISTOGRAM_BINS 128
#define AWB_REGIONS (DEFAULT_AWB_REGIONS_X * DEFAULT_AWB_REGIONS_Y)
#define FLOATING_REGIONS 16
#define AGC_REGIONS 16
#define FOCUS_REGIONS 12
/**
* struct bcm2835_isp_stats_hist - Histogram statistics
*
* @r_hist: Red channel histogram.
* @g_hist: Combined green channel histogram.
* @b_hist: Blue channel histogram.
*/
struct bcm2835_isp_stats_hist {
__u32 r_hist[NUM_HISTOGRAM_BINS];
__u32 g_hist[NUM_HISTOGRAM_BINS];
__u32 b_hist[NUM_HISTOGRAM_BINS];
};
/**
* struct bcm2835_isp_stats_region - Region sums.
*
* @counted: The number of 2x2 bayer tiles accumulated.
* @notcounted: The number of 2x2 bayer tiles not accumulated.
* @r_sum: Total sum of counted pixels in the red channel for a region.
* @g_sum: Total sum of counted pixels in the green channel for a region.
* @b_sum: Total sum of counted pixels in the blue channel for a region.
*/
struct bcm2835_isp_stats_region {
__u32 counted;
__u32 notcounted;
__u64 r_sum;
__u64 g_sum;
__u64 b_sum;
};
/**
* struct bcm2835_isp_stats_focus - Focus statistics.
*
* @contrast_val: Focus measure - accumulated output of the focus filter.
* In the first dimension, index [0] counts pixels below a
* preset threshold, and index [1] counts pixels above the
* threshold. In the second dimension, index [0] uses the
* first predefined filter, and index [1] uses the second
* predefined filter.
* @contrast_val_num: The number of counted pixels in the above accumulation.
*/
struct bcm2835_isp_stats_focus {
__u64 contrast_val[2][2];
__u32 contrast_val_num[2][2];
};
/**
* struct bcm2835_isp_stats - ISP statistics.
*
* @version: Version of the bcm2835_isp_stats structure.
* @size: Size of the bcm2835_isp_stats structure.
* @hist: Histogram statistics for the entire image.
* @awb_stats: Statistics for the regions defined for AWB calculations.
* @floating_stats: Statistics for arbitrarily placed (floating) regions.
* @agc_stats: Statistics for the regions defined for AGC calculations.
* @focus_stats: Focus filter statistics for the focus regions.
*/
struct bcm2835_isp_stats {
__u32 version;
__u32 size;
struct bcm2835_isp_stats_hist hist[NUM_HISTOGRAMS];
struct bcm2835_isp_stats_region awb_stats[AWB_REGIONS];
struct bcm2835_isp_stats_region floating_stats[FLOATING_REGIONS];
struct bcm2835_isp_stats_region agc_stats[AGC_REGIONS];
struct bcm2835_isp_stats_focus focus_stats[FOCUS_REGIONS];
};
#endif /* __BCM2835_ISP_H_ */

View File

@@ -0,0 +1,182 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Framework for buffer objects that can be shared across devices/subsystems.
*
* Copyright(C) 2015 Intel Ltd
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DMA_BUF_UAPI_H_
#define _DMA_BUF_UAPI_H_
#include <linux/types.h>
/**
* struct dma_buf_sync - Synchronize with CPU access.
*
* When a DMA buffer is accessed from the CPU via mmap, it is not always
* possible to guarantee coherency between the CPU-visible map and underlying
* memory. To manage coherency, DMA_BUF_IOCTL_SYNC must be used to bracket
* any CPU access to give the kernel the chance to shuffle memory around if
* needed.
*
* Prior to accessing the map, the client must call DMA_BUF_IOCTL_SYNC
* with DMA_BUF_SYNC_START and the appropriate read/write flags. Once the
* access is complete, the client should call DMA_BUF_IOCTL_SYNC with
* DMA_BUF_SYNC_END and the same read/write flags.
*
* The synchronization provided via DMA_BUF_IOCTL_SYNC only provides cache
* coherency. It does not prevent other processes or devices from
* accessing the memory at the same time. If synchronization with a GPU or
* other device driver is required, it is the client's responsibility to
* wait for buffer to be ready for reading or writing before calling this
* ioctl with DMA_BUF_SYNC_START. Likewise, the client must ensure that
* follow-up work is not submitted to GPU or other device driver until
* after this ioctl has been called with DMA_BUF_SYNC_END?
*
* If the driver or API with which the client is interacting uses implicit
* synchronization, waiting for prior work to complete can be done via
* poll() on the DMA buffer file descriptor. If the driver or API requires
* explicit synchronization, the client may have to wait on a sync_file or
* other synchronization primitive outside the scope of the DMA buffer API.
*/
struct dma_buf_sync {
/**
* @flags: Set of access flags
*
* DMA_BUF_SYNC_START:
* Indicates the start of a map access session.
*
* DMA_BUF_SYNC_END:
* Indicates the end of a map access session.
*
* DMA_BUF_SYNC_READ:
* Indicates that the mapped DMA buffer will be read by the
* client via the CPU map.
*
* DMA_BUF_SYNC_WRITE:
* Indicates that the mapped DMA buffer will be written by the
* client via the CPU map.
*
* DMA_BUF_SYNC_RW:
* An alias for DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE.
*/
__u64 flags;
};
#define DMA_BUF_SYNC_READ (1 << 0)
#define DMA_BUF_SYNC_WRITE (2 << 0)
#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
#define DMA_BUF_SYNC_START (0 << 2)
#define DMA_BUF_SYNC_END (1 << 2)
#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
#define DMA_BUF_NAME_LEN 32
/**
* struct dma_buf_export_sync_file - Get a sync_file from a dma-buf
*
* Userspace can perform a DMA_BUF_IOCTL_EXPORT_SYNC_FILE to retrieve the
* current set of fences on a dma-buf file descriptor as a sync_file. CPU
* waits via poll() or other driver-specific mechanisms typically wait on
* whatever fences are on the dma-buf at the time the wait begins. This
* is similar except that it takes a snapshot of the current fences on the
* dma-buf for waiting later instead of waiting immediately. This is
* useful for modern graphics APIs such as Vulkan which assume an explicit
* synchronization model but still need to inter-operate with dma-buf.
*
* The intended usage pattern is the following:
*
* 1. Export a sync_file with flags corresponding to the expected GPU usage
* via DMA_BUF_IOCTL_EXPORT_SYNC_FILE.
*
* 2. Submit rendering work which uses the dma-buf. The work should wait on
* the exported sync file before rendering and produce another sync_file
* when complete.
*
* 3. Import the rendering-complete sync_file into the dma-buf with flags
* corresponding to the GPU usage via DMA_BUF_IOCTL_IMPORT_SYNC_FILE.
*
* Unlike doing implicit synchronization via a GPU kernel driver's exec ioctl,
* the above is not a single atomic operation. If userspace wants to ensure
* ordering via these fences, it is the respnosibility of userspace to use
* locks or other mechanisms to ensure that no other context adds fences or
* submits work between steps 1 and 3 above.
*/
struct dma_buf_export_sync_file {
/**
* @flags: Read/write flags
*
* Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
*
* If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
* the returned sync file waits on any writers of the dma-buf to
* complete. Waiting on the returned sync file is equivalent to
* poll() with POLLIN.
*
* If DMA_BUF_SYNC_WRITE is set, the returned sync file waits on
* any users of the dma-buf (read or write) to complete. Waiting
* on the returned sync file is equivalent to poll() with POLLOUT.
* If both DMA_BUF_SYNC_WRITE and DMA_BUF_SYNC_READ are set, this
* is equivalent to just DMA_BUF_SYNC_WRITE.
*/
__u32 flags;
/** @fd: Returned sync file descriptor */
__s32 fd;
};
/**
* struct dma_buf_import_sync_file - Insert a sync_file into a dma-buf
*
* Userspace can perform a DMA_BUF_IOCTL_IMPORT_SYNC_FILE to insert a
* sync_file into a dma-buf for the purposes of implicit synchronization
* with other dma-buf consumers. This allows clients using explicitly
* synchronized APIs such as Vulkan to inter-op with dma-buf consumers
* which expect implicit synchronization such as OpenGL or most media
* drivers/video.
*/
struct dma_buf_import_sync_file {
/**
* @flags: Read/write flags
*
* Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
*
* If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
* this inserts the sync_file as a read-only fence. Any subsequent
* implicitly synchronized writes to this dma-buf will wait on this
* fence but reads will not.
*
* If DMA_BUF_SYNC_WRITE is set, this inserts the sync_file as a
* write fence. All subsequent implicitly synchronized access to
* this dma-buf will wait on this fence.
*/
__u32 flags;
/** @fd: Sync file descriptor */
__s32 fd;
};
#define DMA_BUF_BASE 'b'
#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
/* 32/64bitness of this uapi was botched in android, there's no difference
* between them in actual uapi, they're just different numbers.
*/
#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, __u32)
#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, __u64)
#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE _IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file)
#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE _IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file)
#endif

View File

@@ -0,0 +1,53 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* DMABUF Heaps Userspace API
*
* Copyright (C) 2011 Google, Inc.
* Copyright (C) 2019 Linaro Ltd.
*/
#ifndef _LINUX_DMABUF_POOL_H
#define _LINUX_DMABUF_POOL_H
#include <linux/ioctl.h>
#include <linux/types.h>
/**
* DOC: DMABUF Heaps Userspace API
*/
/* Valid FD_FLAGS are O_CLOEXEC, O_RDONLY, O_WRONLY, O_RDWR */
#define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)
/* Currently no heap flags */
#define DMA_HEAP_VALID_HEAP_FLAGS (0)
/**
* struct dma_heap_allocation_data - metadata passed from userspace for
* allocations
* @len: size of the allocation
* @fd: will be populated with a fd which provides the
* handle to the allocated dma-buf
* @fd_flags: file descriptor flags used when allocating
* @heap_flags: flags passed to heap
*
* Provided by userspace as an argument to the ioctl
*/
struct dma_heap_allocation_data {
__u64 len;
__u32 fd;
__u32 fd_flags;
__u64 heap_flags;
};
#define DMA_HEAP_IOC_MAGIC 'H'
/**
* DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool
*
* Takes a dma_heap_allocation_data struct and returns it with the fd field
* populated with the dmabuf handle of the allocation.
*/
#define DMA_HEAP_IOCTL_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\
struct dma_heap_allocation_data)
#endif /* _LINUX_DMABUF_POOL_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,186 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Media Bus API header
*
* Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __LINUX_MEDIA_BUS_FORMAT_H
#define __LINUX_MEDIA_BUS_FORMAT_H
/*
* These bus formats uniquely identify data formats on the data bus. Format 0
* is reserved, MEDIA_BUS_FMT_FIXED shall be used by host-client pairs, where
* the data format is fixed. Additionally, "2X8" means that one pixel is
* transferred in two 8-bit samples, "BE" or "LE" specify in which order those
* samples are transferred over the bus: "LE" means that the least significant
* bits are transferred first, "BE" means that the most significant bits are
* transferred first, and "PADHI" and "PADLO" define which bits - low or high,
* in the incomplete high byte, are filled with padding bits.
*
* The bus formats are grouped by type, bus_width, bits per component, samples
* per pixel and order of subsamples. Numerical values are sorted using generic
* numerical sort order (8 thus comes before 10).
*
* As their value can't change when a new bus format is inserted in the
* enumeration, the bus formats are explicitly given a numerical value. The next
* free values for each category are listed below, update them when inserting
* new pixel codes.
*/
#define MEDIA_BUS_FMT_FIXED 0x0001
/* RGB - next is 0x1026 */
#define MEDIA_BUS_FMT_RGB444_1X12 0x1016
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE 0x1001
#define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE 0x1002
#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE 0x1003
#define MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE 0x1004
#define MEDIA_BUS_FMT_RGB565_1X16 0x1017
#define MEDIA_BUS_FMT_BGR565_2X8_BE 0x1005
#define MEDIA_BUS_FMT_BGR565_2X8_LE 0x1006
#define MEDIA_BUS_FMT_RGB565_2X8_BE 0x1007
#define MEDIA_BUS_FMT_RGB565_2X8_LE 0x1008
#define MEDIA_BUS_FMT_RGB666_1X18 0x1009
#define MEDIA_BUS_FMT_RGB666_2X9_BE 0x1025
#define MEDIA_BUS_FMT_BGR666_1X18 0x1023
#define MEDIA_BUS_FMT_RBG888_1X24 0x100e
#define MEDIA_BUS_FMT_RGB666_1X24_CPADHI 0x1015
#define MEDIA_BUS_FMT_BGR666_1X24_CPADHI 0x1024
#define MEDIA_BUS_FMT_RGB565_1X24_CPADHI 0x1022
#define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG 0x1010
#define MEDIA_BUS_FMT_BGR888_1X24 0x1013
#define MEDIA_BUS_FMT_BGR888_3X8 0x101b
#define MEDIA_BUS_FMT_GBR888_1X24 0x1014
#define MEDIA_BUS_FMT_RGB888_1X24 0x100a
#define MEDIA_BUS_FMT_RGB888_2X12_BE 0x100b
#define MEDIA_BUS_FMT_RGB888_2X12_LE 0x100c
#define MEDIA_BUS_FMT_RGB888_3X8 0x101c
#define MEDIA_BUS_FMT_RGB888_3X8_DELTA 0x101d
#define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG 0x1011
#define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA 0x1012
#define MEDIA_BUS_FMT_RGB666_1X30_CPADLO 0x101e
#define MEDIA_BUS_FMT_RGB888_1X30_CPADLO 0x101f
#define MEDIA_BUS_FMT_ARGB8888_1X32 0x100d
#define MEDIA_BUS_FMT_RGB888_1X32_PADHI 0x100f
#define MEDIA_BUS_FMT_RGB101010_1X30 0x1018
#define MEDIA_BUS_FMT_RGB666_1X36_CPADLO 0x1020
#define MEDIA_BUS_FMT_RGB888_1X36_CPADLO 0x1021
#define MEDIA_BUS_FMT_RGB121212_1X36 0x1019
#define MEDIA_BUS_FMT_RGB161616_1X48 0x101a
/* YUV (including grey) - next is 0x202f */
#define MEDIA_BUS_FMT_Y8_1X8 0x2001
#define MEDIA_BUS_FMT_UV8_1X8 0x2015
#define MEDIA_BUS_FMT_UYVY8_1_5X8 0x2002
#define MEDIA_BUS_FMT_VYUY8_1_5X8 0x2003
#define MEDIA_BUS_FMT_YUYV8_1_5X8 0x2004
#define MEDIA_BUS_FMT_YVYU8_1_5X8 0x2005
#define MEDIA_BUS_FMT_UYVY8_2X8 0x2006
#define MEDIA_BUS_FMT_VYUY8_2X8 0x2007
#define MEDIA_BUS_FMT_YUYV8_2X8 0x2008
#define MEDIA_BUS_FMT_YVYU8_2X8 0x2009
#define MEDIA_BUS_FMT_Y10_1X10 0x200a
#define MEDIA_BUS_FMT_Y10_2X8_PADHI_LE 0x202c
#define MEDIA_BUS_FMT_UYVY10_2X10 0x2018
#define MEDIA_BUS_FMT_VYUY10_2X10 0x2019
#define MEDIA_BUS_FMT_YUYV10_2X10 0x200b
#define MEDIA_BUS_FMT_YVYU10_2X10 0x200c
#define MEDIA_BUS_FMT_Y12_1X12 0x2013
#define MEDIA_BUS_FMT_UYVY12_2X12 0x201c
#define MEDIA_BUS_FMT_VYUY12_2X12 0x201d
#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
#define MEDIA_BUS_FMT_Y14_1X14 0x202d
#define MEDIA_BUS_FMT_Y16_1X16 0x202e
#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
#define MEDIA_BUS_FMT_YVYU8_1X16 0x2012
#define MEDIA_BUS_FMT_YDYUYDYV8_1X16 0x2014
#define MEDIA_BUS_FMT_UYVY10_1X20 0x201a
#define MEDIA_BUS_FMT_VYUY10_1X20 0x201b
#define MEDIA_BUS_FMT_YUYV10_1X20 0x200d
#define MEDIA_BUS_FMT_YVYU10_1X20 0x200e
#define MEDIA_BUS_FMT_VUY8_1X24 0x2024
#define MEDIA_BUS_FMT_YUV8_1X24 0x2025
#define MEDIA_BUS_FMT_UYYVYY8_0_5X24 0x2026
#define MEDIA_BUS_FMT_UYVY12_1X24 0x2020
#define MEDIA_BUS_FMT_VYUY12_1X24 0x2021
#define MEDIA_BUS_FMT_YUYV12_1X24 0x2022
#define MEDIA_BUS_FMT_YVYU12_1X24 0x2023
#define MEDIA_BUS_FMT_YUV10_1X30 0x2016
#define MEDIA_BUS_FMT_UYYVYY10_0_5X30 0x2027
#define MEDIA_BUS_FMT_AYUV8_1X32 0x2017
#define MEDIA_BUS_FMT_UYYVYY12_0_5X36 0x2028
#define MEDIA_BUS_FMT_YUV12_1X36 0x2029
#define MEDIA_BUS_FMT_YUV16_1X48 0x202a
#define MEDIA_BUS_FMT_UYYVYY16_0_5X48 0x202b
/* Bayer - next is 0x3021 */
#define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001
#define MEDIA_BUS_FMT_SGBRG8_1X8 0x3013
#define MEDIA_BUS_FMT_SGRBG8_1X8 0x3002
#define MEDIA_BUS_FMT_SRGGB8_1X8 0x3014
#define MEDIA_BUS_FMT_SBGGR10_ALAW8_1X8 0x3015
#define MEDIA_BUS_FMT_SGBRG10_ALAW8_1X8 0x3016
#define MEDIA_BUS_FMT_SGRBG10_ALAW8_1X8 0x3017
#define MEDIA_BUS_FMT_SRGGB10_ALAW8_1X8 0x3018
#define MEDIA_BUS_FMT_SBGGR10_DPCM8_1X8 0x300b
#define MEDIA_BUS_FMT_SGBRG10_DPCM8_1X8 0x300c
#define MEDIA_BUS_FMT_SGRBG10_DPCM8_1X8 0x3009
#define MEDIA_BUS_FMT_SRGGB10_DPCM8_1X8 0x300d
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_BE 0x3003
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADHI_LE 0x3004
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_BE 0x3005
#define MEDIA_BUS_FMT_SBGGR10_2X8_PADLO_LE 0x3006
#define MEDIA_BUS_FMT_SBGGR10_1X10 0x3007
#define MEDIA_BUS_FMT_SGBRG10_1X10 0x300e
#define MEDIA_BUS_FMT_SGRBG10_1X10 0x300a
#define MEDIA_BUS_FMT_SRGGB10_1X10 0x300f
#define MEDIA_BUS_FMT_SBGGR12_1X12 0x3008
#define MEDIA_BUS_FMT_SGBRG12_1X12 0x3010
#define MEDIA_BUS_FMT_SGRBG12_1X12 0x3011
#define MEDIA_BUS_FMT_SRGGB12_1X12 0x3012
#define MEDIA_BUS_FMT_SBGGR14_1X14 0x3019
#define MEDIA_BUS_FMT_SGBRG14_1X14 0x301a
#define MEDIA_BUS_FMT_SGRBG14_1X14 0x301b
#define MEDIA_BUS_FMT_SRGGB14_1X14 0x301c
#define MEDIA_BUS_FMT_SBGGR16_1X16 0x301d
#define MEDIA_BUS_FMT_SGBRG16_1X16 0x301e
#define MEDIA_BUS_FMT_SGRBG16_1X16 0x301f
#define MEDIA_BUS_FMT_SRGGB16_1X16 0x3020
/* JPEG compressed formats - next is 0x4002 */
#define MEDIA_BUS_FMT_JPEG_1X8 0x4001
/* Vendor specific formats - next is 0x5002 */
/* S5C73M3 sensor specific interleaved UYVY and JPEG */
#define MEDIA_BUS_FMT_S5C_UYVY_JPEG_1X8 0x5001
/* HSV - next is 0x6002 */
#define MEDIA_BUS_FMT_AHSV8888_1X32 0x6001
/*
* This format should be used when the same driver handles
* both sides of the link and the bus format is a fixed
* metadata format that is not configurable from userspace.
* Width and height will be set to 0 for this format.
*/
#define MEDIA_BUS_FMT_METADATA_FIXED 0x7001
/* Generic line based metadata formats for serial buses. Next is 0x8008. */
#define MEDIA_BUS_FMT_META_8 0x8001
#define MEDIA_BUS_FMT_META_10 0x8002
#define MEDIA_BUS_FMT_META_12 0x8003
#define MEDIA_BUS_FMT_META_14 0x8004
#define MEDIA_BUS_FMT_META_16 0x8005
#define MEDIA_BUS_FMT_META_20 0x8006
#define MEDIA_BUS_FMT_META_24 0x8007
#endif /* __LINUX_MEDIA_BUS_FORMAT_H */

View File

@@ -0,0 +1,420 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Multimedia device API
*
* Copyright (C) 2010 Nokia Corporation
*
* Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
* Sakari Ailus <sakari.ailus@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __LINUX_MEDIA_H
#define __LINUX_MEDIA_H
#include <linux/ioctl.h>
#include <linux/types.h>
struct media_device_info {
char driver[16];
char model[32];
char serial[40];
char bus_info[32];
__u32 media_version;
__u32 hw_revision;
__u32 driver_version;
__u32 reserved[31];
};
/*
* Base number ranges for entity functions
*
* NOTE: Userspace should not rely on these ranges to identify a group
* of function types, as newer functions can be added with any name within
* the full u32 range.
*
* Some older functions use the MEDIA_ENT_F_OLD_*_BASE range. Do not
* change this, this is for backwards compatibility. When adding new
* functions always use MEDIA_ENT_F_BASE.
*/
#define MEDIA_ENT_F_BASE 0x00000000
#define MEDIA_ENT_F_OLD_BASE 0x00010000
#define MEDIA_ENT_F_OLD_SUBDEV_BASE 0x00020000
/*
* Initial value to be used when a new entity is created
* Drivers should change it to something useful.
*/
#define MEDIA_ENT_F_UNKNOWN MEDIA_ENT_F_BASE
/*
* Subdevs are initialized with MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN in order
* to preserve backward compatibility. Drivers must change to the proper
* subdev type before registering the entity.
*/
#define MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN MEDIA_ENT_F_OLD_SUBDEV_BASE
/*
* DVB entity functions
*/
#define MEDIA_ENT_F_DTV_DEMOD (MEDIA_ENT_F_BASE + 0x00001)
#define MEDIA_ENT_F_TS_DEMUX (MEDIA_ENT_F_BASE + 0x00002)
#define MEDIA_ENT_F_DTV_CA (MEDIA_ENT_F_BASE + 0x00003)
#define MEDIA_ENT_F_DTV_NET_DECAP (MEDIA_ENT_F_BASE + 0x00004)
/*
* I/O entity functions
*/
#define MEDIA_ENT_F_IO_V4L (MEDIA_ENT_F_OLD_BASE + 1)
#define MEDIA_ENT_F_IO_DTV (MEDIA_ENT_F_BASE + 0x01001)
#define MEDIA_ENT_F_IO_VBI (MEDIA_ENT_F_BASE + 0x01002)
#define MEDIA_ENT_F_IO_SWRADIO (MEDIA_ENT_F_BASE + 0x01003)
/*
* Sensor functions
*/
#define MEDIA_ENT_F_CAM_SENSOR (MEDIA_ENT_F_OLD_SUBDEV_BASE + 1)
#define MEDIA_ENT_F_FLASH (MEDIA_ENT_F_OLD_SUBDEV_BASE + 2)
#define MEDIA_ENT_F_LENS (MEDIA_ENT_F_OLD_SUBDEV_BASE + 3)
/*
* Digital TV, analog TV, radio and/or software defined radio tuner functions.
*
* It is a responsibility of the master/bridge drivers to add connectors
* and links for MEDIA_ENT_F_TUNER. Please notice that some old tuners
* may require the usage of separate I2C chips to decode analog TV signals,
* when the master/bridge chipset doesn't have its own TV standard decoder.
* On such cases, the IF-PLL staging is mapped via one or two entities:
* MEDIA_ENT_F_IF_VID_DECODER and/or MEDIA_ENT_F_IF_AUD_DECODER.
*/
#define MEDIA_ENT_F_TUNER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 5)
/*
* Analog TV IF-PLL decoder functions
*
* It is a responsibility of the master/bridge drivers to create links
* for MEDIA_ENT_F_IF_VID_DECODER and MEDIA_ENT_F_IF_AUD_DECODER.
*/
#define MEDIA_ENT_F_IF_VID_DECODER (MEDIA_ENT_F_BASE + 0x02001)
#define MEDIA_ENT_F_IF_AUD_DECODER (MEDIA_ENT_F_BASE + 0x02002)
/*
* Audio entity functions
*/
#define MEDIA_ENT_F_AUDIO_CAPTURE (MEDIA_ENT_F_BASE + 0x03001)
#define MEDIA_ENT_F_AUDIO_PLAYBACK (MEDIA_ENT_F_BASE + 0x03002)
#define MEDIA_ENT_F_AUDIO_MIXER (MEDIA_ENT_F_BASE + 0x03003)
/*
* Processing entity functions
*/
#define MEDIA_ENT_F_PROC_VIDEO_COMPOSER (MEDIA_ENT_F_BASE + 0x4001)
#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER (MEDIA_ENT_F_BASE + 0x4002)
#define MEDIA_ENT_F_PROC_VIDEO_PIXEL_ENC_CONV (MEDIA_ENT_F_BASE + 0x4003)
#define MEDIA_ENT_F_PROC_VIDEO_LUT (MEDIA_ENT_F_BASE + 0x4004)
#define MEDIA_ENT_F_PROC_VIDEO_SCALER (MEDIA_ENT_F_BASE + 0x4005)
#define MEDIA_ENT_F_PROC_VIDEO_STATISTICS (MEDIA_ENT_F_BASE + 0x4006)
#define MEDIA_ENT_F_PROC_VIDEO_ENCODER (MEDIA_ENT_F_BASE + 0x4007)
#define MEDIA_ENT_F_PROC_VIDEO_DECODER (MEDIA_ENT_F_BASE + 0x4008)
#define MEDIA_ENT_F_PROC_VIDEO_ISP (MEDIA_ENT_F_BASE + 0x4009)
/*
* Switch and bridge entity functions
*/
#define MEDIA_ENT_F_VID_MUX (MEDIA_ENT_F_BASE + 0x5001)
#define MEDIA_ENT_F_VID_IF_BRIDGE (MEDIA_ENT_F_BASE + 0x5002)
/*
* Video decoder/encoder functions
*/
#define MEDIA_ENT_F_ATV_DECODER (MEDIA_ENT_F_OLD_SUBDEV_BASE + 4)
#define MEDIA_ENT_F_DV_DECODER (MEDIA_ENT_F_BASE + 0x6001)
#define MEDIA_ENT_F_DV_ENCODER (MEDIA_ENT_F_BASE + 0x6002)
/* Entity flags */
#define MEDIA_ENT_FL_DEFAULT (1U << 0)
#define MEDIA_ENT_FL_CONNECTOR (1U << 1)
/* OR with the entity id value to find the next entity */
#define MEDIA_ENT_ID_FLAG_NEXT (1U << 31)
struct media_entity_desc {
__u32 id;
char name[32];
__u32 type;
__u32 revision;
__u32 flags;
__u32 group_id;
__u16 pads;
__u16 links;
__u32 reserved[4];
union {
/* Node specifications */
struct {
__u32 major;
__u32 minor;
} dev;
/*
* TODO: this shouldn't have been added without
* actual drivers that use this. When the first real driver
* appears that sets this information, special attention
* should be given whether this information is 1) enough, and
* 2) can deal with udev rules that rename devices. The struct
* dev would not be sufficient for this since that does not
* contain the subdevice information. In addition, struct dev
* can only refer to a single device, and not to multiple (e.g.
* pcm and mixer devices).
*/
struct {
__u32 card;
__u32 device;
__u32 subdevice;
} alsa;
/*
* DEPRECATED: previous node specifications. Kept just to
* avoid breaking compilation. Use media_entity_desc.dev
* instead.
*/
struct {
__u32 major;
__u32 minor;
} v4l;
struct {
__u32 major;
__u32 minor;
} fb;
int dvb;
/* Sub-device specifications */
/* Nothing needed yet */
__u8 raw[184];
};
};
#define MEDIA_PAD_FL_SINK (1U << 0)
#define MEDIA_PAD_FL_SOURCE (1U << 1)
#define MEDIA_PAD_FL_MUST_CONNECT (1U << 2)
struct media_pad_desc {
__u32 entity; /* entity ID */
__u16 index; /* pad index */
__u32 flags; /* pad flags */
__u32 reserved[2];
};
#define MEDIA_LNK_FL_ENABLED (1U << 0)
#define MEDIA_LNK_FL_IMMUTABLE (1U << 1)
#define MEDIA_LNK_FL_DYNAMIC (1U << 2)
#define MEDIA_LNK_FL_LINK_TYPE (0xf << 28)
# define MEDIA_LNK_FL_DATA_LINK (0U << 28)
# define MEDIA_LNK_FL_INTERFACE_LINK (1U << 28)
# define MEDIA_LNK_FL_ANCILLARY_LINK (2U << 28)
struct media_link_desc {
struct media_pad_desc source;
struct media_pad_desc sink;
__u32 flags;
__u32 reserved[2];
};
struct media_links_enum {
__u32 entity;
/* Should have enough room for pads elements */
struct media_pad_desc *pads;
/* Should have enough room for links elements */
struct media_link_desc *links;
__u32 reserved[4];
};
/* Interface type ranges */
#define MEDIA_INTF_T_DVB_BASE 0x00000100
#define MEDIA_INTF_T_V4L_BASE 0x00000200
/* Interface types */
#define MEDIA_INTF_T_DVB_FE (MEDIA_INTF_T_DVB_BASE)
#define MEDIA_INTF_T_DVB_DEMUX (MEDIA_INTF_T_DVB_BASE + 1)
#define MEDIA_INTF_T_DVB_DVR (MEDIA_INTF_T_DVB_BASE + 2)
#define MEDIA_INTF_T_DVB_CA (MEDIA_INTF_T_DVB_BASE + 3)
#define MEDIA_INTF_T_DVB_NET (MEDIA_INTF_T_DVB_BASE + 4)
#define MEDIA_INTF_T_V4L_VIDEO (MEDIA_INTF_T_V4L_BASE)
#define MEDIA_INTF_T_V4L_VBI (MEDIA_INTF_T_V4L_BASE + 1)
#define MEDIA_INTF_T_V4L_RADIO (MEDIA_INTF_T_V4L_BASE + 2)
#define MEDIA_INTF_T_V4L_SUBDEV (MEDIA_INTF_T_V4L_BASE + 3)
#define MEDIA_INTF_T_V4L_SWRADIO (MEDIA_INTF_T_V4L_BASE + 4)
#define MEDIA_INTF_T_V4L_TOUCH (MEDIA_INTF_T_V4L_BASE + 5)
#define MEDIA_INTF_T_ALSA_BASE 0x00000300
#define MEDIA_INTF_T_ALSA_PCM_CAPTURE (MEDIA_INTF_T_ALSA_BASE)
#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK (MEDIA_INTF_T_ALSA_BASE + 1)
#define MEDIA_INTF_T_ALSA_CONTROL (MEDIA_INTF_T_ALSA_BASE + 2)
/*
* MC next gen API definitions
*/
/*
* Appeared in 4.19.0.
*
* The media_version argument comes from the media_version field in
* struct media_device_info.
*/
#define MEDIA_V2_ENTITY_HAS_FLAGS(media_version) \
((media_version) >= ((4U << 16) | (19U << 8) | 0U))
struct media_v2_entity {
__u32 id;
char name[64];
__u32 function; /* Main function of the entity */
__u32 flags;
__u32 reserved[5];
} __attribute__ ((packed));
/* Should match the specific fields at media_intf_devnode */
struct media_v2_intf_devnode {
__u32 major;
__u32 minor;
} __attribute__ ((packed));
struct media_v2_interface {
__u32 id;
__u32 intf_type;
__u32 flags;
__u32 reserved[9];
union {
struct media_v2_intf_devnode devnode;
__u32 raw[16];
};
} __attribute__ ((packed));
/*
* Appeared in 4.19.0.
*
* The media_version argument comes from the media_version field in
* struct media_device_info.
*/
#define MEDIA_V2_PAD_HAS_INDEX(media_version) \
((media_version) >= ((4U << 16) | (19U << 8) | 0U))
struct media_v2_pad {
__u32 id;
__u32 entity_id;
__u32 flags;
__u32 index;
__u32 reserved[4];
} __attribute__ ((packed));
struct media_v2_link {
__u32 id;
__u32 source_id;
__u32 sink_id;
__u32 flags;
__u32 reserved[6];
} __attribute__ ((packed));
struct media_v2_topology {
__u64 topology_version;
__u32 num_entities;
__u32 reserved1;
__u64 ptr_entities;
__u32 num_interfaces;
__u32 reserved2;
__u64 ptr_interfaces;
__u32 num_pads;
__u32 reserved3;
__u64 ptr_pads;
__u32 num_links;
__u32 reserved4;
__u64 ptr_links;
} __attribute__ ((packed));
/* ioctls */
#define MEDIA_IOC_DEVICE_INFO _IOWR('|', 0x00, struct media_device_info)
#define MEDIA_IOC_ENUM_ENTITIES _IOWR('|', 0x01, struct media_entity_desc)
#define MEDIA_IOC_ENUM_LINKS _IOWR('|', 0x02, struct media_links_enum)
#define MEDIA_IOC_SETUP_LINK _IOWR('|', 0x03, struct media_link_desc)
#define MEDIA_IOC_G_TOPOLOGY _IOWR('|', 0x04, struct media_v2_topology)
#define MEDIA_IOC_REQUEST_ALLOC _IOR ('|', 0x05, int)
/*
* These ioctls are called on the request file descriptor as returned
* by MEDIA_IOC_REQUEST_ALLOC.
*/
#define MEDIA_REQUEST_IOC_QUEUE _IO('|', 0x80)
#define MEDIA_REQUEST_IOC_REINIT _IO('|', 0x81)
/*
* Legacy symbols used to avoid userspace compilation breakages.
* Do not use any of this in new applications!
*
* Those symbols map the entity function into types and should be
* used only on legacy programs for legacy hardware. Don't rely
* on those for MEDIA_IOC_G_TOPOLOGY.
*/
#define MEDIA_ENT_TYPE_SHIFT 16
#define MEDIA_ENT_TYPE_MASK 0x00ff0000
#define MEDIA_ENT_SUBTYPE_MASK 0x0000ffff
#define MEDIA_ENT_T_DEVNODE_UNKNOWN (MEDIA_ENT_F_OLD_BASE | \
MEDIA_ENT_SUBTYPE_MASK)
#define MEDIA_ENT_T_DEVNODE MEDIA_ENT_F_OLD_BASE
#define MEDIA_ENT_T_DEVNODE_V4L MEDIA_ENT_F_IO_V4L
#define MEDIA_ENT_T_DEVNODE_FB (MEDIA_ENT_F_OLD_BASE + 2)
#define MEDIA_ENT_T_DEVNODE_ALSA (MEDIA_ENT_F_OLD_BASE + 3)
#define MEDIA_ENT_T_DEVNODE_DVB (MEDIA_ENT_F_OLD_BASE + 4)
#define MEDIA_ENT_T_UNKNOWN MEDIA_ENT_F_UNKNOWN
#define MEDIA_ENT_T_V4L2_VIDEO MEDIA_ENT_F_IO_V4L
#define MEDIA_ENT_T_V4L2_SUBDEV MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN
#define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR MEDIA_ENT_F_CAM_SENSOR
#define MEDIA_ENT_T_V4L2_SUBDEV_FLASH MEDIA_ENT_F_FLASH
#define MEDIA_ENT_T_V4L2_SUBDEV_LENS MEDIA_ENT_F_LENS
#define MEDIA_ENT_T_V4L2_SUBDEV_DECODER MEDIA_ENT_F_ATV_DECODER
#define MEDIA_ENT_T_V4L2_SUBDEV_TUNER MEDIA_ENT_F_TUNER
#define MEDIA_ENT_F_DTV_DECODER MEDIA_ENT_F_DV_DECODER
/*
* There is still no full ALSA support in the media controller. These
* defines should not have been added and we leave them here only
* in case some application tries to use these defines.
*
* The ALSA defines that are in use have been moved into __KERNEL__
* scope. As support gets added to these interface types, they should
* be moved into __KERNEL__ scope with the code that uses them.
*/
#define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3)
#define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4)
#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)
#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)
#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)
/* Obsolete symbol for media_version, no longer used in the kernel */
#define MEDIA_API_VERSION ((0U << 16) | (1U << 8) | 0U)
#endif /* __LINUX_MEDIA_H */

View File

@@ -0,0 +1,999 @@
/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR MIT) */
/*
* Rockchip ISP1 userspace API
* Copyright (C) 2017 Rockchip Electronics Co., Ltd.
*/
#ifndef _RKISP1_CONFIG_H
#define _RKISP1_CONFIG_H
#include <linux/types.h>
/* Defect Pixel Cluster Detection */
#define RKISP1_CIF_ISP_MODULE_DPCC (1U << 0)
/* Black Level Subtraction */
#define RKISP1_CIF_ISP_MODULE_BLS (1U << 1)
/* Sensor De-gamma */
#define RKISP1_CIF_ISP_MODULE_SDG (1U << 2)
/* Histogram statistics configuration */
#define RKISP1_CIF_ISP_MODULE_HST (1U << 3)
/* Lens Shade Control */
#define RKISP1_CIF_ISP_MODULE_LSC (1U << 4)
/* Auto White Balance Gain */
#define RKISP1_CIF_ISP_MODULE_AWB_GAIN (1U << 5)
/* Filter */
#define RKISP1_CIF_ISP_MODULE_FLT (1U << 6)
/* Bayer Demosaic */
#define RKISP1_CIF_ISP_MODULE_BDM (1U << 7)
/* Cross Talk */
#define RKISP1_CIF_ISP_MODULE_CTK (1U << 8)
/* Gamma Out Curve */
#define RKISP1_CIF_ISP_MODULE_GOC (1U << 9)
/* Color Processing */
#define RKISP1_CIF_ISP_MODULE_CPROC (1U << 10)
/* Auto Focus Control statistics configuration */
#define RKISP1_CIF_ISP_MODULE_AFC (1U << 11)
/* Auto White Balancing statistics configuration */
#define RKISP1_CIF_ISP_MODULE_AWB (1U << 12)
/* Image Effect */
#define RKISP1_CIF_ISP_MODULE_IE (1U << 13)
/* Auto Exposure Control statistics configuration */
#define RKISP1_CIF_ISP_MODULE_AEC (1U << 14)
/* Wide Dynamic Range */
#define RKISP1_CIF_ISP_MODULE_WDR (1U << 15)
/* Denoise Pre-Filter */
#define RKISP1_CIF_ISP_MODULE_DPF (1U << 16)
/* Denoise Pre-Filter Strength */
#define RKISP1_CIF_ISP_MODULE_DPF_STRENGTH (1U << 17)
#define RKISP1_CIF_ISP_CTK_COEFF_MAX 0x100
#define RKISP1_CIF_ISP_CTK_OFFSET_MAX 0x800
#define RKISP1_CIF_ISP_AE_MEAN_MAX_V10 25
#define RKISP1_CIF_ISP_AE_MEAN_MAX_V12 81
#define RKISP1_CIF_ISP_AE_MEAN_MAX RKISP1_CIF_ISP_AE_MEAN_MAX_V12
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 16
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 32
#define RKISP1_CIF_ISP_HIST_BIN_N_MAX RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12
#define RKISP1_CIF_ISP_AFM_MAX_WINDOWS 3
#define RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE 17
#define RKISP1_CIF_ISP_BDM_MAX_TH 0xff
/*
* Black level compensation
*/
/* maximum value for horizontal start address */
#define RKISP1_CIF_ISP_BLS_START_H_MAX 0x00000fff
/* maximum value for horizontal stop address */
#define RKISP1_CIF_ISP_BLS_STOP_H_MAX 0x00000fff
/* maximum value for vertical start address */
#define RKISP1_CIF_ISP_BLS_START_V_MAX 0x00000fff
/* maximum value for vertical stop address */
#define RKISP1_CIF_ISP_BLS_STOP_V_MAX 0x00000fff
/* maximum is 2^18 = 262144*/
#define RKISP1_CIF_ISP_BLS_SAMPLES_MAX 0x00000012
/* maximum value for fixed black level */
#define RKISP1_CIF_ISP_BLS_FIX_SUB_MAX 0x00000fff
/* minimum value for fixed black level */
#define RKISP1_CIF_ISP_BLS_FIX_SUB_MIN 0xfffff000
/* 13 bit range (signed)*/
#define RKISP1_CIF_ISP_BLS_FIX_MASK 0x00001fff
/*
* Automatic white balance measurements
*/
#define RKISP1_CIF_ISP_AWB_MAX_GRID 1
#define RKISP1_CIF_ISP_AWB_MAX_FRAMES 7
/*
* Gamma out
*/
/* Maximum number of color samples supported */
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 17
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 34
#define RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12
/*
* Lens shade correction
*/
#define RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE 8
/*
* The following matches the tuning process,
* not the max capabilities of the chip.
*/
#define RKISP1_CIF_ISP_LSC_SAMPLES_MAX 17
/*
* Histogram calculation
*/
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 25
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 81
#define RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12
/*
* Defect Pixel Cluster Correction
*/
#define RKISP1_CIF_ISP_DPCC_METHODS_MAX 3
#define RKISP1_CIF_ISP_DPCC_MODE_STAGE1_ENABLE (1U << 2)
#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_G_CENTER (1U << 0)
#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_INCL_RB_CENTER (1U << 1)
#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_G_3X3 (1U << 2)
#define RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_STAGE1_RB_3X3 (1U << 3)
/* 0-2 for sets 1-3 */
#define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_SET(n) ((n) << 0)
#define RKISP1_CIF_ISP_DPCC_SET_USE_STAGE1_USE_FIX_SET (1U << 3)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_GREEN_ENABLE (1U << 0)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_GREEN_ENABLE (1U << 1)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_GREEN_ENABLE (1U << 2)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_GREEN_ENABLE (1U << 3)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_GREEN_ENABLE (1U << 4)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_PG_RED_BLUE_ENABLE (1U << 8)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_LC_RED_BLUE_ENABLE (1U << 9)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RO_RED_BLUE_ENABLE (1U << 10)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RND_RED_BLUE_ENABLE (1U << 11)
#define RKISP1_CIF_ISP_DPCC_METHODS_SET_RG_RED_BLUE_ENABLE (1U << 12)
#define RKISP1_CIF_ISP_DPCC_LINE_THRESH_G(v) ((v) << 0)
#define RKISP1_CIF_ISP_DPCC_LINE_THRESH_RB(v) ((v) << 8)
#define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_G(v) ((v) << 0)
#define RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_RB(v) ((v) << 8)
#define RKISP1_CIF_ISP_DPCC_PG_FAC_G(v) ((v) << 0)
#define RKISP1_CIF_ISP_DPCC_PG_FAC_RB(v) ((v) << 8)
#define RKISP1_CIF_ISP_DPCC_RND_THRESH_G(v) ((v) << 0)
#define RKISP1_CIF_ISP_DPCC_RND_THRESH_RB(v) ((v) << 8)
#define RKISP1_CIF_ISP_DPCC_RG_FAC_G(v) ((v) << 0)
#define RKISP1_CIF_ISP_DPCC_RG_FAC_RB(v) ((v) << 8)
#define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_G(n, v) ((v) << ((n) * 4))
#define RKISP1_CIF_ISP_DPCC_RO_LIMITS_n_RB(n, v) ((v) << ((n) * 4 + 2))
#define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_G(n, v) ((v) << ((n) * 4))
#define RKISP1_CIF_ISP_DPCC_RND_OFFS_n_RB(n, v) ((v) << ((n) * 4 + 2))
/*
* Denoising pre filter
*/
#define RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS 17
#define RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS 6
/*
* Measurement types
*/
#define RKISP1_CIF_ISP_STAT_AWB (1U << 0)
#define RKISP1_CIF_ISP_STAT_AUTOEXP (1U << 1)
#define RKISP1_CIF_ISP_STAT_AFM (1U << 2)
#define RKISP1_CIF_ISP_STAT_HIST (1U << 3)
/**
* enum rkisp1_cif_isp_version - ISP variants
*
* @RKISP1_V10: Used at least in RK3288 and RK3399.
* @RKISP1_V11: Declared in the original vendor code, but not used. Same number
* of entries in grids and histogram as v10.
* @RKISP1_V12: Used at least in RK3326 and PX30.
* @RKISP1_V13: Used at least in RK1808. Same number of entries in grids and
* histogram as v12.
* @RKISP1_V_IMX8MP: Used in at least i.MX8MP. Same number of entries in grids
* and histogram as v10.
*/
enum rkisp1_cif_isp_version {
RKISP1_V10 = 10,
RKISP1_V11,
RKISP1_V12,
RKISP1_V13,
RKISP1_V_IMX8MP,
};
enum rkisp1_cif_isp_histogram_mode {
RKISP1_CIF_ISP_HISTOGRAM_MODE_DISABLE,
RKISP1_CIF_ISP_HISTOGRAM_MODE_RGB_COMBINED,
RKISP1_CIF_ISP_HISTOGRAM_MODE_R_HISTOGRAM,
RKISP1_CIF_ISP_HISTOGRAM_MODE_G_HISTOGRAM,
RKISP1_CIF_ISP_HISTOGRAM_MODE_B_HISTOGRAM,
RKISP1_CIF_ISP_HISTOGRAM_MODE_Y_HISTOGRAM
};
enum rkisp1_cif_isp_awb_mode_type {
RKISP1_CIF_ISP_AWB_MODE_MANUAL,
RKISP1_CIF_ISP_AWB_MODE_RGB,
RKISP1_CIF_ISP_AWB_MODE_YCBCR
};
enum rkisp1_cif_isp_flt_mode {
RKISP1_CIF_ISP_FLT_STATIC_MODE,
RKISP1_CIF_ISP_FLT_DYNAMIC_MODE
};
/**
* enum rkisp1_cif_isp_exp_ctrl_autostop - stop modes
* @RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0: continuous measurement
* @RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1: stop measuring after a complete frame
*/
enum rkisp1_cif_isp_exp_ctrl_autostop {
RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_0 = 0,
RKISP1_CIF_ISP_EXP_CTRL_AUTOSTOP_1 = 1,
};
/**
* enum rkisp1_cif_isp_exp_meas_mode - Exposure measure mode
* @RKISP1_CIF_ISP_EXP_MEASURING_MODE_0: Y = 16 + 0.25R + 0.5G + 0.1094B
* @RKISP1_CIF_ISP_EXP_MEASURING_MODE_1: Y = (R + G + B) x (85/256)
*/
enum rkisp1_cif_isp_exp_meas_mode {
RKISP1_CIF_ISP_EXP_MEASURING_MODE_0,
RKISP1_CIF_ISP_EXP_MEASURING_MODE_1,
};
/*---------- PART1: Input Parameters ------------*/
/**
* struct rkisp1_cif_isp_window - measurement window.
*
* Measurements are calculated per window inside the frame.
* This struct represents a window for a measurement.
*
* @h_offs: the horizontal offset of the window from the left of the frame in pixels.
* @v_offs: the vertical offset of the window from the top of the frame in pixels.
* @h_size: the horizontal size of the window in pixels
* @v_size: the vertical size of the window in pixels.
*/
struct rkisp1_cif_isp_window {
__u16 h_offs;
__u16 v_offs;
__u16 h_size;
__u16 v_size;
};
/**
* struct rkisp1_cif_isp_bls_fixed_val - BLS fixed subtraction values
*
* The values will be subtracted from the sensor
* values. Therefore a negative value means addition instead of subtraction!
*
* @r: Fixed (signed!) subtraction value for Bayer pattern R
* @gr: Fixed (signed!) subtraction value for Bayer pattern Gr
* @gb: Fixed (signed!) subtraction value for Bayer pattern Gb
* @b: Fixed (signed!) subtraction value for Bayer pattern B
*/
struct rkisp1_cif_isp_bls_fixed_val {
__s16 r;
__s16 gr;
__s16 gb;
__s16 b;
};
/**
* struct rkisp1_cif_isp_bls_config - Configuration used by black level subtraction
*
* @enable_auto: Automatic mode activated means that the measured values
* are subtracted. Otherwise the fixed subtraction
* values will be subtracted.
* @en_windows: enabled window
* @bls_window1: Measurement window 1 size
* @bls_window2: Measurement window 2 size
* @bls_samples: Set amount of measured pixels for each Bayer position
* (A, B,C and D) to 2^bls_samples.
* @fixed_val: Fixed subtraction values
*/
struct rkisp1_cif_isp_bls_config {
__u8 enable_auto;
__u8 en_windows;
struct rkisp1_cif_isp_window bls_window1;
struct rkisp1_cif_isp_window bls_window2;
__u8 bls_samples;
struct rkisp1_cif_isp_bls_fixed_val fixed_val;
};
/**
* struct rkisp1_cif_isp_dpcc_methods_config - DPCC methods set configuration
*
* This structure stores the configuration of one set of methods for the DPCC
* algorithm. Multiple methods can be selected in each set (independently for
* the Green and Red/Blue components) through the @method field, the result is
* the logical AND of all enabled methods. The remaining fields set thresholds
* and factors for each method.
*
* @method: Method enable bits (RKISP1_CIF_ISP_DPCC_METHODS_SET_*)
* @line_thresh: Line threshold (RKISP1_CIF_ISP_DPCC_LINE_THRESH_*)
* @line_mad_fac: Line Mean Absolute Difference factor (RKISP1_CIF_ISP_DPCC_LINE_MAD_FAC_*)
* @pg_fac: Peak gradient factor (RKISP1_CIF_ISP_DPCC_PG_FAC_*)
* @rnd_thresh: Rank Neighbor Difference threshold (RKISP1_CIF_ISP_DPCC_RND_THRESH_*)
* @rg_fac: Rank gradient factor (RKISP1_CIF_ISP_DPCC_RG_FAC_*)
*/
struct rkisp1_cif_isp_dpcc_methods_config {
__u32 method;
__u32 line_thresh;
__u32 line_mad_fac;
__u32 pg_fac;
__u32 rnd_thresh;
__u32 rg_fac;
};
/**
* struct rkisp1_cif_isp_dpcc_config - Configuration used by DPCC
*
* Configuration used by Defect Pixel Cluster Correction. Three sets of methods
* can be configured and selected through the @set_use field. The result is the
* logical OR of all enabled sets.
*
* @mode: DPCC mode (RKISP1_CIF_ISP_DPCC_MODE_*)
* @output_mode: Interpolation output mode (RKISP1_CIF_ISP_DPCC_OUTPUT_MODE_*)
* @set_use: Methods sets selection (RKISP1_CIF_ISP_DPCC_SET_USE_*)
* @methods: Methods sets configuration
* @ro_limits: Rank order limits (RKISP1_CIF_ISP_DPCC_RO_LIMITS_*)
* @rnd_offs: Differential rank offsets for rank neighbor difference (RKISP1_CIF_ISP_DPCC_RND_OFFS_*)
*/
struct rkisp1_cif_isp_dpcc_config {
__u32 mode;
__u32 output_mode;
__u32 set_use;
struct rkisp1_cif_isp_dpcc_methods_config methods[RKISP1_CIF_ISP_DPCC_METHODS_MAX];
__u32 ro_limits;
__u32 rnd_offs;
};
/**
* struct rkisp1_cif_isp_gamma_corr_curve - gamma curve point definition y-axis (output).
*
* The reset values define a linear curve which has the same effect as bypass. Reset values are:
* gamma_y[0] = 0x0000, gamma_y[1] = 0x0100, ... gamma_y[15] = 0x0f00, gamma_y[16] = 0xfff
*
* @gamma_y: the values for the y-axis of gamma curve points. Each value is 12 bit.
*/
struct rkisp1_cif_isp_gamma_corr_curve {
__u16 gamma_y[RKISP1_CIF_ISP_DEGAMMA_CURVE_SIZE];
};
/**
* struct rkisp1_cif_isp_gamma_curve_x_axis_pnts - De-Gamma Curve definition x increments
* (sampling points). gamma_dx0 is for the lower samples (1-8), gamma_dx1 is for the
* higher samples (9-16). The reset values for both fields is 0x44444444. This means
* that each sample is 4 units away from the previous one on the x-axis.
*
* @gamma_dx0: gamma curve sample points definitions. Bits 0:2 for sample 1. Bit 3 unused.
* Bits 4:6 for sample 2. bit 7 unused ... Bits 28:30 for sample 8. Bit 31 unused
* @gamma_dx1: gamma curve sample points definitions. Bits 0:2 for sample 9. Bit 3 unused.
* Bits 4:6 for sample 10. bit 7 unused ... Bits 28:30 for sample 16. Bit 31 unused
*/
struct rkisp1_cif_isp_gamma_curve_x_axis_pnts {
__u32 gamma_dx0;
__u32 gamma_dx1;
};
/**
* struct rkisp1_cif_isp_sdg_config - Configuration used by sensor degamma
*
* @curve_r: gamma curve point definition axis for red
* @curve_g: gamma curve point definition axis for green
* @curve_b: gamma curve point definition axis for blue
* @xa_pnts: x axis increments
*/
struct rkisp1_cif_isp_sdg_config {
struct rkisp1_cif_isp_gamma_corr_curve curve_r;
struct rkisp1_cif_isp_gamma_corr_curve curve_g;
struct rkisp1_cif_isp_gamma_corr_curve curve_b;
struct rkisp1_cif_isp_gamma_curve_x_axis_pnts xa_pnts;
};
/**
* struct rkisp1_cif_isp_lsc_config - Configuration used by Lens shading correction
*
* @r_data_tbl: sample table red
* @gr_data_tbl: sample table green (red)
* @gb_data_tbl: sample table green (blue)
* @b_data_tbl: sample table blue
* @x_grad_tbl: gradient table x
* @y_grad_tbl: gradient table y
* @x_size_tbl: size table x
* @y_size_tbl: size table y
* @config_width: not used at the moment
* @config_height: not used at the moment
*/
struct rkisp1_cif_isp_lsc_config {
__u16 r_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
__u16 gr_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
__u16 gb_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
__u16 b_data_tbl[RKISP1_CIF_ISP_LSC_SAMPLES_MAX][RKISP1_CIF_ISP_LSC_SAMPLES_MAX];
__u16 x_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
__u16 y_grad_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
__u16 x_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
__u16 y_size_tbl[RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE];
__u16 config_width;
__u16 config_height;
};
/**
* struct rkisp1_cif_isp_ie_config - Configuration used by image effects
*
* @effect: values from 'enum v4l2_colorfx'. Possible values are: V4L2_COLORFX_SEPIA,
* V4L2_COLORFX_SET_CBCR, V4L2_COLORFX_AQUA, V4L2_COLORFX_EMBOSS,
* V4L2_COLORFX_SKETCH, V4L2_COLORFX_BW, V4L2_COLORFX_NEGATIVE
* @color_sel: bits 0:2 - colors bitmask (001 - blue, 010 - green, 100 - red).
* bits 8:15 - Threshold value of the RGB colors for the color selection effect.
* @eff_mat_1: 3x3 Matrix Coefficients for Emboss Effect 1
* @eff_mat_2: 3x3 Matrix Coefficients for Emboss Effect 2
* @eff_mat_3: 3x3 Matrix Coefficients for Emboss 3/Sketch 1
* @eff_mat_4: 3x3 Matrix Coefficients for Sketch Effect 2
* @eff_mat_5: 3x3 Matrix Coefficients for Sketch Effect 3
* @eff_tint: Chrominance increment values of tint (used for sepia effect)
*/
struct rkisp1_cif_isp_ie_config {
__u16 effect;
__u16 color_sel;
__u16 eff_mat_1;
__u16 eff_mat_2;
__u16 eff_mat_3;
__u16 eff_mat_4;
__u16 eff_mat_5;
__u16 eff_tint;
};
/**
* struct rkisp1_cif_isp_cproc_config - Configuration used by Color Processing
*
* @c_out_range: Chrominance pixel clipping range at output.
* (0 for limit, 1 for full)
* @y_in_range: Luminance pixel clipping range at output.
* @y_out_range: Luminance pixel clipping range at output.
* @contrast: 00~ff, 0.0~1.992
* @brightness: 80~7F, -128~+127
* @sat: saturation, 00~FF, 0.0~1.992
* @hue: 80~7F, -90~+87.188
*/
struct rkisp1_cif_isp_cproc_config {
__u8 c_out_range;
__u8 y_in_range;
__u8 y_out_range;
__u8 contrast;
__u8 brightness;
__u8 sat;
__u8 hue;
};
/**
* struct rkisp1_cif_isp_awb_meas_config - Configuration for the AWB statistics
*
* @awb_mode: the awb meas mode. From enum rkisp1_cif_isp_awb_mode_type.
* @awb_wnd: white balance measurement window (in pixels)
* @max_y: only pixels values < max_y contribute to awb measurement, set to 0
* to disable this feature
* @min_y: only pixels values > min_y contribute to awb measurement
* @max_csum: Chrominance sum maximum value, only consider pixels with Cb+Cr,
* smaller than threshold for awb measurements
* @min_c: Chrominance minimum value, only consider pixels with Cb/Cr
* each greater than threshold value for awb measurements
* @frames: number of frames - 1 used for mean value calculation
* (ucFrames=0 means 1 Frame)
* @awb_ref_cr: reference Cr value for AWB regulation, target for AWB
* @awb_ref_cb: reference Cb value for AWB regulation, target for AWB
* @enable_ymax_cmp: enable Y_MAX compare (Not valid in RGB measurement mode.)
*/
struct rkisp1_cif_isp_awb_meas_config {
/*
* Note: currently the h and v offsets are mapped to grid offsets
*/
struct rkisp1_cif_isp_window awb_wnd;
__u32 awb_mode;
__u8 max_y;
__u8 min_y;
__u8 max_csum;
__u8 min_c;
__u8 frames;
__u8 awb_ref_cr;
__u8 awb_ref_cb;
__u8 enable_ymax_cmp;
};
/**
* struct rkisp1_cif_isp_awb_gain_config - Configuration used by auto white balance gain
*
* All fields in this struct are 10 bit, where:
* 0x100h = 1, unsigned integer value, range 0 to 4 with 8 bit fractional part.
*
* out_data_x = ( AWB_GAIN_X * in_data + 128) >> 8
*
* @gain_red: gain value for red component.
* @gain_green_r: gain value for green component in red line.
* @gain_blue: gain value for blue component.
* @gain_green_b: gain value for green component in blue line.
*/
struct rkisp1_cif_isp_awb_gain_config {
__u16 gain_red;
__u16 gain_green_r;
__u16 gain_blue;
__u16 gain_green_b;
};
/**
* struct rkisp1_cif_isp_flt_config - Configuration used by ISP filtering
*
* All 4 threshold fields (thresh_*) are 10 bits.
* All 6 factor fields (fac_*) are 6 bits.
*
* @mode: ISP_FILT_MODE register fields (from enum rkisp1_cif_isp_flt_mode)
* @grn_stage1: Green filter stage 1 select (range 0x0...0x8)
* @chr_h_mode: Chroma filter horizontal mode
* @chr_v_mode: Chroma filter vertical mode
* @thresh_bl0: If thresh_bl1 < sum_grad < thresh_bl0 then fac_bl0 is selected (blurring th)
* @thresh_bl1: If sum_grad < thresh_bl1 then fac_bl1 is selected (blurring th)
* @thresh_sh0: If thresh_sh0 < sum_grad < thresh_sh1 then thresh_sh0 is selected (sharpening th)
* @thresh_sh1: If thresh_sh1 < sum_grad then thresh_sh1 is selected (sharpening th)
* @lum_weight: Parameters for luminance weight function.
* @fac_sh1: filter factor for sharp1 level
* @fac_sh0: filter factor for sharp0 level
* @fac_mid: filter factor for mid level and for static filter mode
* @fac_bl0: filter factor for blur 0 level
* @fac_bl1: filter factor for blur 1 level (max blur)
*/
struct rkisp1_cif_isp_flt_config {
__u32 mode;
__u8 grn_stage1;
__u8 chr_h_mode;
__u8 chr_v_mode;
__u32 thresh_bl0;
__u32 thresh_bl1;
__u32 thresh_sh0;
__u32 thresh_sh1;
__u32 lum_weight;
__u32 fac_sh1;
__u32 fac_sh0;
__u32 fac_mid;
__u32 fac_bl0;
__u32 fac_bl1;
};
/**
* struct rkisp1_cif_isp_bdm_config - Configuration used by Bayer DeMosaic
*
* @demosaic_th: threshold for bayer demosaicing texture detection
*/
struct rkisp1_cif_isp_bdm_config {
__u8 demosaic_th;
};
/**
* struct rkisp1_cif_isp_ctk_config - Configuration used by Cross Talk correction
*
* @coeff: color correction matrix. Values are 11-bit signed fixed-point numbers with 4 bit integer
* and 7 bit fractional part, ranging from -8 (0x400) to +7.992 (0x3FF). 0 is
* represented by 0x000 and a coefficient value of 1 as 0x080.
* @ct_offset: Red, Green, Blue offsets for the crosstalk correction matrix
*/
struct rkisp1_cif_isp_ctk_config {
__u16 coeff[3][3];
__u16 ct_offset[3];
};
enum rkisp1_cif_isp_goc_mode {
RKISP1_CIF_ISP_GOC_MODE_LOGARITHMIC,
RKISP1_CIF_ISP_GOC_MODE_EQUIDISTANT
};
/**
* struct rkisp1_cif_isp_goc_config - Configuration used by Gamma Out correction
*
* @mode: goc mode (from enum rkisp1_cif_isp_goc_mode)
* @gamma_y: gamma out curve y-axis for all color components
*
* The number of entries of @gamma_y depends on the hardware revision
* as is reported by the hw_revision field of the struct media_device_info
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
*
* V10 has RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10 entries, V12 has
* RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12 entries.
* RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES is equal to the maximum of the two.
*/
struct rkisp1_cif_isp_goc_config {
__u32 mode;
__u16 gamma_y[RKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES];
};
/**
* struct rkisp1_cif_isp_hst_config - Configuration for Histogram statistics
*
* @mode: histogram mode (from enum rkisp1_cif_isp_histogram_mode)
* @histogram_predivider: process every stepsize pixel, all other pixels are
* skipped
* @meas_window: coordinates of the measure window
* @hist_weight: weighting factor for sub-windows
*
* The number of entries of @hist_weight depends on the hardware revision
* as is reported by the hw_revision field of the struct media_device_info
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
*
* V10 has RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10 entries, V12 has
* RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12 entries.
* RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE is equal to the maximum of the
* two.
*/
struct rkisp1_cif_isp_hst_config {
__u32 mode;
__u8 histogram_predivider;
struct rkisp1_cif_isp_window meas_window;
__u8 hist_weight[RKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE];
};
/**
* struct rkisp1_cif_isp_aec_config - Configuration for Auto Exposure statistics
*
* @mode: Exposure measure mode (from enum rkisp1_cif_isp_exp_meas_mode)
* @autostop: stop mode (from enum rkisp1_cif_isp_exp_ctrl_autostop)
* @meas_window: coordinates of the measure window
*/
struct rkisp1_cif_isp_aec_config {
__u32 mode;
__u32 autostop;
struct rkisp1_cif_isp_window meas_window;
};
/**
* struct rkisp1_cif_isp_afc_config - Configuration for the Auto Focus statistics
*
* @num_afm_win: max RKISP1_CIF_ISP_AFM_MAX_WINDOWS
* @afm_win: coordinates of the meas window
* @thres: threshold used for minimizing the influence of noise
* @var_shift: the number of bits for the shift operation at the end of the
* calculation chain.
*/
struct rkisp1_cif_isp_afc_config {
__u8 num_afm_win;
struct rkisp1_cif_isp_window afm_win[RKISP1_CIF_ISP_AFM_MAX_WINDOWS];
__u32 thres;
__u32 var_shift;
};
/**
* enum rkisp1_cif_isp_dpf_gain_usage - dpf gain usage
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED: don't use any gains in preprocessing stage
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS: use only the noise function gains from
* registers DPF_NF_GAIN_R, ...
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS: use only the gains from LSC module
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS: use the noise function gains and the
* gains from LSC module
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS: use only the gains from AWB module
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS: use the gains from AWB and LSC module
* @RKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX: upper border (only for an internal evaluation)
*/
enum rkisp1_cif_isp_dpf_gain_usage {
RKISP1_CIF_ISP_DPF_GAIN_USAGE_DISABLED,
RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_GAINS,
RKISP1_CIF_ISP_DPF_GAIN_USAGE_LSC_GAINS,
RKISP1_CIF_ISP_DPF_GAIN_USAGE_NF_LSC_GAINS,
RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_GAINS,
RKISP1_CIF_ISP_DPF_GAIN_USAGE_AWB_LSC_GAINS,
RKISP1_CIF_ISP_DPF_GAIN_USAGE_MAX
};
/**
* enum rkisp1_cif_isp_dpf_rb_filtersize - Red and blue filter sizes
* @RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9: red and blue filter kernel size 13x9
* (means 7x5 active pixel)
* @RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9: red and blue filter kernel size 9x9
* (means 5x5 active pixel)
*/
enum rkisp1_cif_isp_dpf_rb_filtersize {
RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_13x9,
RKISP1_CIF_ISP_DPF_RB_FILTERSIZE_9x9,
};
/**
* enum rkisp1_cif_isp_dpf_nll_scale_mode - dpf noise level scale mode
* @RKISP1_CIF_ISP_NLL_SCALE_LINEAR: use a linear scaling
* @RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC: use a logarithmic scaling
*/
enum rkisp1_cif_isp_dpf_nll_scale_mode {
RKISP1_CIF_ISP_NLL_SCALE_LINEAR,
RKISP1_CIF_ISP_NLL_SCALE_LOGARITHMIC,
};
/**
* struct rkisp1_cif_isp_dpf_nll - Noise level lookup
*
* @coeff: Noise level Lookup coefficient
* @scale_mode: dpf noise level scale mode (from enum rkisp1_cif_isp_dpf_nll_scale_mode)
*/
struct rkisp1_cif_isp_dpf_nll {
__u16 coeff[RKISP1_CIF_ISP_DPF_MAX_NLF_COEFFS];
__u32 scale_mode;
};
/**
* struct rkisp1_cif_isp_dpf_rb_flt - Red blue filter config
*
* @fltsize: The filter size for the red and blue pixels
* (from enum rkisp1_cif_isp_dpf_rb_filtersize)
* @spatial_coeff: Spatial weights
* @r_enable: enable filter processing for red pixels
* @b_enable: enable filter processing for blue pixels
*/
struct rkisp1_cif_isp_dpf_rb_flt {
__u32 fltsize;
__u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS];
__u8 r_enable;
__u8 b_enable;
};
/**
* struct rkisp1_cif_isp_dpf_g_flt - Green filter Configuration
*
* @spatial_coeff: Spatial weights
* @gr_enable: enable filter processing for green pixels in green/red lines
* @gb_enable: enable filter processing for green pixels in green/blue lines
*/
struct rkisp1_cif_isp_dpf_g_flt {
__u8 spatial_coeff[RKISP1_CIF_ISP_DPF_MAX_SPATIAL_COEFFS];
__u8 gr_enable;
__u8 gb_enable;
};
/**
* struct rkisp1_cif_isp_dpf_gain - Noise function Configuration
*
* @mode: dpf gain usage (from enum rkisp1_cif_isp_dpf_gain_usage)
* @nf_r_gain: Noise function Gain that replaces the AWB gain for red pixels
* @nf_b_gain: Noise function Gain that replaces the AWB gain for blue pixels
* @nf_gr_gain: Noise function Gain that replaces the AWB gain
* for green pixels in a red line
* @nf_gb_gain: Noise function Gain that replaces the AWB gain
* for green pixels in a blue line
*/
struct rkisp1_cif_isp_dpf_gain {
__u32 mode;
__u16 nf_r_gain;
__u16 nf_b_gain;
__u16 nf_gr_gain;
__u16 nf_gb_gain;
};
/**
* struct rkisp1_cif_isp_dpf_config - Configuration used by De-noising pre-filter
*
* @gain: noise function gain
* @g_flt: green filter config
* @rb_flt: red blue filter config
* @nll: noise level lookup
*/
struct rkisp1_cif_isp_dpf_config {
struct rkisp1_cif_isp_dpf_gain gain;
struct rkisp1_cif_isp_dpf_g_flt g_flt;
struct rkisp1_cif_isp_dpf_rb_flt rb_flt;
struct rkisp1_cif_isp_dpf_nll nll;
};
/**
* struct rkisp1_cif_isp_dpf_strength_config - strength of the filter
*
* @r: filter strength of the RED filter
* @g: filter strength of the GREEN filter
* @b: filter strength of the BLUE filter
*/
struct rkisp1_cif_isp_dpf_strength_config {
__u8 r;
__u8 g;
__u8 b;
};
/**
* struct rkisp1_cif_isp_isp_other_cfg - Parameters for some blocks in rockchip isp1
*
* @dpcc_config: Defect Pixel Cluster Correction config
* @bls_config: Black Level Subtraction config
* @sdg_config: sensor degamma config
* @lsc_config: Lens Shade config
* @awb_gain_config: Auto White balance gain config
* @flt_config: filter config
* @bdm_config: demosaic config
* @ctk_config: cross talk config
* @goc_config: gamma out config
* @bls_config: black level subtraction config
* @dpf_config: De-noising pre-filter config
* @dpf_strength_config: dpf strength config
* @cproc_config: color process config
* @ie_config: image effects config
*/
struct rkisp1_cif_isp_isp_other_cfg {
struct rkisp1_cif_isp_dpcc_config dpcc_config;
struct rkisp1_cif_isp_bls_config bls_config;
struct rkisp1_cif_isp_sdg_config sdg_config;
struct rkisp1_cif_isp_lsc_config lsc_config;
struct rkisp1_cif_isp_awb_gain_config awb_gain_config;
struct rkisp1_cif_isp_flt_config flt_config;
struct rkisp1_cif_isp_bdm_config bdm_config;
struct rkisp1_cif_isp_ctk_config ctk_config;
struct rkisp1_cif_isp_goc_config goc_config;
struct rkisp1_cif_isp_dpf_config dpf_config;
struct rkisp1_cif_isp_dpf_strength_config dpf_strength_config;
struct rkisp1_cif_isp_cproc_config cproc_config;
struct rkisp1_cif_isp_ie_config ie_config;
};
/**
* struct rkisp1_cif_isp_isp_meas_cfg - Rockchip ISP1 Measure Parameters
*
* @awb_meas_config: auto white balance config
* @hst_config: histogram config
* @aec_config: auto exposure config
* @afc_config: auto focus config
*/
struct rkisp1_cif_isp_isp_meas_cfg {
struct rkisp1_cif_isp_awb_meas_config awb_meas_config;
struct rkisp1_cif_isp_hst_config hst_config;
struct rkisp1_cif_isp_aec_config aec_config;
struct rkisp1_cif_isp_afc_config afc_config;
};
/**
* struct rkisp1_params_cfg - Rockchip ISP1 Input Parameters Meta Data
*
* @module_en_update: mask the enable bits of which module should be updated
* @module_ens: mask the enable value of each module, only update the module
* which correspond bit was set in module_en_update
* @module_cfg_update: mask the config bits of which module should be updated
* @meas: measurement config
* @others: other config
*/
struct rkisp1_params_cfg {
__u32 module_en_update;
__u32 module_ens;
__u32 module_cfg_update;
struct rkisp1_cif_isp_isp_meas_cfg meas;
struct rkisp1_cif_isp_isp_other_cfg others;
};
/*---------- PART2: Measurement Statistics ------------*/
/**
* struct rkisp1_cif_isp_awb_meas - AWB measured values
*
* @cnt: White pixel count, number of "white pixels" found during last
* measurement
* @mean_y_or_g: Mean value of Y within window and frames,
* Green if RGB is selected.
* @mean_cb_or_b: Mean value of Cb within window and frames,
* Blue if RGB is selected.
* @mean_cr_or_r: Mean value of Cr within window and frames,
* Red if RGB is selected.
*/
struct rkisp1_cif_isp_awb_meas {
__u32 cnt;
__u8 mean_y_or_g;
__u8 mean_cb_or_b;
__u8 mean_cr_or_r;
};
/**
* struct rkisp1_cif_isp_awb_stat - statistics automatic white balance data
*
* @awb_mean: Mean measured data
*/
struct rkisp1_cif_isp_awb_stat {
struct rkisp1_cif_isp_awb_meas awb_mean[RKISP1_CIF_ISP_AWB_MAX_GRID];
};
/**
* struct rkisp1_cif_isp_bls_meas_val - BLS measured values
*
* @meas_r: Mean measured value for Bayer pattern R
* @meas_gr: Mean measured value for Bayer pattern Gr
* @meas_gb: Mean measured value for Bayer pattern Gb
* @meas_b: Mean measured value for Bayer pattern B
*/
struct rkisp1_cif_isp_bls_meas_val {
__u16 meas_r;
__u16 meas_gr;
__u16 meas_gb;
__u16 meas_b;
};
/**
* struct rkisp1_cif_isp_ae_stat - statistics auto exposure data
*
* @exp_mean: Mean luminance value of block xx
* @bls_val: BLS measured values
*
* The number of entries of @exp_mean depends on the hardware revision
* as is reported by the hw_revision field of the struct media_device_info
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
*
* V10 has RKISP1_CIF_ISP_AE_MEAN_MAX_V10 entries, V12 has
* RKISP1_CIF_ISP_AE_MEAN_MAX_V12 entries. RKISP1_CIF_ISP_AE_MEAN_MAX is equal
* to the maximum of the two.
*
* Image is divided into 5x5 blocks on V10 and 9x9 blocks on V12.
*/
struct rkisp1_cif_isp_ae_stat {
__u8 exp_mean[RKISP1_CIF_ISP_AE_MEAN_MAX];
struct rkisp1_cif_isp_bls_meas_val bls_val;
};
/**
* struct rkisp1_cif_isp_af_meas_val - AF measured values
*
* @sum: sharpness value
* @lum: luminance value
*/
struct rkisp1_cif_isp_af_meas_val {
__u32 sum;
__u32 lum;
};
/**
* struct rkisp1_cif_isp_af_stat - statistics auto focus data
*
* @window: AF measured value of window x
*
* The module measures the sharpness in 3 windows of selectable size via
* register settings(ISP_AFM_*_A/B/C)
*/
struct rkisp1_cif_isp_af_stat {
struct rkisp1_cif_isp_af_meas_val window[RKISP1_CIF_ISP_AFM_MAX_WINDOWS];
};
/**
* struct rkisp1_cif_isp_hist_stat - statistics histogram data
*
* @hist_bins: measured bin counters. Each bin is a 20 bits unsigned fixed point
* type. Bits 0-4 are the fractional part and bits 5-19 are the
* integer part.
*
* The window of the measurements area is divided to 5x5 sub-windows for
* V10 and to 9x9 sub-windows for V12. The histogram is then computed for each
* sub-window independently and the final result is a weighted average of the
* histogram measurements on all sub-windows. The window of the measurements
* area and the weight of each sub-window are configurable using
* struct @rkisp1_cif_isp_hst_config.
*
* The histogram contains 16 bins in V10 and 32 bins in V12.
*
* The number of entries of @hist_bins depends on the hardware revision
* as is reported by the hw_revision field of the struct media_device_info
* that is returned by ioctl MEDIA_IOC_DEVICE_INFO.
*
* V10 has RKISP1_CIF_ISP_HIST_BIN_N_MAX_V10 entries, V12 has
* RKISP1_CIF_ISP_HIST_BIN_N_MAX_V12 entries. RKISP1_CIF_ISP_HIST_BIN_N_MAX is
* equal to the maximum of the two.
*/
struct rkisp1_cif_isp_hist_stat {
__u32 hist_bins[RKISP1_CIF_ISP_HIST_BIN_N_MAX];
};
/**
* struct rkisp1_cif_isp_stat - Rockchip ISP1 Statistics Data
*
* @awb: statistics data for automatic white balance
* @ae: statistics data for auto exposure
* @af: statistics data for auto focus
* @hist: statistics histogram data
*/
struct rkisp1_cif_isp_stat {
struct rkisp1_cif_isp_awb_stat awb;
struct rkisp1_cif_isp_ae_stat ae;
struct rkisp1_cif_isp_af_stat af;
struct rkisp1_cif_isp_hist_stat hist;
};
/**
* struct rkisp1_stat_buffer - Rockchip ISP1 Statistics Meta Data
*
* @meas_type: measurement types (RKISP1_CIF_ISP_STAT_* definitions)
* @frame_id: frame ID for sync
* @params: statistics data
*/
struct rkisp1_stat_buffer {
__u32 meas_type;
__u32 frame_id;
struct rkisp1_cif_isp_stat params;
};
#endif /* _RKISP1_CONFIG_H */

View File

@@ -0,0 +1,33 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_UDMABUF_H
#define _LINUX_UDMABUF_H
#include <linux/types.h>
#include <linux/ioctl.h>
#define UDMABUF_FLAGS_CLOEXEC 0x01
struct udmabuf_create {
__u32 memfd;
__u32 flags;
__u64 offset;
__u64 size;
};
struct udmabuf_create_item {
__u32 memfd;
__u32 __pad;
__u64 offset;
__u64 size;
};
struct udmabuf_create_list {
__u32 flags;
__u32 count;
struct udmabuf_create_item list[];
};
#define UDMABUF_CREATE _IOW('u', 0x42, struct udmabuf_create)
#define UDMABUF_CREATE_LIST _IOW('u', 0x43, struct udmabuf_create_list)
#endif /* _LINUX_UDMABUF_H */

View File

@@ -0,0 +1,69 @@
/* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
/*
* include/linux/v4l2-common.h
*
* Common V4L2 and V4L2 subdev definitions.
*
* Users are advised to #include this file either through videodev2.h
* (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer
* to this file directly.
*
* Copyright (C) 2012 Nokia Corporation
* Contact: Sakari Ailus <sakari.ailus@iki.fi>
*/
#ifndef __V4L2_COMMON__
#define __V4L2_COMMON__
#include <linux/types.h>
/*
*
* Selection interface definitions
*
*/
/* Current cropping area */
#define V4L2_SEL_TGT_CROP 0x0000
/* Default cropping area */
#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
/* Cropping bounds */
#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
/* Native frame size */
#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
/* Current composing area */
#define V4L2_SEL_TGT_COMPOSE 0x0100
/* Default composing area */
#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
/* Composing bounds */
#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
/* Current composing area plus all padding pixels */
#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
/* Selection flags */
#define V4L2_SEL_FLAG_GE (1 << 0)
#define V4L2_SEL_FLAG_LE (1 << 1)
#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
struct v4l2_edid {
__u32 pad;
__u32 start_block;
__u32 blocks;
__u32 reserved[5];
__u8 *edid;
};
/* Backward compatibility target definitions --- to be removed. */
#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
/* Backward compatibility flag definitions --- to be removed. */
#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
#endif /* __V4L2_COMMON__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,152 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Media Bus API header
*
* Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
*/
#ifndef __LINUX_V4L2_MEDIABUS_H
#define __LINUX_V4L2_MEDIABUS_H
#include <linux/media-bus-format.h>
#include <linux/types.h>
#include <linux/videodev2.h>
#define V4L2_MBUS_FRAMEFMT_SET_CSC 0x0001
/**
* struct v4l2_mbus_framefmt - frame format on the media bus
* @width: image width
* @height: image height
* @code: data format code (from enum v4l2_mbus_pixelcode)
* @field: used interlacing type (from enum v4l2_field), zero for metadata
* mbus codes
* @colorspace: colorspace of the data (from enum v4l2_colorspace), zero on
* metadata mbus codes
* @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding), zero
* for metadata mbus codes
* @hsv_enc: HSV encoding of the data (from enum v4l2_hsv_encoding), zero for
* metadata mbus codes
* @quantization: quantization of the data (from enum v4l2_quantization), zero
* for metadata mbus codes
* @xfer_func: transfer function of the data (from enum v4l2_xfer_func), zero
* for metadata mbus codes
* @flags: flags (V4L2_MBUS_FRAMEFMT_*)
* @reserved: reserved bytes that can be later used
*/
struct v4l2_mbus_framefmt {
__u32 width;
__u32 height;
__u32 code;
__u32 field;
__u32 colorspace;
union {
/* enum v4l2_ycbcr_encoding */
__u16 ycbcr_enc;
/* enum v4l2_hsv_encoding */
__u16 hsv_enc;
};
__u16 quantization;
__u16 xfer_func;
__u16 flags;
__u16 reserved[10];
};
/*
* enum v4l2_mbus_pixelcode and its definitions are now deprecated, and
* MEDIA_BUS_FMT_ definitions (defined in media-bus-format.h) should be
* used instead.
*
* New defines should only be added to media-bus-format.h. The
* v4l2_mbus_pixelcode enum is frozen.
*/
#define V4L2_MBUS_FROM_MEDIA_BUS_FMT(name) \
V4L2_MBUS_FMT_ ## name = MEDIA_BUS_FMT_ ## name
enum v4l2_mbus_pixelcode {
V4L2_MBUS_FROM_MEDIA_BUS_FMT(FIXED),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB444_2X8_PADHI_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB444_2X8_PADHI_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB555_2X8_PADHI_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB555_2X8_PADHI_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(BGR565_2X8_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(BGR565_2X8_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB565_2X8_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB565_2X8_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB666_1X18),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_1X24),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_2X12_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(RGB888_2X12_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(ARGB8888_1X32),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UV8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_1_5X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_1_5X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_1_5X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_1_5X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_2X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_2X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_2X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_2X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y10_1X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY10_2X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY10_2X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV10_2X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU10_2X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(Y12_1X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY8_1X16),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY8_1X16),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV8_1X16),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU8_1X16),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YDYUYDYV8_1X16),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY10_1X20),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY10_1X20),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV10_1X20),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU10_1X20),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUV10_1X30),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(AYUV8_1X32),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY12_2X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY12_2X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV12_2X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU12_2X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(UYVY12_1X24),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(VYUY12_1X24),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YUYV12_1X24),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(YVYU12_1X24),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_ALAW8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_ALAW8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_ALAW8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_ALAW8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_DPCM8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_DPCM8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_DPCM8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_DPCM8_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADHI_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADHI_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADLO_BE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_2X8_PADLO_LE),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR10_1X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG10_1X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG10_1X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB10_1X10),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SBGGR12_1X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGBRG12_1X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SGRBG12_1X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(SRGGB12_1X12),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(JPEG_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(S5C_UYVY_JPEG_1X8),
V4L2_MBUS_FROM_MEDIA_BUS_FMT(AHSV8888_1X32),
};
#endif

View File

@@ -0,0 +1,304 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* V4L2 subdev userspace API
*
* Copyright (C) 2010 Nokia Corporation
*
* Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
* Sakari Ailus <sakari.ailus@iki.fi>
*/
#ifndef __LINUX_V4L2_SUBDEV_H
#define __LINUX_V4L2_SUBDEV_H
#include <linux/const.h>
#include <linux/ioctl.h>
#include <linux/types.h>
#include <linux/v4l2-common.h>
#include <linux/v4l2-mediabus.h>
/**
* enum v4l2_subdev_format_whence - Media bus format type
* @V4L2_SUBDEV_FORMAT_TRY: try format, for negotiation only
* @V4L2_SUBDEV_FORMAT_ACTIVE: active format, applied to the device
*/
enum v4l2_subdev_format_whence {
V4L2_SUBDEV_FORMAT_TRY = 0,
V4L2_SUBDEV_FORMAT_ACTIVE = 1,
};
/**
* struct v4l2_subdev_format - Pad-level media bus format
* @which: format type (from enum v4l2_subdev_format_whence)
* @pad: pad number, as reported by the media API
* @format: media bus format (format code and frame size)
* @stream: stream number, defined in subdev routing
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_format {
__u32 which;
__u32 pad;
struct v4l2_mbus_framefmt format;
__u32 stream;
__u32 reserved[7];
};
/**
* struct v4l2_subdev_crop - Pad-level crop settings
* @which: format type (from enum v4l2_subdev_format_whence)
* @pad: pad number, as reported by the media API
* @rect: pad crop rectangle boundaries
* @stream: stream number, defined in subdev routing
* @reserved: drivers and applications must zero this array
*
* The subdev crop API is an obsolete interface and may be removed in the
* future. It is superseded by the selection API. No new extensions to this
* structure will be accepted.
*/
struct v4l2_subdev_crop {
__u32 which;
__u32 pad;
struct v4l2_rect rect;
__u32 stream;
__u32 reserved[7];
};
#define V4L2_SUBDEV_MBUS_CODE_CSC_COLORSPACE 0x00000001
#define V4L2_SUBDEV_MBUS_CODE_CSC_XFER_FUNC 0x00000002
#define V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC 0x00000004
#define V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC
#define V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION 0x00000008
/**
* struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
* @pad: pad number, as reported by the media API
* @index: format index during enumeration
* @code: format code (MEDIA_BUS_FMT_ definitions)
* @which: format type (from enum v4l2_subdev_format_whence)
* @flags: flags set by the driver, (V4L2_SUBDEV_MBUS_CODE_*)
* @stream: stream number, defined in subdev routing
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_mbus_code_enum {
__u32 pad;
__u32 index;
__u32 code;
__u32 which;
__u32 flags;
__u32 stream;
__u32 reserved[6];
};
/**
* struct v4l2_subdev_frame_size_enum - Media bus format enumeration
* @index: format index during enumeration
* @pad: pad number, as reported by the media API
* @code: format code (MEDIA_BUS_FMT_ definitions)
* @min_width: minimum frame width, in pixels
* @max_width: maximum frame width, in pixels
* @min_height: minimum frame height, in pixels
* @max_height: maximum frame height, in pixels
* @which: format type (from enum v4l2_subdev_format_whence)
* @stream: stream number, defined in subdev routing
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_frame_size_enum {
__u32 index;
__u32 pad;
__u32 code;
__u32 min_width;
__u32 max_width;
__u32 min_height;
__u32 max_height;
__u32 which;
__u32 stream;
__u32 reserved[7];
};
/**
* struct v4l2_subdev_frame_interval - Pad-level frame rate
* @pad: pad number, as reported by the media API
* @interval: frame interval in seconds
* @stream: stream number, defined in subdev routing
* @which: interval type (from enum v4l2_subdev_format_whence)
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_frame_interval {
__u32 pad;
struct v4l2_fract interval;
__u32 stream;
__u32 which;
__u32 reserved[7];
};
/**
* struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
* @pad: pad number, as reported by the media API
* @index: frame interval index during enumeration
* @code: format code (MEDIA_BUS_FMT_ definitions)
* @width: frame width in pixels
* @height: frame height in pixels
* @interval: frame interval in seconds
* @which: interval type (from enum v4l2_subdev_format_whence)
* @stream: stream number, defined in subdev routing
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_frame_interval_enum {
__u32 index;
__u32 pad;
__u32 code;
__u32 width;
__u32 height;
struct v4l2_fract interval;
__u32 which;
__u32 stream;
__u32 reserved[7];
};
/**
* struct v4l2_subdev_selection - selection info
*
* @which: either V4L2_SUBDEV_FORMAT_ACTIVE or V4L2_SUBDEV_FORMAT_TRY
* @pad: pad number, as reported by the media API
* @target: Selection target, used to choose one of possible rectangles,
* defined in v4l2-common.h; V4L2_SEL_TGT_* .
* @flags: constraint flags, defined in v4l2-common.h; V4L2_SEL_FLAG_*.
* @r: coordinates of the selection window
* @stream: stream number, defined in subdev routing
* @reserved: for future use, set to zero for now
*
* Hardware may use multiple helper windows to process a video stream.
* The structure is used to exchange this selection areas between
* an application and a driver.
*/
struct v4l2_subdev_selection {
__u32 which;
__u32 pad;
__u32 target;
__u32 flags;
struct v4l2_rect r;
__u32 stream;
__u32 reserved[7];
};
/**
* struct v4l2_subdev_capability - subdev capabilities
* @version: the driver versioning number
* @capabilities: the subdev capabilities, see V4L2_SUBDEV_CAP_*
* @reserved: for future use, set to zero for now
*/
struct v4l2_subdev_capability {
__u32 version;
__u32 capabilities;
__u32 reserved[14];
};
/* The v4l2 sub-device video device node is registered in read-only mode. */
#define V4L2_SUBDEV_CAP_RO_SUBDEV 0x00000001
/* The v4l2 sub-device supports routing and multiplexed streams. */
#define V4L2_SUBDEV_CAP_STREAMS 0x00000002
/*
* Is the route active? An active route will start when streaming is enabled
* on a video node.
*/
#define V4L2_SUBDEV_ROUTE_FL_ACTIVE (1U << 0)
/**
* struct v4l2_subdev_route - A route inside a subdev
*
* @sink_pad: the sink pad index
* @sink_stream: the sink stream identifier
* @source_pad: the source pad index
* @source_stream: the source stream identifier
* @flags: route flags V4L2_SUBDEV_ROUTE_FL_*
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_route {
__u32 sink_pad;
__u32 sink_stream;
__u32 source_pad;
__u32 source_stream;
__u32 flags;
__u32 reserved[5];
};
/**
* struct v4l2_subdev_routing - Subdev routing information
*
* @which: configuration type (from enum v4l2_subdev_format_whence)
* @len_routes: the length of the routes array, in routes; set by the user, not
* modified by the kernel
* @routes: pointer to the routes array
* @num_routes: the total number of routes, possibly more than fits in the
* routes array
* @reserved: drivers and applications must zero this array
*/
struct v4l2_subdev_routing {
__u32 which;
__u32 len_routes;
__u64 routes;
__u32 num_routes;
__u32 reserved[11];
};
/*
* The client is aware of streams. Setting this flag enables the use of 'stream'
* fields (referring to the stream number) with various ioctls. If this is not
* set (which is the default), the 'stream' fields will be forced to 0 by the
* kernel.
*/
#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0)
/*
* The client is aware of the struct v4l2_subdev_frame_interval which field. If
* this is not set (which is the default), the which field is forced to
* V4L2_SUBDEV_FORMAT_ACTIVE by the kernel.
*/
#define V4L2_SUBDEV_CLIENT_CAP_INTERVAL_USES_WHICH (1ULL << 1)
/**
* struct v4l2_subdev_client_capability - Capabilities of the client accessing
* the subdev
*
* @capabilities: A bitmask of V4L2_SUBDEV_CLIENT_CAP_* flags.
*/
struct v4l2_subdev_client_capability {
__u64 capabilities;
};
/* Backwards compatibility define --- to be removed */
#define v4l2_subdev_edid v4l2_edid
#define VIDIOC_SUBDEV_QUERYCAP _IOR('V', 0, struct v4l2_subdev_capability)
#define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format)
#define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format)
#define VIDIOC_SUBDEV_G_FRAME_INTERVAL _IOWR('V', 21, struct v4l2_subdev_frame_interval)
#define VIDIOC_SUBDEV_S_FRAME_INTERVAL _IOWR('V', 22, struct v4l2_subdev_frame_interval)
#define VIDIOC_SUBDEV_ENUM_MBUS_CODE _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum)
#define VIDIOC_SUBDEV_ENUM_FRAME_SIZE _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
#define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
#define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop)
#define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop)
#define VIDIOC_SUBDEV_G_SELECTION _IOWR('V', 61, struct v4l2_subdev_selection)
#define VIDIOC_SUBDEV_S_SELECTION _IOWR('V', 62, struct v4l2_subdev_selection)
#define VIDIOC_SUBDEV_G_ROUTING _IOWR('V', 38, struct v4l2_subdev_routing)
#define VIDIOC_SUBDEV_S_ROUTING _IOWR('V', 39, struct v4l2_subdev_routing)
#define VIDIOC_SUBDEV_G_CLIENT_CAP _IOR('V', 101, struct v4l2_subdev_client_capability)
#define VIDIOC_SUBDEV_S_CLIENT_CAP _IOWR('V', 102, struct v4l2_subdev_client_capability)
/* The following ioctls are identical to the ioctls in videodev2.h */
#define VIDIOC_SUBDEV_G_STD _IOR('V', 23, v4l2_std_id)
#define VIDIOC_SUBDEV_S_STD _IOW('V', 24, v4l2_std_id)
#define VIDIOC_SUBDEV_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
#define VIDIOC_SUBDEV_G_EDID _IOWR('V', 40, struct v4l2_edid)
#define VIDIOC_SUBDEV_S_EDID _IOWR('V', 41, struct v4l2_edid)
#define VIDIOC_SUBDEV_QUERYSTD _IOR('V', 63, v4l2_std_id)
#define VIDIOC_SUBDEV_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
#define VIDIOC_SUBDEV_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
#define VIDIOC_SUBDEV_ENUM_DV_TIMINGS _IOWR('V', 98, struct v4l2_enum_dv_timings)
#define VIDIOC_SUBDEV_QUERY_DV_TIMINGS _IOR('V', 99, struct v4l2_dv_timings)
#define VIDIOC_SUBDEV_DV_TIMINGS_CAP _IOWR('V', 100, struct v4l2_dv_timings_cap)
#endif

File diff suppressed because it is too large Load Diff