History

Merge tag 'media/v6.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab: - v4l2 core: - sub-device framework routing improvements - NV12M tiled variants added to v4l2_format_info - some fixes at control handler freeing logic - fixed H264 SEPARATE_COLOUR_PLANE check - new staging driver: Intel IPU7 PCI - Rockchip video decoder driver got promoted from staging - iris: added HEVC/VP9 encoder/decoder support - vsp1: driver has gained Renesas VSPX support - uvc: - switched to vb2 ioctl helpers - added MSXU 1.5 metadata support - atomisp: GC0310 sensor driver cleanups in preparation for moving it out of staging - Lots of cleanup, fixes and improvements * tag 'media/v6.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (310 commits) media: rkvdec: Unstage the driver media: rkvdec: Remove TODO file media: dt-bindings: rockchip: Add RK3576 Video Decoder bindings media: dt-bindings: rockchip: Document RK3588 Video Decoder bindings media: amphion: Support dmabuf and v4l2 buffer without binding media: verisilicon: postproc: 4K support media: v4l2: Add support for NV12M tiled variants to v4l2_format_info() media: uvcvideo: Use a count variable for meta_formats instead of 0 terminating media: uvcvideo: Auto-set UVC_QUIRK_MSXU_META media: uvcvideo: Introduce V4L2_META_FMT_UVC_MSXU_1_5 media: uvcvideo: Introduce dev->meta_formats media: Documentation: Add note about UVCH length field media: uvcvideo: Do not mark valid metadata as invalid media: uvcvideo: uvc_v4l2_unlocked_ioctl: Invert PM logic media: core: export v4l2_translate_cmd media: uvcvideo: Turn on the camera if V4L2_EVENT_SUB_FL_SEND_INITIAL media: uvcvideo: Remove stream->is_streaming field media: uvcvideo: Split uvc_stop_streaming() media: uvcvideo: Handle locks in uvc_queue_return_buffers media: uvcvideo: Use vb2 ioctl and fop helpers ...

Linus Torvalds committed 1 year ago

Commit 0cdee262 parents 2715260 d968e50314 files · +23131 −4600Browse files

Showing the changes to include/uapi/linux (4 of 314 files). Show all

Unified · Split

4 files
  1. include/uapi/linux/media/raspberrypi/pisp_be_config.h +5 −4
  2. include/uapi/linux/rkisp1-config.h +105 −1
  3. include/uapi/linux/v4l2-controls.h +6 −0
  4. include/uapi/linux/videodev2.h +8 −1
include/uapi/linux/media/raspberrypi/pisp_be_config.h+5−4
@@ -21,10 +21,11 @@ · 20 unmodified lines
2121 /* preferred byte alignment for outputs */
2222 #define PISP_BACK_END_OUTPUT_MAX_ALIGN 64u
2323
24−/* minimum allowed tile width anywhere in the pipeline */
25−#define PISP_BACK_END_MIN_TILE_WIDTH 16u
26−/* minimum allowed tile width anywhere in the pipeline */
27−#define PISP_BACK_END_MIN_TILE_HEIGHT 16u
24+/* minimum allowed tile sizes anywhere in the pipeline */
25+#define PISP_BACK_END_MIN_TILE_WIDTH 16u
26+#define PISP_BACK_END_MIN_TILE_HEIGHT 16u
27+#define PISP_BACK_END_MAX_TILE_WIDTH 65536u
28+#define PISP_BACK_END_MAX_TILE_HEIGHT 65536u
2829
2930 #define PISP_BACK_END_NUM_OUTPUTS 2
3031 #define PISP_BACK_END_HOG_OUTPUT 1
include/uapi/linux/rkisp1-config.h+105−1
@@ -169,6 +169,13 @@ · 168 unmodified lines
169169 */
170170 #define RKISP1_CIF_ISP_COMPAND_NUM_POINTS 64
171171
172+/*
173+ * Wide Dynamic Range
174+ */
175+#define RKISP1_CIF_ISP_WDR_CURVE_NUM_INTERV 32
176+#define RKISP1_CIF_ISP_WDR_CURVE_NUM_COEFF (RKISP1_CIF_ISP_WDR_CURVE_NUM_INTERV + 1)
177+#define RKISP1_CIF_ISP_WDR_CURVE_NUM_DY_REGS 4
178+
172179 /*
173180 * Measurement types
174181 */
@@ -889,6 +896,72 @@ struct rkisp1_cif_isp_compand_curve_config { · 714 unmodified lines
889896 __u32 y[RKISP1_CIF_ISP_COMPAND_NUM_POINTS];
890897 };
891898
899+/**
900+ * struct rkisp1_cif_isp_wdr_tone_curve - Tone mapping curve definition for WDR.
901+ *
902+ * @dY: the dYn increments for horizontal (input) axis of the tone curve.
903+ * each 3-bit dY value represents an increment of 2**(value+3).
904+ * dY[0] bits 0:2 is increment dY1, bit 3 unused
905+ * dY[0] bits 4:6 is increment dY2, bit 7 unused
906+ * ...
907+ * dY[0] bits 28:30 is increment dY8, bit 31 unused
908+ * ... and so on till dY[3] bits 28:30 is increment dY32, bit 31 unused.
909+ * @ym: the Ym values for the vertical (output) axis of the tone curve.
910+ * each value is 13 bit.
911+ */
912+struct rkisp1_cif_isp_wdr_tone_curve {
913+ __u32 dY[RKISP1_CIF_ISP_WDR_CURVE_NUM_DY_REGS];
914+ __u16 ym[RKISP1_CIF_ISP_WDR_CURVE_NUM_COEFF];
915+};
916+
917+/**
918+ * struct rkisp1_cif_isp_wdr_iref_config - Illumination reference config for WDR.
919+ *
920+ * Use illumination reference value as described below, instead of only the
921+ * luminance (Y) value for tone mapping and gain calculations:
922+ * IRef = (rgb_factor * RGBMax_tr + (8 - rgb_factor) * Y)/8
923+ *
924+ * @rgb_factor: defines how much influence the RGBmax approach has in
925+ * comparison to Y (valid values are 0..8).
926+ * @use_y9_8: use Y*9/8 for maximum value calculation along with the
927+ * default of R, G, B for noise reduction.
928+ * @use_rgb7_8: decrease RGBMax by 7/8 for noise reduction.
929+ * @disable_transient: disable transient calculation between Y and RGBY_max.
930+ */
931+struct rkisp1_cif_isp_wdr_iref_config {
932+ __u8 rgb_factor;
933+ __u8 use_y9_8;
934+ __u8 use_rgb7_8;
935+ __u8 disable_transient;
936+};
937+
938+/**
939+ * struct rkisp1_cif_isp_wdr_config - Configuration for wide dynamic range.
940+ *
941+ * @tone_curve: tone mapping curve.
942+ * @iref_config: illumination reference configuration. (when use_iref is true)
943+ * @rgb_offset: RGB offset value for RGB operation mode. (12 bits)
944+ * @luma_offset: luminance offset value for RGB operation mode. (12 bits)
945+ * @dmin_thresh: lower threshold for deltaMin value. (12 bits)
946+ * @dmin_strength: strength factor for deltaMin. (valid range is 0x00..0x10)
947+ * @use_rgb_colorspace: use RGB instead of luminance/chrominance colorspace.
948+ * @bypass_chroma_mapping: disable chrominance mapping (only valid if
949+ * use_rgb_colorspace = 0)
950+ * @use_iref: use illumination reference instead of Y for tone mapping
951+ * and gain calculations.
952+ */
953+struct rkisp1_cif_isp_wdr_config {
954+ struct rkisp1_cif_isp_wdr_tone_curve tone_curve;
955+ struct rkisp1_cif_isp_wdr_iref_config iref_config;
956+ __u16 rgb_offset;
957+ __u16 luma_offset;
958+ __u16 dmin_thresh;
959+ __u8 dmin_strength;
960+ __u8 use_rgb_colorspace;
961+ __u8 bypass_chroma_mapping;
962+ __u8 use_iref;
963+};
964+
892965 /*---------- PART2: Measurement Statistics ------------*/
893966
894967 /**
@@ -1059,6 +1132,7 @@ struct rkisp1_stat_buffer { · 164 unmodified lines
10591132 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS: BLS in the compand block
10601133 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND: Companding expand curve
10611134 * @RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS: Companding compress curve
1135+ * @RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR: Wide dynamic range
10621136 */
10631137 enum rkisp1_ext_params_block_type {
10641138 RKISP1_EXT_PARAMS_BLOCK_TYPE_BLS,
@@ -1081,11 +1155,15 @@ enum rkisp1_ext_params_block_type { · 16 unmodified lines
10811155 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_BLS,
10821156 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_EXPAND,
10831157 RKISP1_EXT_PARAMS_BLOCK_TYPE_COMPAND_COMPRESS,
1158+ RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR,
10841159 };
10851160
10861161 #define RKISP1_EXT_PARAMS_FL_BLOCK_DISABLE (1U << 0)
10871162 #define RKISP1_EXT_PARAMS_FL_BLOCK_ENABLE (1U << 1)
10881163
1164+/* A bitmask of parameters blocks supported on the current hardware. */
1165+#define RKISP1_CID_SUPPORTED_PARAMS_BLOCKS (V4L2_CID_USER_RKISP1_BASE + 0x01)
1166+
10891167 /**
10901168 * struct rkisp1_ext_params_block_header - RkISP1 extensible parameters block
10911169 * header
@@ -1460,6 +1538,23 @@ struct rkisp1_ext_params_compand_curve_config { · 368 unmodified lines
14601538 struct rkisp1_cif_isp_compand_curve_config config;
14611539 } __attribute__((aligned(8)));
14621540
1541+/**
1542+ * struct rkisp1_ext_params_wdr_config - RkISP1 extensible params
1543+ * Wide dynamic range config
1544+ *
1545+ * RkISP1 extensible parameters WDR block.
1546+ * Identified by :c:type:`RKISP1_EXT_PARAMS_BLOCK_TYPE_WDR`
1547+ *
1548+ * @header: The RkISP1 extensible parameters header, see
1549+ * :c:type:`rkisp1_ext_params_block_header`
1550+ * @config: WDR configuration, see
1551+ * :c:type:`rkisp1_cif_isp_wdr_config`
1552+ */
1553+struct rkisp1_ext_params_wdr_config {
1554+ struct rkisp1_ext_params_block_header header;
1555+ struct rkisp1_cif_isp_wdr_config config;
1556+} __attribute__((aligned(8)));
1557+
14631558 /*
14641559 * The rkisp1_ext_params_compand_curve_config structure is counted twice as it
14651560 * is used for both the COMPAND_EXPAND and COMPAND_COMPRESS block types.
@@ -1484,7 +1579,8 @@ struct rkisp1_ext_params_compand_curve_config { · 18 unmodified lines
14841579 sizeof(struct rkisp1_ext_params_afc_config) +\
14851580 sizeof(struct rkisp1_ext_params_compand_bls_config) +\
14861581 sizeof(struct rkisp1_ext_params_compand_curve_config) +\
1487− sizeof(struct rkisp1_ext_params_compand_curve_config))
1582+ sizeof(struct rkisp1_ext_params_compand_curve_config) +\
1583+ sizeof(struct rkisp1_ext_params_wdr_config))
14881584
14891585 /**
14901586 * enum rksip1_ext_param_buffer_version - RkISP1 extensible parameters version
@@ -1520,6 +1616,14 @@ enum rksip1_ext_param_buffer_version { · 29 unmodified lines
15201616 * V4L2 control. If such control is not available, userspace should assume only
15211617 * RKISP1_EXT_PARAM_BUFFER_V1 is supported by the driver.
15221618 *
1619+ * The read-only V4L2 control ``RKISP1_CID_SUPPORTED_PARAMS_BLOCKS`` can be used
1620+ * to query the blocks supported by the device. It contains a bitmask where each
1621+ * bit represents the availability of the corresponding entry from the
1622+ * :c:type:`rkisp1_ext_params_block_type` enum. The current and default values
1623+ * of the control represents the blocks supported by the device instance, while
1624+ * the maximum value represents the blocks supported by the kernel driver,
1625+ * independently of the device instance.
1626+ *
15231627 * For each ISP block that userspace wants to configure, a block-specific
15241628 * structure is appended to the @data buffer, one after the other without gaps
15251629 * in between nor overlaps. Userspace shall populate the @data_size field with
include/uapi/linux/v4l2-controls.h+6−0
@@ -222,6 +222,12 @@ enum v4l2_colorfx { · 221 unmodified lines
222222 */
223223 #define V4L2_CID_USER_UVC_BASE (V4L2_CID_USER_BASE + 0x11e0)
224224
225+/*
226+ * The base for Rockchip ISP1 driver controls.
227+ * We reserve 16 controls for this driver.
228+ */
229+#define V4L2_CID_USER_RKISP1_BASE (V4L2_CID_USER_BASE + 0x1220)
230+
225231 /* MPEG-class control IDs */
226232 /* The MPEG controls are applicable to all codec controls
227233 * and the 'MPEG' part of the define is historical */
include/uapi/linux/videodev2.h+8−1
@@ -726,7 +726,7 @@ struct v4l2_pix_format { · 725 unmodified lines
726726 #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
727727 #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
728728 #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
729− /* 12bit raw bayer packed, 6 bytes for every 4 pixels */
729+ /* 12bit raw bayer packed, 3 bytes for every 2 pixels */
730730 #define V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C')
731731 #define V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
732732 #define V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
@@ -840,6 +840,12 @@ struct v4l2_pix_format { · 107 unmodified lines
840840 #define V4L2_PIX_FMT_PISP_COMP2_BGGR v4l2_fourcc('P', 'C', '2', 'B') /* PiSP 8-bit mode 2 compressed BGGR bayer */
841841 #define V4L2_PIX_FMT_PISP_COMP2_MONO v4l2_fourcc('P', 'C', '2', 'M') /* PiSP 8-bit mode 2 compressed monochrome */
842842
843+/* Renesas RZ/V2H CRU packed formats. 64-bit units with contiguous pixels */
844+#define V4L2_PIX_FMT_RAW_CRU10 v4l2_fourcc('C', 'R', '1', '0')
845+#define V4L2_PIX_FMT_RAW_CRU12 v4l2_fourcc('C', 'R', '1', '2')
846+#define V4L2_PIX_FMT_RAW_CRU14 v4l2_fourcc('C', 'R', '1', '4')
847+#define V4L2_PIX_FMT_RAW_CRU20 v4l2_fourcc('C', 'R', '2', '0')
848+
843849 /* SDR formats - used only for Software Defined Radio devices */
844850 #define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
845851 #define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
@@ -861,6 +867,7 @@ struct v4l2_pix_format { · 15 unmodified lines
861867 #define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */
862868 #define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
863869 #define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */
870+#define V4L2_META_FMT_UVC_MSXU_1_5 v4l2_fourcc('U', 'V', 'C', 'M') /* UVC MSXU metadata */
864871 #define V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
865872
866873 /* Vendor specific - used for RK_ISP1 camera sub-system */