Message ID | 20190527090559.26549-2-jacopo@jmondi.org |
---|---|
State | Accepted |
Headers | show |
Series |
|
Related | show |
Hi Jacopo, On 27/05/2019 10:05, Jacopo Mondi wrote: > Update kernel headers to v5.1 > > The most notable introduction for libcamera is support for > V4L2_BUF_TYPE_META_OUTPUT. > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > include/linux/media.h | 8 ++++ > include/linux/v4l2-common.h | 26 +++++------ > include/linux/v4l2-controls.h | 4 ++ > include/linux/videodev2.h | 88 ++++++++++++++++++++++++++++++----- Is this a full import of our 5.1 headers? Were there no changes in the following?: media-bus-format.h v4l2-dv-timings.h v4l2-mediabus.h v4l2-subdev.h I think we should do a full import when we do so ... -- Kieran > 4 files changed, 102 insertions(+), 24 deletions(-) > > diff --git a/include/linux/media.h b/include/linux/media.h > index c75664617760..29cc82b89ff2 100644 > --- a/include/linux/media.h > +++ b/include/linux/media.h > @@ -350,6 +350,14 @@ struct media_v2_topology { > #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) > > > /* > diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h > index 4f7b892377cd..14de1731b39c 100644 > --- a/include/linux/v4l2-common.h > +++ b/include/linux/v4l2-common.h > @@ -79,24 +79,11 @@ > /* Current composing area plus all padding pixels */ > #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 > > -/* 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 > - > /* Selection flags */ > #define V4L2_SEL_FLAG_GE (1 << 0) > #define V4L2_SEL_FLAG_LE (1 << 1) > #define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2) > > -/* 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 > - > struct v4l2_edid { > __u32 pad; > __u32 start_block; > @@ -105,4 +92,17 @@ struct v4l2_edid { > __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__ */ > diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h > index e4ee10ee917d..06479f2fb3ae 100644 > --- a/include/linux/v4l2-controls.h > +++ b/include/linux/v4l2-controls.h > @@ -50,6 +50,8 @@ > #ifndef __LINUX_V4L2_CONTROLS_H > #define __LINUX_V4L2_CONTROLS_H > > +#include <linux/types.h> > + > /* Control classes */ > #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ > #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ > @@ -531,6 +533,8 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type { > }; > #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381) > #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382) > +#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (V4L2_CID_MPEG_BASE+383) > +#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (V4L2_CID_MPEG_BASE+384) > #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) > #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) > #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) > diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h > index 1a95662f5ad0..5e739270116d 100644 > --- a/include/linux/videodev2.h > +++ b/include/linux/videodev2.h > @@ -128,6 +128,13 @@ enum v4l2_field { > ((field) == V4L2_FIELD_BOTTOM ||\ > (field) == V4L2_FIELD_TOP ||\ > (field) == V4L2_FIELD_ALTERNATE) > +#define V4L2_FIELD_IS_INTERLACED(field) \ > + ((field) == V4L2_FIELD_INTERLACED ||\ > + (field) == V4L2_FIELD_INTERLACED_TB ||\ > + (field) == V4L2_FIELD_INTERLACED_BT) > +#define V4L2_FIELD_IS_SEQUENTIAL(field) \ > + ((field) == V4L2_FIELD_SEQ_TB ||\ > + (field) == V4L2_FIELD_SEQ_BT) > > enum v4l2_buf_type { > V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, > @@ -143,6 +150,7 @@ enum v4l2_buf_type { > V4L2_BUF_TYPE_SDR_CAPTURE = 11, > V4L2_BUF_TYPE_SDR_OUTPUT = 12, > V4L2_BUF_TYPE_META_CAPTURE = 13, > + V4L2_BUF_TYPE_META_OUTPUT = 14, > /* Deprecated, do not use */ > V4L2_BUF_TYPE_PRIVATE = 0x80, > }; > @@ -158,7 +166,8 @@ enum v4l2_buf_type { > || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ > || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ > || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \ > - || (type) == V4L2_BUF_TYPE_SDR_OUTPUT) > + || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \ > + || (type) == V4L2_BUF_TYPE_META_OUTPUT) > > enum v4l2_tuner_type { > V4L2_TUNER_RADIO = 1, > @@ -223,8 +232,8 @@ enum v4l2_colorspace { > /* For RGB colorspaces such as produces by most webcams. */ > V4L2_COLORSPACE_SRGB = 8, > > - /* AdobeRGB colorspace */ > - V4L2_COLORSPACE_ADOBERGB = 9, > + /* opRGB colorspace */ > + V4L2_COLORSPACE_OPRGB = 9, > > /* BT.2020 colorspace, used for UHDTV. */ > V4L2_COLORSPACE_BT2020 = 10, > @@ -256,7 +265,7 @@ enum v4l2_xfer_func { > * > * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB > * > - * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB > + * V4L2_COLORSPACE_OPRGB: V4L2_XFER_FUNC_OPRGB > * > * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M > * > @@ -267,7 +276,7 @@ enum v4l2_xfer_func { > V4L2_XFER_FUNC_DEFAULT = 0, > V4L2_XFER_FUNC_709 = 1, > V4L2_XFER_FUNC_SRGB = 2, > - V4L2_XFER_FUNC_ADOBERGB = 3, > + V4L2_XFER_FUNC_OPRGB = 3, > V4L2_XFER_FUNC_SMPTE240M = 4, > V4L2_XFER_FUNC_NONE = 5, > V4L2_XFER_FUNC_DCI_P3 = 6, > @@ -279,7 +288,7 @@ enum v4l2_xfer_func { > * This depends on the colorspace. > */ > #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ > - ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ > + ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : \ > ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ > ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \ > ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ > @@ -293,7 +302,7 @@ enum v4l2_ycbcr_encoding { > * > * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, > * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB, > - * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 > + * V4L2_COLORSPACE_OPRGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 > * > * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709 > * > @@ -378,6 +387,15 @@ enum v4l2_quantization { > (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \ > V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) > > +/* > + * Deprecated names for opRGB colorspace (IEC 61966-2-5) > + * > + * WARNING: Please don't use these deprecated defines in your code, as > + * there is a chance we have to remove them in the future. > + */ > +#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB > +#define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB > + > enum v4l2_priority { > V4L2_PRIORITY_UNSET = 0, /* not initialized */ > V4L2_PRIORITY_BACKGROUND = 1, > @@ -454,6 +472,7 @@ struct v4l2_capability { > #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ > #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ > #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ > +#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */ > > #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ > > @@ -537,6 +556,10 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ > #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ > #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ > +#define V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V') /* 32 AYUV-8-8-8-8 */ > +#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */ > +#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */ > +#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */ > #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ > #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ > #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ > @@ -631,6 +654,7 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ > #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ > #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ > +#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */ > #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */ > #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ > #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ > @@ -672,6 +696,8 @@ struct v4l2_pix_format { > #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */ > #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ > #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ > +#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ > +#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ > > /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ > #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ > @@ -699,6 +725,7 @@ struct v4l2_pix_format { > #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ > #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ > #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ > +#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ > > /* priv field value to indicates that subsequent fields are valid. */ > #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe > @@ -852,9 +879,17 @@ struct v4l2_requestbuffers { > __u32 count; > __u32 type; /* enum v4l2_buf_type */ > __u32 memory; /* enum v4l2_memory */ > - __u32 reserved[2]; > + __u32 capabilities; > + __u32 reserved[1]; > }; > > +/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ > +#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) > +#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1) > +#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2) > +#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) > +#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4) > + > /** > * struct v4l2_plane - plane info for multi-planar buffers > * @bytesused: number of bytes occupied by data in the plane (payload) > @@ -913,6 +948,7 @@ struct v4l2_plane { > * @length: size in bytes of the buffer (NOT its payload) for single-plane > * buffers (when type != *_MPLANE); number of elements in the > * planes array for multi-plane buffers > + * @request_fd: fd of the request that this buffer should use > * > * Contains data exchanged by application and driver using one of the Streaming > * I/O methods. > @@ -937,9 +973,24 @@ struct v4l2_buffer { > } m; > __u32 length; > __u32 reserved2; > - __u32 reserved; > + union { > + __s32 request_fd; > + __u32 reserved; > + }; > }; > > +/** > + * v4l2_timeval_to_ns - Convert timeval to nanoseconds > + * @ts: pointer to the timeval variable to be converted > + * > + * Returns the scalar nanosecond representation of the timeval > + * parameter. > + */ > +static __inline__ __u64 v4l2_timeval_to_ns(const struct timeval *tv) > +{ > + return (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000; > +} > + > /* Flags for 'flags' field */ > /* Buffer is mapped (flag) */ > #define V4L2_BUF_FLAG_MAPPED 0x00000001 > @@ -955,6 +1006,8 @@ struct v4l2_buffer { > #define V4L2_BUF_FLAG_BFRAME 0x00000020 > /* Buffer is ready, but the data contained within is corrupted. */ > #define V4L2_BUF_FLAG_ERROR 0x00000040 > +/* Buffer is added to an unqueued request */ > +#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080 > /* timecode field is valid */ > #define V4L2_BUF_FLAG_TIMECODE 0x00000100 > /* Buffer is prepared for queuing */ > @@ -973,6 +1026,8 @@ struct v4l2_buffer { > #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 > /* mem2mem encoder/decoder */ > #define V4L2_BUF_FLAG_LAST 0x00100000 > +/* request_fd is valid */ > +#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000 > > /** > * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor > @@ -1396,6 +1451,13 @@ struct v4l2_bt_timings { > * InfoFrame). > */ > #define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8) > +/* > + * CEA-861 specific: only valid for video receivers. > + * If set, then HW can detect the difference between regular FPS and > + * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with > + * the V4L2_DV_FL_CAN_REDUCE_FPS flag set. > + */ > +#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9) > > /* A few useful defines to calculate the total blanking and frame sizes */ > #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ > @@ -1593,7 +1655,8 @@ struct v4l2_ext_controls { > }; > __u32 count; > __u32 error_idx; > - __u32 reserved[2]; > + __s32 request_fd; > + __u32 reserved[1]; > struct v4l2_ext_control *controls; > }; > > @@ -1604,6 +1667,7 @@ struct v4l2_ext_controls { > #define V4L2_CTRL_MAX_DIMS (4) > #define V4L2_CTRL_WHICH_CUR_VAL 0 > #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 > +#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000 > > enum v4l2_ctrl_type { > V4L2_CTRL_TYPE_INTEGER = 1, > @@ -2294,6 +2358,7 @@ struct v4l2_dbg_chip_info { > * return: number of created buffers > * @memory: enum v4l2_memory; buffer memory type > * @format: frame format, for which buffers are requested > + * @capabilities: capabilities of this buffer type. > * @reserved: future extensions > */ > struct v4l2_create_buffers { > @@ -2301,7 +2366,8 @@ struct v4l2_create_buffers { > __u32 count; > __u32 memory; > struct v4l2_format format; > - __u32 reserved[8]; > + __u32 capabilities; > + __u32 reserved[7]; > }; > > /* >
Hi Kieran, On Tue, Jun 04, 2019 at 09:39:59AM +0100, Kieran Bingham wrote: > Hi Jacopo, > > On 27/05/2019 10:05, Jacopo Mondi wrote: > > Update kernel headers to v5.1 > > > > The most notable introduction for libcamera is support for > > V4L2_BUF_TYPE_META_OUTPUT. > > > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > --- > > include/linux/media.h | 8 ++++ > > include/linux/v4l2-common.h | 26 +++++------ > > include/linux/v4l2-controls.h | 4 ++ > > include/linux/videodev2.h | 88 ++++++++++++++++++++++++++++++----- > > Is this a full import of our 5.1 headers? > Yes, at least this was my intention > Were there no changes in the following?: > > media-bus-format.h > v4l2-dv-timings.h > v4l2-mediabus.h > v4l2-subdev.h > > I think we should do a full import when we do so ... $ export HDR=.../linux-headers/v5.1/include/ $ cd include/linux/ $ for h in $(ls *.h); do H=$(find $HDR -name $h); diff $h $H; done $ That's the same line I have used to copy the files when I made this patch iirc. Do you see any difference not reported here? Thanks j > > -- > Kieran > > > > 4 files changed, 102 insertions(+), 24 deletions(-) > > > > diff --git a/include/linux/media.h b/include/linux/media.h > > index c75664617760..29cc82b89ff2 100644 > > --- a/include/linux/media.h > > +++ b/include/linux/media.h > > @@ -350,6 +350,14 @@ struct media_v2_topology { > > #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) > > > > > > /* > > diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h > > index 4f7b892377cd..14de1731b39c 100644 > > --- a/include/linux/v4l2-common.h > > +++ b/include/linux/v4l2-common.h > > @@ -79,24 +79,11 @@ > > /* Current composing area plus all padding pixels */ > > #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 > > > > -/* 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 > > - > > /* Selection flags */ > > #define V4L2_SEL_FLAG_GE (1 << 0) > > #define V4L2_SEL_FLAG_LE (1 << 1) > > #define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2) > > > > -/* 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 > > - > > struct v4l2_edid { > > __u32 pad; > > __u32 start_block; > > @@ -105,4 +92,17 @@ struct v4l2_edid { > > __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__ */ > > diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h > > index e4ee10ee917d..06479f2fb3ae 100644 > > --- a/include/linux/v4l2-controls.h > > +++ b/include/linux/v4l2-controls.h > > @@ -50,6 +50,8 @@ > > #ifndef __LINUX_V4L2_CONTROLS_H > > #define __LINUX_V4L2_CONTROLS_H > > > > +#include <linux/types.h> > > + > > /* Control classes */ > > #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ > > #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ > > @@ -531,6 +533,8 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type { > > }; > > #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381) > > #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382) > > +#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (V4L2_CID_MPEG_BASE+383) > > +#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (V4L2_CID_MPEG_BASE+384) > > #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) > > #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) > > #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) > > diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h > > index 1a95662f5ad0..5e739270116d 100644 > > --- a/include/linux/videodev2.h > > +++ b/include/linux/videodev2.h > > @@ -128,6 +128,13 @@ enum v4l2_field { > > ((field) == V4L2_FIELD_BOTTOM ||\ > > (field) == V4L2_FIELD_TOP ||\ > > (field) == V4L2_FIELD_ALTERNATE) > > +#define V4L2_FIELD_IS_INTERLACED(field) \ > > + ((field) == V4L2_FIELD_INTERLACED ||\ > > + (field) == V4L2_FIELD_INTERLACED_TB ||\ > > + (field) == V4L2_FIELD_INTERLACED_BT) > > +#define V4L2_FIELD_IS_SEQUENTIAL(field) \ > > + ((field) == V4L2_FIELD_SEQ_TB ||\ > > + (field) == V4L2_FIELD_SEQ_BT) > > > > enum v4l2_buf_type { > > V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, > > @@ -143,6 +150,7 @@ enum v4l2_buf_type { > > V4L2_BUF_TYPE_SDR_CAPTURE = 11, > > V4L2_BUF_TYPE_SDR_OUTPUT = 12, > > V4L2_BUF_TYPE_META_CAPTURE = 13, > > + V4L2_BUF_TYPE_META_OUTPUT = 14, > > /* Deprecated, do not use */ > > V4L2_BUF_TYPE_PRIVATE = 0x80, > > }; > > @@ -158,7 +166,8 @@ enum v4l2_buf_type { > > || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ > > || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ > > || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \ > > - || (type) == V4L2_BUF_TYPE_SDR_OUTPUT) > > + || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \ > > + || (type) == V4L2_BUF_TYPE_META_OUTPUT) > > > > enum v4l2_tuner_type { > > V4L2_TUNER_RADIO = 1, > > @@ -223,8 +232,8 @@ enum v4l2_colorspace { > > /* For RGB colorspaces such as produces by most webcams. */ > > V4L2_COLORSPACE_SRGB = 8, > > > > - /* AdobeRGB colorspace */ > > - V4L2_COLORSPACE_ADOBERGB = 9, > > + /* opRGB colorspace */ > > + V4L2_COLORSPACE_OPRGB = 9, > > > > /* BT.2020 colorspace, used for UHDTV. */ > > V4L2_COLORSPACE_BT2020 = 10, > > @@ -256,7 +265,7 @@ enum v4l2_xfer_func { > > * > > * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB > > * > > - * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB > > + * V4L2_COLORSPACE_OPRGB: V4L2_XFER_FUNC_OPRGB > > * > > * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M > > * > > @@ -267,7 +276,7 @@ enum v4l2_xfer_func { > > V4L2_XFER_FUNC_DEFAULT = 0, > > V4L2_XFER_FUNC_709 = 1, > > V4L2_XFER_FUNC_SRGB = 2, > > - V4L2_XFER_FUNC_ADOBERGB = 3, > > + V4L2_XFER_FUNC_OPRGB = 3, > > V4L2_XFER_FUNC_SMPTE240M = 4, > > V4L2_XFER_FUNC_NONE = 5, > > V4L2_XFER_FUNC_DCI_P3 = 6, > > @@ -279,7 +288,7 @@ enum v4l2_xfer_func { > > * This depends on the colorspace. > > */ > > #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ > > - ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ > > + ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : \ > > ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ > > ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \ > > ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ > > @@ -293,7 +302,7 @@ enum v4l2_ycbcr_encoding { > > * > > * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, > > * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB, > > - * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 > > + * V4L2_COLORSPACE_OPRGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 > > * > > * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709 > > * > > @@ -378,6 +387,15 @@ enum v4l2_quantization { > > (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \ > > V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) > > > > +/* > > + * Deprecated names for opRGB colorspace (IEC 61966-2-5) > > + * > > + * WARNING: Please don't use these deprecated defines in your code, as > > + * there is a chance we have to remove them in the future. > > + */ > > +#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB > > +#define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB > > + > > enum v4l2_priority { > > V4L2_PRIORITY_UNSET = 0, /* not initialized */ > > V4L2_PRIORITY_BACKGROUND = 1, > > @@ -454,6 +472,7 @@ struct v4l2_capability { > > #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ > > #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ > > #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ > > +#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */ > > > > #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ > > > > @@ -537,6 +556,10 @@ struct v4l2_pix_format { > > #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ > > #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ > > #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ > > +#define V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V') /* 32 AYUV-8-8-8-8 */ > > +#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */ > > +#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */ > > +#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */ > > #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ > > #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ > > #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ > > @@ -631,6 +654,7 @@ struct v4l2_pix_format { > > #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ > > #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ > > #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ > > +#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */ > > #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */ > > #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ > > #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ > > @@ -672,6 +696,8 @@ struct v4l2_pix_format { > > #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */ > > #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ > > #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ > > +#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ > > +#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ > > > > /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ > > #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ > > @@ -699,6 +725,7 @@ struct v4l2_pix_format { > > #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ > > #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ > > #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ > > +#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ > > > > /* priv field value to indicates that subsequent fields are valid. */ > > #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe > > @@ -852,9 +879,17 @@ struct v4l2_requestbuffers { > > __u32 count; > > __u32 type; /* enum v4l2_buf_type */ > > __u32 memory; /* enum v4l2_memory */ > > - __u32 reserved[2]; > > + __u32 capabilities; > > + __u32 reserved[1]; > > }; > > > > +/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ > > +#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) > > +#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1) > > +#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2) > > +#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) > > +#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4) > > + > > /** > > * struct v4l2_plane - plane info for multi-planar buffers > > * @bytesused: number of bytes occupied by data in the plane (payload) > > @@ -913,6 +948,7 @@ struct v4l2_plane { > > * @length: size in bytes of the buffer (NOT its payload) for single-plane > > * buffers (when type != *_MPLANE); number of elements in the > > * planes array for multi-plane buffers > > + * @request_fd: fd of the request that this buffer should use > > * > > * Contains data exchanged by application and driver using one of the Streaming > > * I/O methods. > > @@ -937,9 +973,24 @@ struct v4l2_buffer { > > } m; > > __u32 length; > > __u32 reserved2; > > - __u32 reserved; > > + union { > > + __s32 request_fd; > > + __u32 reserved; > > + }; > > }; > > > > +/** > > + * v4l2_timeval_to_ns - Convert timeval to nanoseconds > > + * @ts: pointer to the timeval variable to be converted > > + * > > + * Returns the scalar nanosecond representation of the timeval > > + * parameter. > > + */ > > +static __inline__ __u64 v4l2_timeval_to_ns(const struct timeval *tv) > > +{ > > + return (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000; > > +} > > + > > /* Flags for 'flags' field */ > > /* Buffer is mapped (flag) */ > > #define V4L2_BUF_FLAG_MAPPED 0x00000001 > > @@ -955,6 +1006,8 @@ struct v4l2_buffer { > > #define V4L2_BUF_FLAG_BFRAME 0x00000020 > > /* Buffer is ready, but the data contained within is corrupted. */ > > #define V4L2_BUF_FLAG_ERROR 0x00000040 > > +/* Buffer is added to an unqueued request */ > > +#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080 > > /* timecode field is valid */ > > #define V4L2_BUF_FLAG_TIMECODE 0x00000100 > > /* Buffer is prepared for queuing */ > > @@ -973,6 +1026,8 @@ struct v4l2_buffer { > > #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 > > /* mem2mem encoder/decoder */ > > #define V4L2_BUF_FLAG_LAST 0x00100000 > > +/* request_fd is valid */ > > +#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000 > > > > /** > > * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor > > @@ -1396,6 +1451,13 @@ struct v4l2_bt_timings { > > * InfoFrame). > > */ > > #define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8) > > +/* > > + * CEA-861 specific: only valid for video receivers. > > + * If set, then HW can detect the difference between regular FPS and > > + * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with > > + * the V4L2_DV_FL_CAN_REDUCE_FPS flag set. > > + */ > > +#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9) > > > > /* A few useful defines to calculate the total blanking and frame sizes */ > > #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ > > @@ -1593,7 +1655,8 @@ struct v4l2_ext_controls { > > }; > > __u32 count; > > __u32 error_idx; > > - __u32 reserved[2]; > > + __s32 request_fd; > > + __u32 reserved[1]; > > struct v4l2_ext_control *controls; > > }; > > > > @@ -1604,6 +1667,7 @@ struct v4l2_ext_controls { > > #define V4L2_CTRL_MAX_DIMS (4) > > #define V4L2_CTRL_WHICH_CUR_VAL 0 > > #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 > > +#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000 > > > > enum v4l2_ctrl_type { > > V4L2_CTRL_TYPE_INTEGER = 1, > > @@ -2294,6 +2358,7 @@ struct v4l2_dbg_chip_info { > > * return: number of created buffers > > * @memory: enum v4l2_memory; buffer memory type > > * @format: frame format, for which buffers are requested > > + * @capabilities: capabilities of this buffer type. > > * @reserved: future extensions > > */ > > struct v4l2_create_buffers { > > @@ -2301,7 +2366,8 @@ struct v4l2_create_buffers { > > __u32 count; > > __u32 memory; > > struct v4l2_format format; > > - __u32 reserved[8]; > > + __u32 capabilities; > > + __u32 reserved[7]; > > }; > > > > /* > > > > -- > Regards > -- > Kieran
Hi Jacopo, On 04/06/2019 14:30, Jacopo Mondi wrote: > Hi Kieran, > > On Tue, Jun 04, 2019 at 09:39:59AM +0100, Kieran Bingham wrote: >> Hi Jacopo, >> >> On 27/05/2019 10:05, Jacopo Mondi wrote: >>> Update kernel headers to v5.1 >>> >>> The most notable introduction for libcamera is support for >>> V4L2_BUF_TYPE_META_OUTPUT. >>> >>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> >>> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> >>> --- >>> include/linux/media.h | 8 ++++ >>> include/linux/v4l2-common.h | 26 +++++------ >>> include/linux/v4l2-controls.h | 4 ++ >>> include/linux/videodev2.h | 88 ++++++++++++++++++++++++++++++----- >> >> Is this a full import of our 5.1 headers? >> > > Yes, at least this was my intention > >> Were there no changes in the following?: >> >> media-bus-format.h >> v4l2-dv-timings.h >> v4l2-mediabus.h >> v4l2-subdev.h >> >> I think we should do a full import when we do so ... > > $ export HDR=.../linux-headers/v5.1/include/ > $ cd include/linux/ > $ for h in $(ls *.h); do H=$(find $HDR -name $h); diff $h $H; done > $ > > That's the same line I have used to copy the files when I made this > patch iirc. > > Do you see any difference not reported here? Aha sorry - I incorrectly compared the kernel api headers, not the uapi headers :) sources/linux/include/uapi/linux$ git diff --stat v4.19..v5.1 media-bus-format.h media.h v4l2-common.h v4l2-controls.h v4l2-dv-timings.h v4l2-mediabus.h v4l2-subdev.h videodev2.h include/uapi/linux/media.h | 8 ++++++++ include/uapi/linux/v4l2-common.h | 28 +++++++++++++------------ include/uapi/linux/v4l2-controls.h | 4 ++++ include/uapi/linux/videodev2.h | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 4 files changed, 106 insertions(+), 24 deletions(-) (I believe the small diff is likely because I've diffed un-exported headers as they are stored in git...). So this looks good to me. Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> > > Thanks > j > >> >> -- >> Kieran >> >> >>> 4 files changed, 102 insertions(+), 24 deletions(-) >>> >>> diff --git a/include/linux/media.h b/include/linux/media.h >>> index c75664617760..29cc82b89ff2 100644 >>> --- a/include/linux/media.h >>> +++ b/include/linux/media.h >>> @@ -350,6 +350,14 @@ struct media_v2_topology { >>> #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) >>> >>> >>> /* >>> diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h >>> index 4f7b892377cd..14de1731b39c 100644 >>> --- a/include/linux/v4l2-common.h >>> +++ b/include/linux/v4l2-common.h >>> @@ -79,24 +79,11 @@ >>> /* Current composing area plus all padding pixels */ >>> #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 >>> >>> -/* 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 >>> - >>> /* Selection flags */ >>> #define V4L2_SEL_FLAG_GE (1 << 0) >>> #define V4L2_SEL_FLAG_LE (1 << 1) >>> #define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2) >>> >>> -/* 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 >>> - >>> struct v4l2_edid { >>> __u32 pad; >>> __u32 start_block; >>> @@ -105,4 +92,17 @@ struct v4l2_edid { >>> __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__ */ >>> diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h >>> index e4ee10ee917d..06479f2fb3ae 100644 >>> --- a/include/linux/v4l2-controls.h >>> +++ b/include/linux/v4l2-controls.h >>> @@ -50,6 +50,8 @@ >>> #ifndef __LINUX_V4L2_CONTROLS_H >>> #define __LINUX_V4L2_CONTROLS_H >>> >>> +#include <linux/types.h> >>> + >>> /* Control classes */ >>> #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ >>> #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ >>> @@ -531,6 +533,8 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type { >>> }; >>> #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381) >>> #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382) >>> +#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (V4L2_CID_MPEG_BASE+383) >>> +#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (V4L2_CID_MPEG_BASE+384) >>> #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) >>> #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) >>> #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) >>> diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h >>> index 1a95662f5ad0..5e739270116d 100644 >>> --- a/include/linux/videodev2.h >>> +++ b/include/linux/videodev2.h >>> @@ -128,6 +128,13 @@ enum v4l2_field { >>> ((field) == V4L2_FIELD_BOTTOM ||\ >>> (field) == V4L2_FIELD_TOP ||\ >>> (field) == V4L2_FIELD_ALTERNATE) >>> +#define V4L2_FIELD_IS_INTERLACED(field) \ >>> + ((field) == V4L2_FIELD_INTERLACED ||\ >>> + (field) == V4L2_FIELD_INTERLACED_TB ||\ >>> + (field) == V4L2_FIELD_INTERLACED_BT) >>> +#define V4L2_FIELD_IS_SEQUENTIAL(field) \ >>> + ((field) == V4L2_FIELD_SEQ_TB ||\ >>> + (field) == V4L2_FIELD_SEQ_BT) >>> >>> enum v4l2_buf_type { >>> V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, >>> @@ -143,6 +150,7 @@ enum v4l2_buf_type { >>> V4L2_BUF_TYPE_SDR_CAPTURE = 11, >>> V4L2_BUF_TYPE_SDR_OUTPUT = 12, >>> V4L2_BUF_TYPE_META_CAPTURE = 13, >>> + V4L2_BUF_TYPE_META_OUTPUT = 14, >>> /* Deprecated, do not use */ >>> V4L2_BUF_TYPE_PRIVATE = 0x80, >>> }; >>> @@ -158,7 +166,8 @@ enum v4l2_buf_type { >>> || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ >>> || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ >>> || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \ >>> - || (type) == V4L2_BUF_TYPE_SDR_OUTPUT) >>> + || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \ >>> + || (type) == V4L2_BUF_TYPE_META_OUTPUT) >>> >>> enum v4l2_tuner_type { >>> V4L2_TUNER_RADIO = 1, >>> @@ -223,8 +232,8 @@ enum v4l2_colorspace { >>> /* For RGB colorspaces such as produces by most webcams. */ >>> V4L2_COLORSPACE_SRGB = 8, >>> >>> - /* AdobeRGB colorspace */ >>> - V4L2_COLORSPACE_ADOBERGB = 9, >>> + /* opRGB colorspace */ >>> + V4L2_COLORSPACE_OPRGB = 9, >>> >>> /* BT.2020 colorspace, used for UHDTV. */ >>> V4L2_COLORSPACE_BT2020 = 10, >>> @@ -256,7 +265,7 @@ enum v4l2_xfer_func { >>> * >>> * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB >>> * >>> - * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB >>> + * V4L2_COLORSPACE_OPRGB: V4L2_XFER_FUNC_OPRGB >>> * >>> * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M >>> * >>> @@ -267,7 +276,7 @@ enum v4l2_xfer_func { >>> V4L2_XFER_FUNC_DEFAULT = 0, >>> V4L2_XFER_FUNC_709 = 1, >>> V4L2_XFER_FUNC_SRGB = 2, >>> - V4L2_XFER_FUNC_ADOBERGB = 3, >>> + V4L2_XFER_FUNC_OPRGB = 3, >>> V4L2_XFER_FUNC_SMPTE240M = 4, >>> V4L2_XFER_FUNC_NONE = 5, >>> V4L2_XFER_FUNC_DCI_P3 = 6, >>> @@ -279,7 +288,7 @@ enum v4l2_xfer_func { >>> * This depends on the colorspace. >>> */ >>> #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ >>> - ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ >>> + ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : \ >>> ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ >>> ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \ >>> ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ >>> @@ -293,7 +302,7 @@ enum v4l2_ycbcr_encoding { >>> * >>> * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, >>> * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB, >>> - * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 >>> + * V4L2_COLORSPACE_OPRGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 >>> * >>> * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709 >>> * >>> @@ -378,6 +387,15 @@ enum v4l2_quantization { >>> (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \ >>> V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) >>> >>> +/* >>> + * Deprecated names for opRGB colorspace (IEC 61966-2-5) >>> + * >>> + * WARNING: Please don't use these deprecated defines in your code, as >>> + * there is a chance we have to remove them in the future. >>> + */ >>> +#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB >>> +#define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB >>> + >>> enum v4l2_priority { >>> V4L2_PRIORITY_UNSET = 0, /* not initialized */ >>> V4L2_PRIORITY_BACKGROUND = 1, >>> @@ -454,6 +472,7 @@ struct v4l2_capability { >>> #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ >>> #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ >>> #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ >>> +#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */ >>> >>> #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ >>> >>> @@ -537,6 +556,10 @@ struct v4l2_pix_format { >>> #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ >>> #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ >>> #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ >>> +#define V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V') /* 32 AYUV-8-8-8-8 */ >>> +#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */ >>> +#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */ >>> +#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */ >>> #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ >>> #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ >>> #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ >>> @@ -631,6 +654,7 @@ struct v4l2_pix_format { >>> #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ >>> #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ >>> #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ >>> +#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */ >>> #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */ >>> #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ >>> #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ >>> @@ -672,6 +696,8 @@ struct v4l2_pix_format { >>> #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */ >>> #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ >>> #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ >>> +#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ >>> +#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ >>> >>> /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ >>> #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ >>> @@ -699,6 +725,7 @@ struct v4l2_pix_format { >>> #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ >>> #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ >>> #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ >>> +#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ >>> >>> /* priv field value to indicates that subsequent fields are valid. */ >>> #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe >>> @@ -852,9 +879,17 @@ struct v4l2_requestbuffers { >>> __u32 count; >>> __u32 type; /* enum v4l2_buf_type */ >>> __u32 memory; /* enum v4l2_memory */ >>> - __u32 reserved[2]; >>> + __u32 capabilities; >>> + __u32 reserved[1]; >>> }; >>> >>> +/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ >>> +#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) >>> +#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1) >>> +#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2) >>> +#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) >>> +#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4) >>> + >>> /** >>> * struct v4l2_plane - plane info for multi-planar buffers >>> * @bytesused: number of bytes occupied by data in the plane (payload) >>> @@ -913,6 +948,7 @@ struct v4l2_plane { >>> * @length: size in bytes of the buffer (NOT its payload) for single-plane >>> * buffers (when type != *_MPLANE); number of elements in the >>> * planes array for multi-plane buffers >>> + * @request_fd: fd of the request that this buffer should use >>> * >>> * Contains data exchanged by application and driver using one of the Streaming >>> * I/O methods. >>> @@ -937,9 +973,24 @@ struct v4l2_buffer { >>> } m; >>> __u32 length; >>> __u32 reserved2; >>> - __u32 reserved; >>> + union { >>> + __s32 request_fd; >>> + __u32 reserved; >>> + }; >>> }; >>> >>> +/** >>> + * v4l2_timeval_to_ns - Convert timeval to nanoseconds >>> + * @ts: pointer to the timeval variable to be converted >>> + * >>> + * Returns the scalar nanosecond representation of the timeval >>> + * parameter. >>> + */ >>> +static __inline__ __u64 v4l2_timeval_to_ns(const struct timeval *tv) >>> +{ >>> + return (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000; >>> +} >>> + >>> /* Flags for 'flags' field */ >>> /* Buffer is mapped (flag) */ >>> #define V4L2_BUF_FLAG_MAPPED 0x00000001 >>> @@ -955,6 +1006,8 @@ struct v4l2_buffer { >>> #define V4L2_BUF_FLAG_BFRAME 0x00000020 >>> /* Buffer is ready, but the data contained within is corrupted. */ >>> #define V4L2_BUF_FLAG_ERROR 0x00000040 >>> +/* Buffer is added to an unqueued request */ >>> +#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080 >>> /* timecode field is valid */ >>> #define V4L2_BUF_FLAG_TIMECODE 0x00000100 >>> /* Buffer is prepared for queuing */ >>> @@ -973,6 +1026,8 @@ struct v4l2_buffer { >>> #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 >>> /* mem2mem encoder/decoder */ >>> #define V4L2_BUF_FLAG_LAST 0x00100000 >>> +/* request_fd is valid */ >>> +#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000 >>> >>> /** >>> * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor >>> @@ -1396,6 +1451,13 @@ struct v4l2_bt_timings { >>> * InfoFrame). >>> */ >>> #define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8) >>> +/* >>> + * CEA-861 specific: only valid for video receivers. >>> + * If set, then HW can detect the difference between regular FPS and >>> + * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with >>> + * the V4L2_DV_FL_CAN_REDUCE_FPS flag set. >>> + */ >>> +#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9) >>> >>> /* A few useful defines to calculate the total blanking and frame sizes */ >>> #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ >>> @@ -1593,7 +1655,8 @@ struct v4l2_ext_controls { >>> }; >>> __u32 count; >>> __u32 error_idx; >>> - __u32 reserved[2]; >>> + __s32 request_fd; >>> + __u32 reserved[1]; >>> struct v4l2_ext_control *controls; >>> }; >>> >>> @@ -1604,6 +1667,7 @@ struct v4l2_ext_controls { >>> #define V4L2_CTRL_MAX_DIMS (4) >>> #define V4L2_CTRL_WHICH_CUR_VAL 0 >>> #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 >>> +#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000 >>> >>> enum v4l2_ctrl_type { >>> V4L2_CTRL_TYPE_INTEGER = 1, >>> @@ -2294,6 +2358,7 @@ struct v4l2_dbg_chip_info { >>> * return: number of created buffers >>> * @memory: enum v4l2_memory; buffer memory type >>> * @format: frame format, for which buffers are requested >>> + * @capabilities: capabilities of this buffer type. >>> * @reserved: future extensions >>> */ >>> struct v4l2_create_buffers { >>> @@ -2301,7 +2366,8 @@ struct v4l2_create_buffers { >>> __u32 count; >>> __u32 memory; >>> struct v4l2_format format; >>> - __u32 reserved[8]; >>> + __u32 capabilities; >>> + __u32 reserved[7]; >>> }; >>> >>> /* >>> >> >> -- >> Regards >> -- >> Kieran
diff --git a/include/linux/media.h b/include/linux/media.h index c75664617760..29cc82b89ff2 100644 --- a/include/linux/media.h +++ b/include/linux/media.h @@ -350,6 +350,14 @@ struct media_v2_topology { #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) /* diff --git a/include/linux/v4l2-common.h b/include/linux/v4l2-common.h index 4f7b892377cd..14de1731b39c 100644 --- a/include/linux/v4l2-common.h +++ b/include/linux/v4l2-common.h @@ -79,24 +79,11 @@ /* Current composing area plus all padding pixels */ #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 -/* 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 - /* Selection flags */ #define V4L2_SEL_FLAG_GE (1 << 0) #define V4L2_SEL_FLAG_LE (1 << 1) #define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2) -/* 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 - struct v4l2_edid { __u32 pad; __u32 start_block; @@ -105,4 +92,17 @@ struct v4l2_edid { __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__ */ diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h index e4ee10ee917d..06479f2fb3ae 100644 --- a/include/linux/v4l2-controls.h +++ b/include/linux/v4l2-controls.h @@ -50,6 +50,8 @@ #ifndef __LINUX_V4L2_CONTROLS_H #define __LINUX_V4L2_CONTROLS_H +#include <linux/types.h> + /* Control classes */ #define V4L2_CTRL_CLASS_USER 0x00980000 /* Old-style 'user' controls */ #define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ @@ -531,6 +533,8 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type { }; #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER (V4L2_CID_MPEG_BASE+381) #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP (V4L2_CID_MPEG_BASE+382) +#define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION (V4L2_CID_MPEG_BASE+383) +#define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET (V4L2_CID_MPEG_BASE+384) #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400) #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401) #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 1a95662f5ad0..5e739270116d 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -128,6 +128,13 @@ enum v4l2_field { ((field) == V4L2_FIELD_BOTTOM ||\ (field) == V4L2_FIELD_TOP ||\ (field) == V4L2_FIELD_ALTERNATE) +#define V4L2_FIELD_IS_INTERLACED(field) \ + ((field) == V4L2_FIELD_INTERLACED ||\ + (field) == V4L2_FIELD_INTERLACED_TB ||\ + (field) == V4L2_FIELD_INTERLACED_BT) +#define V4L2_FIELD_IS_SEQUENTIAL(field) \ + ((field) == V4L2_FIELD_SEQ_TB ||\ + (field) == V4L2_FIELD_SEQ_BT) enum v4l2_buf_type { V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, @@ -143,6 +150,7 @@ enum v4l2_buf_type { V4L2_BUF_TYPE_SDR_CAPTURE = 11, V4L2_BUF_TYPE_SDR_OUTPUT = 12, V4L2_BUF_TYPE_META_CAPTURE = 13, + V4L2_BUF_TYPE_META_OUTPUT = 14, /* Deprecated, do not use */ V4L2_BUF_TYPE_PRIVATE = 0x80, }; @@ -158,7 +166,8 @@ enum v4l2_buf_type { || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT \ - || (type) == V4L2_BUF_TYPE_SDR_OUTPUT) + || (type) == V4L2_BUF_TYPE_SDR_OUTPUT \ + || (type) == V4L2_BUF_TYPE_META_OUTPUT) enum v4l2_tuner_type { V4L2_TUNER_RADIO = 1, @@ -223,8 +232,8 @@ enum v4l2_colorspace { /* For RGB colorspaces such as produces by most webcams. */ V4L2_COLORSPACE_SRGB = 8, - /* AdobeRGB colorspace */ - V4L2_COLORSPACE_ADOBERGB = 9, + /* opRGB colorspace */ + V4L2_COLORSPACE_OPRGB = 9, /* BT.2020 colorspace, used for UHDTV. */ V4L2_COLORSPACE_BT2020 = 10, @@ -256,7 +265,7 @@ enum v4l2_xfer_func { * * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB * - * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB + * V4L2_COLORSPACE_OPRGB: V4L2_XFER_FUNC_OPRGB * * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M * @@ -267,7 +276,7 @@ enum v4l2_xfer_func { V4L2_XFER_FUNC_DEFAULT = 0, V4L2_XFER_FUNC_709 = 1, V4L2_XFER_FUNC_SRGB = 2, - V4L2_XFER_FUNC_ADOBERGB = 3, + V4L2_XFER_FUNC_OPRGB = 3, V4L2_XFER_FUNC_SMPTE240M = 4, V4L2_XFER_FUNC_NONE = 5, V4L2_XFER_FUNC_DCI_P3 = 6, @@ -279,7 +288,7 @@ enum v4l2_xfer_func { * This depends on the colorspace. */ #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ - ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ + ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : \ ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \ ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ @@ -293,7 +302,7 @@ enum v4l2_ycbcr_encoding { * * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB, - * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 + * V4L2_COLORSPACE_OPRGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 * * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709 * @@ -378,6 +387,15 @@ enum v4l2_quantization { (((is_rgb_or_hsv) || (colsp) == V4L2_COLORSPACE_JPEG) ? \ V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) +/* + * Deprecated names for opRGB colorspace (IEC 61966-2-5) + * + * WARNING: Please don't use these deprecated defines in your code, as + * there is a chance we have to remove them in the future. + */ +#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB +#define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB + enum v4l2_priority { V4L2_PRIORITY_UNSET = 0, /* not initialized */ V4L2_PRIORITY_BACKGROUND = 1, @@ -454,6 +472,7 @@ struct v4l2_capability { #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ +#define V4L2_CAP_META_OUTPUT 0x08000000 /* Is a metadata output device */ #define V4L2_CAP_TOUCH 0x10000000 /* Is a touch device */ @@ -537,6 +556,10 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */ #define V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */ #define V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */ +#define V4L2_PIX_FMT_AYUV32 v4l2_fourcc('A', 'Y', 'U', 'V') /* 32 AYUV-8-8-8-8 */ +#define V4L2_PIX_FMT_XYUV32 v4l2_fourcc('X', 'Y', 'U', 'V') /* 32 XYUV-8-8-8-8 */ +#define V4L2_PIX_FMT_VUYA32 v4l2_fourcc('V', 'U', 'Y', 'A') /* 32 VUYA-8-8-8-8 */ +#define V4L2_PIX_FMT_VUYX32 v4l2_fourcc('V', 'U', 'Y', 'X') /* 32 VUYX-8-8-8-8 */ #define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ #define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ #define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */ @@ -631,6 +654,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */ #define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */ #define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */ +#define V4L2_PIX_FMT_MPEG2_SLICE v4l2_fourcc('M', 'G', '2', 'S') /* MPEG-2 parsed slice data */ #define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */ #define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */ #define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */ @@ -672,6 +696,8 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */ #define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */ #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */ +#define V4L2_PIX_FMT_SUNXI_TILED_NV12 v4l2_fourcc('S', 'T', '1', '2') /* Sunxi Tiled NV12 Format */ +#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit packed depth confidence information */ /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits unused */ #define V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */ @@ -699,6 +725,7 @@ struct v4l2_pix_format { #define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */ #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */ #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */ +#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */ /* priv field value to indicates that subsequent fields are valid. */ #define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe @@ -852,9 +879,17 @@ struct v4l2_requestbuffers { __u32 count; __u32 type; /* enum v4l2_buf_type */ __u32 memory; /* enum v4l2_memory */ - __u32 reserved[2]; + __u32 capabilities; + __u32 reserved[1]; }; +/* capabilities for struct v4l2_requestbuffers and v4l2_create_buffers */ +#define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) +#define V4L2_BUF_CAP_SUPPORTS_USERPTR (1 << 1) +#define V4L2_BUF_CAP_SUPPORTS_DMABUF (1 << 2) +#define V4L2_BUF_CAP_SUPPORTS_REQUESTS (1 << 3) +#define V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS (1 << 4) + /** * struct v4l2_plane - plane info for multi-planar buffers * @bytesused: number of bytes occupied by data in the plane (payload) @@ -913,6 +948,7 @@ struct v4l2_plane { * @length: size in bytes of the buffer (NOT its payload) for single-plane * buffers (when type != *_MPLANE); number of elements in the * planes array for multi-plane buffers + * @request_fd: fd of the request that this buffer should use * * Contains data exchanged by application and driver using one of the Streaming * I/O methods. @@ -937,9 +973,24 @@ struct v4l2_buffer { } m; __u32 length; __u32 reserved2; - __u32 reserved; + union { + __s32 request_fd; + __u32 reserved; + }; }; +/** + * v4l2_timeval_to_ns - Convert timeval to nanoseconds + * @ts: pointer to the timeval variable to be converted + * + * Returns the scalar nanosecond representation of the timeval + * parameter. + */ +static __inline__ __u64 v4l2_timeval_to_ns(const struct timeval *tv) +{ + return (__u64)tv->tv_sec * 1000000000ULL + tv->tv_usec * 1000; +} + /* Flags for 'flags' field */ /* Buffer is mapped (flag) */ #define V4L2_BUF_FLAG_MAPPED 0x00000001 @@ -955,6 +1006,8 @@ struct v4l2_buffer { #define V4L2_BUF_FLAG_BFRAME 0x00000020 /* Buffer is ready, but the data contained within is corrupted. */ #define V4L2_BUF_FLAG_ERROR 0x00000040 +/* Buffer is added to an unqueued request */ +#define V4L2_BUF_FLAG_IN_REQUEST 0x00000080 /* timecode field is valid */ #define V4L2_BUF_FLAG_TIMECODE 0x00000100 /* Buffer is prepared for queuing */ @@ -973,6 +1026,8 @@ struct v4l2_buffer { #define V4L2_BUF_FLAG_TSTAMP_SRC_SOE 0x00010000 /* mem2mem encoder/decoder */ #define V4L2_BUF_FLAG_LAST 0x00100000 +/* request_fd is valid */ +#define V4L2_BUF_FLAG_REQUEST_FD 0x00800000 /** * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor @@ -1396,6 +1451,13 @@ struct v4l2_bt_timings { * InfoFrame). */ #define V4L2_DV_FL_HAS_HDMI_VIC (1 << 8) +/* + * CEA-861 specific: only valid for video receivers. + * If set, then HW can detect the difference between regular FPS and + * 1000/1001 FPS. Note: This flag is only valid for HDMI VIC codes with + * the V4L2_DV_FL_CAN_REDUCE_FPS flag set. + */ +#define V4L2_DV_FL_CAN_DETECT_REDUCED_FPS (1 << 9) /* A few useful defines to calculate the total blanking and frame sizes */ #define V4L2_DV_BT_BLANKING_WIDTH(bt) \ @@ -1593,7 +1655,8 @@ struct v4l2_ext_controls { }; __u32 count; __u32 error_idx; - __u32 reserved[2]; + __s32 request_fd; + __u32 reserved[1]; struct v4l2_ext_control *controls; }; @@ -1604,6 +1667,7 @@ struct v4l2_ext_controls { #define V4L2_CTRL_MAX_DIMS (4) #define V4L2_CTRL_WHICH_CUR_VAL 0 #define V4L2_CTRL_WHICH_DEF_VAL 0x0f000000 +#define V4L2_CTRL_WHICH_REQUEST_VAL 0x0f010000 enum v4l2_ctrl_type { V4L2_CTRL_TYPE_INTEGER = 1, @@ -2294,6 +2358,7 @@ struct v4l2_dbg_chip_info { * return: number of created buffers * @memory: enum v4l2_memory; buffer memory type * @format: frame format, for which buffers are requested + * @capabilities: capabilities of this buffer type. * @reserved: future extensions */ struct v4l2_create_buffers { @@ -2301,7 +2366,8 @@ struct v4l2_create_buffers { __u32 count; __u32 memory; struct v4l2_format format; - __u32 reserved[8]; + __u32 capabilities; + __u32 reserved[7]; }; /*