Patch Detail
Show a patch.
GET /api/patches/2239/?format=api
{ "id": 2239, "url": "https://patchwork.libcamera.org/api/patches/2239/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2239/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20191027234312.35284-2-jacopo@jmondi.org>", "date": "2019-10-27T23:43:03", "name": "[libcamera-devel,01/10] include: linux: Update headers to Linux v5.2", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "2b93f48b0e77b30225bcd9c98a853e49303c4d12", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2239/mbox/", "series": [ { "id": 559, "url": "https://patchwork.libcamera.org/api/series/559/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=559", "date": "2019-10-27T23:43:02", "name": "libcamera: Use DRM_FORMAT_* fourcc codes", "version": 1, "mbox": "https://patchwork.libcamera.org/series/559/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2239/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2239/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C2A996017C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Oct 2019 00:41:25 +0100 (CET)", "from uno.localdomain (143.121.2.93.rev.sfr.net [93.2.121.143])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 731DF20002;\n\tSun, 27 Oct 2019 23:41:25 +0000 (UTC)" ], "X-Originating-IP": "93.2.121.143", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 28 Oct 2019 00:43:03 +0100", "Message-Id": "<20191027234312.35284-2-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.23.0", "In-Reply-To": "<20191027234312.35284-1-jacopo@jmondi.org>", "References": "<20191027234312.35284-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 01/10] include: linux: Update headers to\n\tLinux v5.2", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Sun, 27 Oct 2019 23:41:26 -0000" }, "content": "Update headers to Linux v5.2. The Rockchip ISP1 formats that were added\nmanually in commit 97dce7a13fa3 (\"include: linux: Add rkisp1 kernel\nheader and format definitions\") are kept. Otherwise the headers come\nstraight from the upstream kernel.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/linux/media-bus-format.h | 4 +++-\n include/linux/media.h | 27 ++++++++++++++++-----------\n include/linux/v4l2-controls.h | 29 +++++++++++++++++++++++++++++\n include/linux/videodev2.h | 31 ++++++++++++++++++++++++++++---\n 4 files changed, 76 insertions(+), 15 deletions(-)", "diff": "diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h\nindex d6a5a3bfe6c4..16c1fa2d89a4 100644\n--- a/include/linux/media-bus-format.h\n+++ b/include/linux/media-bus-format.h\n@@ -34,7 +34,7 @@\n \n #define MEDIA_BUS_FMT_FIXED\t\t\t0x0001\n \n-/* RGB - next is\t0x101b */\n+/* RGB - next is\t0x101d */\n #define MEDIA_BUS_FMT_RGB444_1X12\t\t0x1016\n #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE\t0x1001\n #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE\t0x1002\n@@ -50,10 +50,12 @@\n #define MEDIA_BUS_FMT_RGB666_1X24_CPADHI\t0x1015\n #define MEDIA_BUS_FMT_RGB666_1X7X3_SPWG\t\t0x1010\n #define MEDIA_BUS_FMT_BGR888_1X24\t\t0x1013\n+#define MEDIA_BUS_FMT_BGR888_3X8\t\t0x101b\n #define MEDIA_BUS_FMT_GBR888_1X24\t\t0x1014\n #define MEDIA_BUS_FMT_RGB888_1X24\t\t0x100a\n #define MEDIA_BUS_FMT_RGB888_2X12_BE\t\t0x100b\n #define MEDIA_BUS_FMT_RGB888_2X12_LE\t\t0x100c\n+#define MEDIA_BUS_FMT_RGB888_3X8\t\t0x101c\n #define MEDIA_BUS_FMT_RGB888_1X7X4_SPWG\t\t0x1011\n #define MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA\t0x1012\n #define MEDIA_BUS_FMT_ARGB8888_1X32\t\t0x100d\ndiff --git a/include/linux/media.h b/include/linux/media.h\nindex 29cc82b89ff2..f4ba8ae3e410 100644\n--- a/include/linux/media.h\n+++ b/include/linux/media.h\n@@ -144,7 +144,7 @@ struct media_device_info {\n #define MEDIA_ENT_FL_CONNECTOR\t\t\t(1 << 1)\n \n /* OR with the entity id value to find the next entity */\n-#define MEDIA_ENT_ID_FLAG_NEXT\t\t\t(1 << 31)\n+#define MEDIA_ENT_ID_FLAG_NEXT\t\t\t(1U << 31)\n \n struct media_entity_desc {\n \t__u32 id;\n@@ -258,6 +258,11 @@ struct media_links_enum {\n #define MEDIA_INTF_T_V4L_SWRADIO\t\t(MEDIA_INTF_T_V4L_BASE + 4)\n #define MEDIA_INTF_T_V4L_TOUCH\t\t\t(MEDIA_INTF_T_V4L_BASE + 5)\n \n+#define MEDIA_INTF_T_ALSA_BASE\t\t\t0x00000300\n+#define MEDIA_INTF_T_ALSA_PCM_CAPTURE\t\t(MEDIA_INTF_T_ALSA_BASE)\n+#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK\t\t(MEDIA_INTF_T_ALSA_BASE + 1)\n+#define MEDIA_INTF_T_ALSA_CONTROL\t\t(MEDIA_INTF_T_ALSA_BASE + 2)\n+\n \n /*\n * MC next gen API definitions\n@@ -393,19 +398,19 @@ struct media_v2_topology {\n #define MEDIA_ENT_F_DTV_DECODER\t\t\tMEDIA_ENT_F_DV_DECODER\n \n /*\n- * There is still no ALSA support in the media controller. These\n+ * There is still no full ALSA support in the media controller. These\n * defines should not have been added and we leave them here only\n * in case some application tries to use these defines.\n+ *\n+ * The ALSA defines that are in use have been moved into __KERNEL__\n+ * scope. As support gets added to these interface types, they should\n+ * be moved into __KERNEL__ scope with the code that uses them.\n */\n-#define MEDIA_INTF_T_ALSA_BASE\t\t\t0x00000300\n-#define MEDIA_INTF_T_ALSA_PCM_CAPTURE\t\t(MEDIA_INTF_T_ALSA_BASE)\n-#define MEDIA_INTF_T_ALSA_PCM_PLAYBACK\t\t(MEDIA_INTF_T_ALSA_BASE + 1)\n-#define MEDIA_INTF_T_ALSA_CONTROL\t\t(MEDIA_INTF_T_ALSA_BASE + 2)\n-#define MEDIA_INTF_T_ALSA_COMPRESS\t\t(MEDIA_INTF_T_ALSA_BASE + 3)\n-#define MEDIA_INTF_T_ALSA_RAWMIDI\t\t(MEDIA_INTF_T_ALSA_BASE + 4)\n-#define MEDIA_INTF_T_ALSA_HWDEP\t\t\t(MEDIA_INTF_T_ALSA_BASE + 5)\n-#define MEDIA_INTF_T_ALSA_SEQUENCER\t\t(MEDIA_INTF_T_ALSA_BASE + 6)\n-#define MEDIA_INTF_T_ALSA_TIMER\t\t\t(MEDIA_INTF_T_ALSA_BASE + 7)\n+#define MEDIA_INTF_T_ALSA_COMPRESS (MEDIA_INTF_T_ALSA_BASE + 3)\n+#define MEDIA_INTF_T_ALSA_RAWMIDI (MEDIA_INTF_T_ALSA_BASE + 4)\n+#define MEDIA_INTF_T_ALSA_HWDEP (MEDIA_INTF_T_ALSA_BASE + 5)\n+#define MEDIA_INTF_T_ALSA_SEQUENCER (MEDIA_INTF_T_ALSA_BASE + 6)\n+#define MEDIA_INTF_T_ALSA_TIMER (MEDIA_INTF_T_ALSA_BASE + 7)\n \n /* Obsolete symbol for media_version, no longer used in the kernel */\n #define MEDIA_API_VERSION\t\t\t((0 << 16) | (1 << 8) | 0)\ndiff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h\nindex 06479f2fb3ae..ef2ee5b796b4 100644\n--- a/include/linux/v4l2-controls.h\n+++ b/include/linux/v4l2-controls.h\n@@ -392,6 +392,9 @@ enum v4l2_mpeg_video_header_mode {\n #define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE\t\t(V4L2_CID_MPEG_BASE+221)\n enum v4l2_mpeg_video_multi_slice_mode {\n \tV4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE\t\t= 0,\n+\tV4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_MB\t\t= 1,\n+\tV4L2_MPEG_VIDEO_MULTI_SLICE_MODE_MAX_BYTES\t= 2,\n+\t/* Kept for backwards compatibility reasons. Stupid typo... */\n \tV4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB\t\t= 1,\n \tV4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES\t= 2,\n };\n@@ -404,6 +407,28 @@ enum v4l2_mpeg_video_multi_slice_mode {\n #define V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE\t\t(V4L2_CID_MPEG_BASE+228)\n #define V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME\t\t(V4L2_CID_MPEG_BASE+229)\n \n+/* CIDs for the MPEG-2 Part 2 (H.262) codec */\n+#define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL\t\t\t(V4L2_CID_MPEG_BASE+270)\n+enum v4l2_mpeg_video_mpeg2_level {\n+\tV4L2_MPEG_VIDEO_MPEG2_LEVEL_LOW\t\t= 0,\n+\tV4L2_MPEG_VIDEO_MPEG2_LEVEL_MAIN\t= 1,\n+\tV4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH_1440\t= 2,\n+\tV4L2_MPEG_VIDEO_MPEG2_LEVEL_HIGH\t= 3,\n+};\n+#define V4L2_CID_MPEG_VIDEO_MPEG2_PROFILE\t\t(V4L2_CID_MPEG_BASE+271)\n+enum v4l2_mpeg_video_mpeg2_profile {\n+\tV4L2_MPEG_VIDEO_MPEG2_PROFILE_SIMPLE\t\t\t\t= 0,\n+\tV4L2_MPEG_VIDEO_MPEG2_PROFILE_MAIN\t\t\t\t= 1,\n+\tV4L2_MPEG_VIDEO_MPEG2_PROFILE_SNR_SCALABLE\t\t\t= 2,\n+\tV4L2_MPEG_VIDEO_MPEG2_PROFILE_SPATIALLY_SCALABLE\t\t= 3,\n+\tV4L2_MPEG_VIDEO_MPEG2_PROFILE_HIGH\t\t\t\t= 4,\n+\tV4L2_MPEG_VIDEO_MPEG2_PROFILE_MULTIVIEW\t\t\t\t= 5,\n+};\n+\n+/* CIDs for the FWHT codec as used by the vicodec driver. */\n+#define V4L2_CID_FWHT_I_FRAME_QP (V4L2_CID_MPEG_BASE + 290)\n+#define V4L2_CID_FWHT_P_FRAME_QP (V4L2_CID_MPEG_BASE + 291)\n+\n #define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP\t\t(V4L2_CID_MPEG_BASE+300)\n #define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP\t\t(V4L2_CID_MPEG_BASE+301)\n #define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP\t\t(V4L2_CID_MPEG_BASE+302)\n@@ -535,6 +560,10 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type {\n #define V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_LAYER_QP\t(V4L2_CID_MPEG_BASE+382)\n #define V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION\t(V4L2_CID_MPEG_BASE+383)\n #define V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET\t\t(V4L2_CID_MPEG_BASE+384)\n+#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP\t(V4L2_CID_MPEG_BASE+385)\n+#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MAX_QP\t(V4L2_CID_MPEG_BASE+386)\n+#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP\t(V4L2_CID_MPEG_BASE+387)\n+#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MAX_QP\t(V4L2_CID_MPEG_BASE+388)\n #define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP\t(V4L2_CID_MPEG_BASE+400)\n #define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP\t(V4L2_CID_MPEG_BASE+401)\n #define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP\t(V4L2_CID_MPEG_BASE+402)\ndiff --git a/include/linux/videodev2.h b/include/linux/videodev2.h\nindex 94304bfeb4b6..ab40b3272ed2 100644\n--- a/include/linux/videodev2.h\n+++ b/include/linux/videodev2.h\n@@ -78,7 +78,7 @@\n /* Four-character-code (FOURCC) */\n #define v4l2_fourcc(a, b, c, d)\\\n \t((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))\n-#define v4l2_fourcc_be(a, b, c, d)\t(v4l2_fourcc(a, b, c, d) | (1 << 31))\n+#define v4l2_fourcc_be(a, b, c, d)\t(v4l2_fourcc(a, b, c, d) | (1U << 31))\n \n /*\n *\tE N U M S\n@@ -508,9 +508,27 @@ struct v4l2_pix_format {\n #define V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */\n #define V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2') /* 16 aaaarrrr ggggbbbb */\n #define V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2') /* 16 xxxxrrrr ggggbbbb */\n+#define V4L2_PIX_FMT_RGBA444 v4l2_fourcc('R', 'A', '1', '2') /* 16 rrrrgggg bbbbaaaa */\n+#define V4L2_PIX_FMT_RGBX444 v4l2_fourcc('R', 'X', '1', '2') /* 16 rrrrgggg bbbbxxxx */\n+#define V4L2_PIX_FMT_ABGR444 v4l2_fourcc('A', 'B', '1', '2') /* 16 aaaabbbb ggggrrrr */\n+#define V4L2_PIX_FMT_XBGR444 v4l2_fourcc('X', 'B', '1', '2') /* 16 xxxxbbbb ggggrrrr */\n+\n+/*\n+ * Originally this had 'BA12' as fourcc, but this clashed with the older\n+ * V4L2_PIX_FMT_SGRBG12 which inexplicably used that same fourcc.\n+ * So use 'GA12' instead for V4L2_PIX_FMT_BGRA444.\n+ */\n+#define V4L2_PIX_FMT_BGRA444 v4l2_fourcc('G', 'A', '1', '2') /* 16 bbbbgggg rrrraaaa */\n+#define V4L2_PIX_FMT_BGRX444 v4l2_fourcc('B', 'X', '1', '2') /* 16 bbbbgggg rrrrxxxx */\n #define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */\n #define V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16 ARGB-1-5-5-5 */\n #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */\n+#define V4L2_PIX_FMT_RGBA555 v4l2_fourcc('R', 'A', '1', '5') /* 16 RGBA-5-5-5-1 */\n+#define V4L2_PIX_FMT_RGBX555 v4l2_fourcc('R', 'X', '1', '5') /* 16 RGBX-5-5-5-1 */\n+#define V4L2_PIX_FMT_ABGR555 v4l2_fourcc('A', 'B', '1', '5') /* 16 ABGR-1-5-5-5 */\n+#define V4L2_PIX_FMT_XBGR555 v4l2_fourcc('X', 'B', '1', '5') /* 16 XBGR-1-5-5-5 */\n+#define V4L2_PIX_FMT_BGRA555 v4l2_fourcc('B', 'A', '1', '5') /* 16 BGRA-5-5-5-1 */\n+#define V4L2_PIX_FMT_BGRX555 v4l2_fourcc('B', 'X', '1', '5') /* 16 BGRX-5-5-5-1 */\n #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */\n #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */\n #define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16 ARGB-5-5-5 BE */\n@@ -522,7 +540,11 @@ struct v4l2_pix_format {\n #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */\n #define V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4') /* 32 BGRA-8-8-8-8 */\n #define V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4') /* 32 BGRX-8-8-8-8 */\n+#define V4L2_PIX_FMT_BGRA32 v4l2_fourcc('R', 'A', '2', '4') /* 32 ABGR-8-8-8-8 */\n+#define V4L2_PIX_FMT_BGRX32 v4l2_fourcc('R', 'X', '2', '4') /* 32 XBGR-8-8-8-8 */\n #define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */\n+#define V4L2_PIX_FMT_RGBA32 v4l2_fourcc('A', 'B', '2', '4') /* 32 RGBA-8-8-8-8 */\n+#define V4L2_PIX_FMT_RGBX32 v4l2_fourcc('X', 'B', '2', '4') /* 32 RGBX-8-8-8-8 */\n #define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */\n #define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */\n \n@@ -663,6 +685,7 @@ struct v4l2_pix_format {\n #define V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */\n #define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C') /* HEVC aka H.265 */\n #define V4L2_PIX_FMT_FWHT v4l2_fourcc('F', 'W', 'H', 'T') /* Fast Walsh Hadamard Transform (vicodec) */\n+#define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */\n \n /* Vendor-specific formats */\n #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */\n@@ -749,8 +772,10 @@ struct v4l2_fmtdesc {\n \t__u32\t\t reserved[4];\n };\n \n-#define V4L2_FMT_FLAG_COMPRESSED 0x0001\n-#define V4L2_FMT_FLAG_EMULATED 0x0002\n+#define V4L2_FMT_FLAG_COMPRESSED\t\t0x0001\n+#define V4L2_FMT_FLAG_EMULATED\t\t\t0x0002\n+#define V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM\t0x0004\n+#define V4L2_FMT_FLAG_DYN_RESOLUTION\t\t0x0008\n \n \t/* Frame Size and frame rate enumeration */\n /*\n", "prefixes": [ "libcamera-devel", "01/10" ] }