From nobody Sun Sep 22 03:19:17 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D0C7C4332F for ; Mon, 11 Apr 2022 08:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343544AbiDKIEG (ORCPT ); Mon, 11 Apr 2022 04:04:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343526AbiDKID6 (ORCPT ); Mon, 11 Apr 2022 04:03:58 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC8C3DE8; Mon, 11 Apr 2022 01:01:44 -0700 (PDT) X-UUID: cbce46d03cda4f509c2a93359d02afd7-20220411 X-UUID: cbce46d03cda4f509c2a93359d02afd7-20220411 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 2070875496; Mon, 11 Apr 2022 16:01:35 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Apr 2022 16:01:34 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Apr 2022 16:01:34 +0800 From: James_Lin To: CC: Laurent Pinchart , Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , Ezequiel Garcia , Arnd Bergmann , Ricardo Ribalda , Ming Qian , Andrzej Pietrasiewicz , Sakari Ailus , , , , , , , , , James_Lin Subject: [PATCH v2 1/2] media: usb: uvc: Add H265 pixel format Date: Mon, 11 Apr 2022 16:01:19 +0800 Message-ID: <20220411080120.26008-2-Ping-lei.Lin@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220411080120.26008-1-Ping-lei.Lin@mediatek.com> References: <20220411080120.26008-1-Ping-lei.Lin@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add H265 pixel format. So driver can recognize external camera devices=20 whom use h265 to describe High Efficiency Video Coding method. Signed-off-by: James_Lin --- drivers/media/usb/uvc/uvc_driver.c | 5 +++++ drivers/media/usb/uvc/uvcvideo.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc= _driver.c index dda0f0aa78b8..ebb807c33e57 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -154,6 +154,11 @@ static struct uvc_format_desc uvc_fmts[] =3D { .guid =3D UVC_GUID_FORMAT_H264, .fcc =3D V4L2_PIX_FMT_H264, }, + { + .name =3D "H.265", + .guid =3D UVC_GUID_FORMAT_H265, + .fcc =3D V4L2_PIX_FMT_H265, + }, { .name =3D "Greyscale 8 L/R (Y8I)", .guid =3D UVC_GUID_FORMAT_Y8I, diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvi= deo.h index 143230b3275b..41f4d8c33f2a 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -139,6 +139,9 @@ #define UVC_GUID_FORMAT_H264 \ { 'H', '2', '6', '4', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} +#define UVC_GUID_FORMAT_H265 \ + { 'H', '2', '6', '5', 0x00, 0x00, 0x10, 0x00, \ + 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} #define UVC_GUID_FORMAT_Y8I \ { 'Y', '8', 'I', ' ', 0x00, 0x00, 0x10, 0x00, \ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} --=20 2.18.0 From nobody Sun Sep 22 03:19:17 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42C7CC433F5 for ; Mon, 11 Apr 2022 08:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343556AbiDKIEL (ORCPT ); Mon, 11 Apr 2022 04:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343503AbiDKIEB (ORCPT ); Mon, 11 Apr 2022 04:04:01 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E9F527CDA; Mon, 11 Apr 2022 01:01:46 -0700 (PDT) X-UUID: 4a2b0ca5b13a46c1a920e8599cd56a1a-20220411 X-UUID: 4a2b0ca5b13a46c1a920e8599cd56a1a-20220411 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1209623131; Mon, 11 Apr 2022 16:01:40 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 11 Apr 2022 16:01:39 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 11 Apr 2022 16:01:39 +0800 From: James_Lin To: CC: Laurent Pinchart , Mauro Carvalho Chehab , Matthias Brugger , Hans Verkuil , Ezequiel Garcia , Arnd Bergmann , Ricardo Ribalda , Ming Qian , Andrzej Pietrasiewicz , Sakari Ailus , , , , , , , , , James_Lin Subject: [PATCH v2 2/2] media: v4l: Add H265 pixel format Date: Mon, 11 Apr 2022 16:01:20 +0800 Message-ID: <20220411080120.26008-3-Ping-lei.Lin@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20220411080120.26008-1-Ping-lei.Lin@mediatek.com> References: <20220411080120.26008-1-Ping-lei.Lin@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add H265 pixel format. So driver can recognize external camera devices=20 whom use h265 to describe High Efficiency Video Coding method. Signed-off-by: James_Lin --- .../userspace-api/media/v4l/pixfmt-compressed.rst | 10 ++++++++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 12 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/= Documentation/userspace-api/media/v4l/pixfmt-compressed.rst index 967fc803ef94..75292aafe2eb 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -36,6 +36,16 @@ Compressed Formats - MPEG multiplexed stream. The actual format is determined by extended control ``V4L2_CID_MPEG_STREAM_TYPE``, see :ref:`mpeg-control-id`. + * .. _V4L2-PIX-FMT-H265: + + - ``V4L2_PIX_FMT_H265`` + - 'H265' + - H.265 Access Unit. + The decoder expects one Access Unit per buffer. + The encoder generates one Access Unit per buffer. + If :ref:`VIDIOC_ENUM_FMT` reports ``V4L2_FMT_FLAG_CONTINUOUS_BYTESTREAM`` + then the decoder has no requirements since it can parse all the + information from the raw bytestream. * .. _V4L2-PIX-FMT-H264: =20 - ``V4L2_PIX_FMT_H264`` diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index 96e307fe3aab..aeaeb29307a4 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1402,6 +1402,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_JPEG: descr =3D "JFIF JPEG"; break; case V4L2_PIX_FMT_DV: descr =3D "1394"; break; case V4L2_PIX_FMT_MPEG: descr =3D "MPEG-1/2/4"; break; + case V4L2_PIX_FMT_H265: descr =3D "H.265"; break; case V4L2_PIX_FMT_H264: descr =3D "H.264"; break; case V4L2_PIX_FMT_H264_NO_SC: descr =3D "H.264 (No Start Codes)"; break; case V4L2_PIX_FMT_H264_MVC: descr =3D "H.264 MVC"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 3768a0a80830..636e4236bfb8 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -691,6 +691,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG= */ #define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 = */ #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/= 4 Multiplexed */ +#define V4L2_PIX_FMT_H265 v4l2_fourcc('H', '2', '6', '5') /* H265 with= start codes */ #define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with= start codes */ #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 wi= thout start codes */ #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC = */ --=20 2.18.0