From patchwork Wed Jul 24 11:05:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056579 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9A5314DB for ; Wed, 24 Jul 2019 11:05:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABD3B28741 for ; Wed, 24 Jul 2019 11:05:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BD0B2874F; Wed, 24 Jul 2019 11:05:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 456372875A for ; Wed, 24 Jul 2019 11:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727381AbfGXLFc (ORCPT ); Wed, 24 Jul 2019 07:05:32 -0400 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:50873 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfGXLFb (ORCPT ); Wed, 24 Jul 2019 07:05:31 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qF5Hh3g5kLqASqF5NhNDzF; Wed, 24 Jul 2019 13:05:29 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Maxime Jourdan , Tomasz Figa , Stanimir Varbanov , Sylwester Nawrocki , Alexandre Courbot , Maxime Ripard , Nicolas Dufresne , Paul Kocialkowski , Ezequiel Garcia , Boris Brezillon , Philipp Zabel , Hans Verkuil Subject: [PATCH 01/14] v4l2-ioctl.c: OR flags in v4l_fill_fmtdesc(), not don't overwrite Date: Wed, 24 Jul 2019 13:05:10 +0200 Message-Id: <20190724110523.29248-2-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> References: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfHTcspy1VwrGjmYaMDxR3AkHmgn15EpEQjJ1j2p9LkdB2nm4eYTMHFDYl6OB/gC5Bk4jfET5vEgS9mrUPR85F+qerV6BMmjM42wJDeBre/x5atvuPnk5 2ouyYkAHMtDVlcQhzVry9/Hohr29so5AR0hMEuRaMLzmpBRCdrZOl3J+ra78vjSN7zcvPBmEFq1hRAEv5iVeMh+1n/bT/0Kfgr6jw/rwViBuFPO+1HyNNNz/ jdD/M0/h7MnZuj4kFsJi39k5Fsw5MT7uQHDyRpk7oUHNmXpuc/A+Y9/2uOhzDMeyd7Q2VC2GdRIaAdTlVXQtk0CAIO4mcfID3GU5D/tMyo7RXM2Xr3Gw/D63 C4/64EJdTFL/SfrOVyzcxlvkZpECmtJB2sReLv97XJbWeUThtLFud+IFoRNxC8btgkiCWL/F3hRH51g3KKMvjFdKHzI+3rP3wg8UB00fcaV3C9u4wJUfadvt /v9n9Ni1UmrgNG9Cc77t5mcTeDSpaRO0vETMiOvypCg7ozv8tb2N2C5d3fMHfsDVa4JbbPitLC4ML8XeWqNPaThj9rwEMOcXkGXjFbf8rrYlQJWTR+ikUEdt g+4112MNLhMoWidNnjgOTpmJMcsH9mzpW3K0pcoDXf8M5g== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a driver sets a FMT flag in the enum_fmt op, then that will be ignored since v4l_fill_fmtdesc() overwrites it again. v4l_fill_fmtdesc() should OR its flag, not overwrite it. Signed-off-by: Hans Verkuil Reviewed-by: Philipp Zabel --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 80efc581e3f9..911a20f915c5 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1390,7 +1390,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) if (descr) WARN_ON(strscpy(fmt->description, descr, sz) < 0); - fmt->flags = flags; + fmt->flags |= flags; } static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops, From patchwork Wed Jul 24 11:05:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 485FD1398 for ; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35E602874F for ; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29A8928759; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB5BE2874F for ; Wed, 24 Jul 2019 11:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727389AbfGXLFc (ORCPT ); Wed, 24 Jul 2019 07:05:32 -0400 Received: from lb2-smtp-cloud7.xs4all.net ([194.109.24.28]:56811 "EHLO lb2-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727310AbfGXLFc (ORCPT ); Wed, 24 Jul 2019 07:05:32 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qF5Hh3g5kLqASqF5NhNDzh; Wed, 24 Jul 2019 13:05:30 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Maxime Jourdan , Tomasz Figa , Stanimir Varbanov , Sylwester Nawrocki , Alexandre Courbot , Maxime Ripard , Nicolas Dufresne , Paul Kocialkowski , Ezequiel Garcia , Boris Brezillon , Philipp Zabel , Hans Verkuil Subject: [PATCH 02/14] videodev2.h: add V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER Date: Wed, 24 Jul 2019 13:05:11 +0200 Message-Id: <20190724110523.29248-3-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> References: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKK1bz65v8QueZwMlzquKJfumy4WCUUFEUgJZ4gr9TzDNsvog+mxXtw8q5ruTZoAkDsjE8Z5dMlZ/A+b+bWmG/BgBdhEi+0Vp7wusSCup3HH+Jrxhkxp KsPFVyjK/CpLrrg1hF9AttpuX9iqzlQGJc6HR5pUCb1dnbT7CAkzHRAZ8lG/xjmCLVxuD+1UMg5z4/Tl+8hCMLVwhn5RlOw+M3J5277sxrIm2VYmzyhbK0rs VivZ7nJJKJQd+9DTunWhR/3XQTlkteBP0pAaR2cJnGg+TMjGAtNUQlLkrIW+MuHdMSc8Z0GMOhibrQHi4/lcJLbabcHM3q+QBiSPiJDs3Wwq5u/BX1+6UJR9 NWyal8RWkQnnvRFxfF0/uSS1wbKMpW0lvLbMp+OkjSmJLsxLysnEs4tbMW5X97Njhs6lGRTbNVszdnoA68Hi6uNHE2EF8yx6z/Q9K6WFte3BSS5cAa7/7EQY 8wD2HTomWaoLFKuT+O+ORTDdA3Gkd/DW2yFJelarDnI5RLvfc87jxRGnTM073bHEClcXcwGFSFqCPbQKcboCelcmCxG/9CPLJHoTFxpCVw3NoYuE5Nz+fGr4 RPZJBqGGnSXD5FKna3yglFJ5HvuN1lBPrHFiIIlkUbwJDg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an enum_fmt format flag to specifically tag coded formats where full bitstream parsing is supported by the device. Some stateful decoders are capable of fully parsing a bitstream, but others require that userspace pre-parses the bitstream into frames or fields (see the corresponding pixelformat descriptions for details). If this flag is set, then this pre-parsing step is not required (but still possible, of course). Signed-off-by: Hans Verkuil --- Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 8 ++++++++ Documentation/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux/videodev2.h | 5 +++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst index 822d6730e7d2..4e24e671f32e 100644 --- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst +++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst @@ -127,6 +127,14 @@ one until ``EINVAL`` is returned. - This format is not native to the device but emulated through software (usually libv4l2), where possible try to use a native format instead for better performance. + * - ``V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER`` + - 0x0004 + - The hardware decoder for this compressed bitstream format (aka coded + format) is capable of parsing the bitstream. Applications do not + need to parse the bitstream themselves to find the boundaries between + frames/fields. This flag can only be used in combination with the + ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to compressed + formats only. Return Value diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions index 55cbe324b9fc..74fb9f00c12d 100644 --- a/Documentation/media/videodev2.h.rst.exceptions +++ b/Documentation/media/videodev2.h.rst.exceptions @@ -180,6 +180,7 @@ replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats # V4L2 format flags replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags +replace define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER fmtdesc-flags # V4L2 tymecode types replace define V4L2_TC_TYPE_24FPS timecode-type diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 2427bc4d8eba..8c5a28666b16 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -774,8 +774,9 @@ struct v4l2_fmtdesc { __u32 reserved[4]; }; -#define V4L2_FMT_FLAG_COMPRESSED 0x0001 -#define V4L2_FMT_FLAG_EMULATED 0x0002 +#define V4L2_FMT_FLAG_COMPRESSED 0x0001 +#define V4L2_FMT_FLAG_EMULATED 0x0002 +#define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER 0x0004 /* Frame Size and frame rate enumeration */ /* From patchwork Wed Jul 24 11:05:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF6FE13A0 for ; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCF8D28751 for ; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0ECB28759; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F6AF2874F for ; Wed, 24 Jul 2019 11:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727390AbfGXLFd (ORCPT ); Wed, 24 Jul 2019 07:05:33 -0400 Received: from lb2-smtp-cloud7.xs4all.net ([194.109.24.28]:59075 "EHLO lb2-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727345AbfGXLFc (ORCPT ); Wed, 24 Jul 2019 07:05:32 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qF5Hh3g5kLqASqF5OhNE0R; Wed, 24 Jul 2019 13:05:30 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Maxime Jourdan , Tomasz Figa , Stanimir Varbanov , Sylwester Nawrocki , Alexandre Courbot , Maxime Ripard , Nicolas Dufresne , Paul Kocialkowski , Ezequiel Garcia , Boris Brezillon , Philipp Zabel , Hans Verkuil Subject: [PATCH 03/14] videodev2.h: add V4L2_FMT_FLAG_DYN_RESOLUTION Date: Wed, 24 Jul 2019 13:05:12 +0200 Message-Id: <20190724110523.29248-4-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> References: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfKK1bz65v8QueZwMlzquKJfumy4WCUUFEUgJZ4gr9TzDNsvog+mxXtw8q5ruTZoAkDsjE8Z5dMlZ/A+b+bWmG/BgBdhEi+0Vp7wusSCup3HH+Jrxhkxp KsPFVyjK/CpLrrg1hF9AttpuX9iqzlQGJc6HR5pUCb1dnbT7CAkzHRAZ8lG/xjmCLVxuD+1UMg5z4/Tl+8hCMLVwhn5RlOw+M3J5277sxrIm2VYmzyhbK0rs VivZ7nJJKJQd+9DTunWhR/3XQTlkteBP0pAaR2cJnGg+TMjGAtNUQlLkrIW+MuHdMSc8Z0GMOhibrQHi4/lcJLbabcHM3q+QBiSPiJDs3Wwq5u/BX1+6UJR9 NWyal8RWkQnnvRFxfF0/uSS1wbKMpW0lvLbMp+OkjSmJLsxLysnEs4tbMW5X97Njhs6lGRTbNVszdnoA68Hi6uNHE2EF8yx6z/Q9K6WFte3BSS5cAa7/7EQY 8wD2HTomWaoLFKuT+O+ORTDdA3Gkd/DW2yFJelarDnI5RLvfc87jxRGnTM073bHEClcXcwGFSFqCPbQKcboCelcmCxG/9CPLJHoTFxpCVw3NoYuE5Nz+fGr4 RPZJBqGGnSXD5FKna3yglFJ5HvuN1lBPrHFiIIlkUbwJDg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maxime Jourdan Add an enum_fmt format flag to specifically tag coded formats where dynamic resolution switching is supported by the device. This is useful for some codec drivers that can support dynamic resolution switching for one or more of their listed coded formats. It allows userspace to know whether it should extract the video parameters itself, or if it can rely on the device to send V4L2_EVENT_SOURCE_CHANGE when such changes are detected. Signed-off-by: Maxime Jourdan Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: added flag to videodev2.h.rst.exceptions] [hverkuil-cisco@xs4all.nl: updated commit text: 'one or more' instead of 'all'] Acked-by: Tomasz Figa --- Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 8 ++++++++ Documentation/media/videodev2.h.rst.exceptions | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 10 insertions(+) diff --git a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst index 4e24e671f32e..05454780cb21 100644 --- a/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst +++ b/Documentation/media/uapi/v4l/vidioc-enum-fmt.rst @@ -135,6 +135,14 @@ one until ``EINVAL`` is returned. frames/fields. This flag can only be used in combination with the ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to compressed formats only. + * - ``V4L2_FMT_FLAG_DYN_RESOLUTION`` + - 0x0008 + - Dynamic resolution switching is supported by the device for this + compressed bitstream format (aka coded format). It will notify the user + via the event ``V4L2_EVENT_SOURCE_CHANGE`` when changes in the video + parameters are detected. This flag can only be used in combination + with the ``V4L2_FMT_FLAG_COMPRESSED`` flag, since this applies to + compressed formats only. Return Value diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions index 74fb9f00c12d..0a9a1b386443 100644 --- a/Documentation/media/videodev2.h.rst.exceptions +++ b/Documentation/media/videodev2.h.rst.exceptions @@ -181,6 +181,7 @@ replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags replace define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER fmtdesc-flags +replace define V4L2_FMT_FLAG_DYN_RESOLUTION fmtdesc-flags # V4L2 tymecode types replace define V4L2_TC_TYPE_24FPS timecode-type diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 8c5a28666b16..ed572b05bd25 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -777,6 +777,7 @@ struct v4l2_fmtdesc { #define V4L2_FMT_FLAG_COMPRESSED 0x0001 #define V4L2_FMT_FLAG_EMULATED 0x0002 #define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER 0x0004 +#define V4L2_FMT_FLAG_DYN_RESOLUTION 0x0008 /* Frame Size and frame rate enumeration */ /* From patchwork Wed Jul 24 11:05:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056587 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC87714DB for ; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBB1C28745 for ; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF51428668; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F7B828751 for ; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbfGXLFf (ORCPT ); Wed, 24 Jul 2019 07:05:35 -0400 Received: from lb1-smtp-cloud7.xs4all.net ([194.109.24.24]:38053 "EHLO lb1-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfGXLFd (ORCPT ); Wed, 24 Jul 2019 07:05:33 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qF5Hh3g5kLqASqF5PhNE12; Wed, 24 Jul 2019 13:05:31 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Maxime Jourdan , Tomasz Figa , Stanimir Varbanov , Sylwester Nawrocki , Alexandre Courbot , Maxime Ripard , Nicolas Dufresne , Paul Kocialkowski , Ezequiel Garcia , Boris Brezillon , Philipp Zabel , Hans Verkuil Subject: [PATCH 04/14] videodev2.h.rst.exceptions: tymecode -> timecode Date: Wed, 24 Jul 2019 13:05:13 +0200 Message-Id: <20190724110523.29248-5-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> References: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfDWNqzozb7735fkXzFIeUf2gXRZ4mwIu3+HpjdRxnIgHHeTN7TK+uGlzxWe2baeL5wNlQJey/1HLsJb9hMfd4iCtiUehuy5btcaLmdzmRld/R1CMLCtX ElomWhoZ7YtP3NJODJpVAXSo/0QqtAGsH+i8wH+3XMQ7aig+GE4+LM6dR8tCX+Q7k9a4xVNAXhHS92eqnu+Gx5tp/2XEd7yzpnc+OV4nXJZT2cJ43JU28CeX IFM2sHN1wbfuiIK3szk/JlX16pmsgXEVVCdSnMgtOM9DR6mjx7wFTkr5kmLPc7W5SJcpCRrQ7rHiSRMEJyju55vR1cZruWYYJB+HB7z8tOEzj2bq8vKlffnR 0k63f34YzhWHVtKMtsFJ1ctCEKBfvG+083N+ukwXnU8X4VtLofw543fytta0LzJgDQV83lahHP8nogjPkm2Vfk2vFHLA1WP9g6G+8nGyjV91W4yPioY14fEV BA3C65zptOaLYxo6//5diW4K/8hNpLJpjOcS++gz8CI8K3E9z1xQyI+3B1z7RaoLF0KG7gMTcuj+ZVKaEN5cwpg8ROBzZt+eMdwRU30wm7ZLVdmZjyI1lPbM 5RaaLuxTfOzQgR9kjTG+nzoFmGMhPtMRM0hU1h/WGdGeUA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix typo. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski --- Documentation/media/videodev2.h.rst.exceptions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions index 0a9a1b386443..b6cb9fa6c8a8 100644 --- a/Documentation/media/videodev2.h.rst.exceptions +++ b/Documentation/media/videodev2.h.rst.exceptions @@ -183,14 +183,14 @@ replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags replace define V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER fmtdesc-flags replace define V4L2_FMT_FLAG_DYN_RESOLUTION fmtdesc-flags -# V4L2 tymecode types +# V4L2 timecode types replace define V4L2_TC_TYPE_24FPS timecode-type replace define V4L2_TC_TYPE_25FPS timecode-type replace define V4L2_TC_TYPE_30FPS timecode-type replace define V4L2_TC_TYPE_50FPS timecode-type replace define V4L2_TC_TYPE_60FPS timecode-type -# V4L2 tymecode flags +# V4L2 timecode flags replace define V4L2_TC_FLAG_DROPFRAME timecode-flags replace define V4L2_TC_FLAG_COLORFRAME timecode-flags replace define V4L2_TC_USERBITS_field timecode-flags From patchwork Wed Jul 24 11:05:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FAA31398 for ; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FA552860C for ; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6328B28735; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2FAC285BA for ; Wed, 24 Jul 2019 11:05:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727391AbfGXLFe (ORCPT ); Wed, 24 Jul 2019 07:05:34 -0400 Received: from lb2-smtp-cloud7.xs4all.net ([194.109.24.28]:58897 "EHLO lb2-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbfGXLFd (ORCPT ); Wed, 24 Jul 2019 07:05:33 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qF5Hh3g5kLqASqF5PhNE1d; Wed, 24 Jul 2019 13:05:32 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Maxime Jourdan , Tomasz Figa , Stanimir Varbanov , Sylwester Nawrocki , Alexandre Courbot , Maxime Ripard , Nicolas Dufresne , Paul Kocialkowski , Ezequiel Garcia , Boris Brezillon , Philipp Zabel , Hans Verkuil Subject: [PATCH 05/14] media: venus: vdec: flag OUTPUT formats with V4L2_FMT_FLAG_DYN_RESOLUTION Date: Wed, 24 Jul 2019 13:05:14 +0200 Message-Id: <20190724110523.29248-6-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> References: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfMSf2wi/tLWAmyGQbqJEWh5+CNk3LG2ra76h3lUlnAPi8B4gotiYKVSLShy9Bl6l1/mq73ju6ftt2MlWk4NasrQp9ww1T8eZkZ1rU8m9z+LpwXBFVQxT Yb2n7a+115bDdBn77i5dzVetXJPM8Qzk8Rsda2XSInh8VPklMZw5rTukdyciThQFDxb4gKK5chqPGqQ6Fi//wn+c9Q+MUqANVrW7/k3mZzAsN5fFWUOh+HBf bcDQ9LB47QjvsA+nc+JBrlfrHmmIR3DTNrrJKXk2OLIHOdfn/9Ax6clhfi1ZLXSd0uZeRob57h2QLbgLz1VxMEI+gI5KeZ1WrY6XMXP/E1BS0koI1V5nyO40 vf/ChgaRVDH0hUh1zT1rJVXFpI7En2hZiYqMkRqBDbvkUumana8LlM8KfmijD1AhEJCPLlB8vRxnudBHIr66Wuc91aEAzGwU00/SejrTAPuXtdTNnHDHEaZz 9VeS0qnVzVShLOYpPZXnRYzwGA7hia0s30QGgVWxyuHU51n3flLaHi9E3hH1FP3paADfEeYui9jaVMTzv/jZkbu+4y0RK9+341tLpIgCQ0l6M1IuVMfF+EVW OyBlkAuIfZwx6i9weA41XMG5b0QBbtkdycsCtmOXHFmjBg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maxime Jourdan Tag all the coded formats where the venus vdec supports dynamic resolution switching. Signed-off-by: Maxime Jourdan Signed-off-by: Hans Verkuil --- drivers/media/platform/qcom/venus/core.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 9ab95fd57760..6c243309df4b 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -46,6 +46,7 @@ struct venus_format { u32 pixfmt; unsigned int num_planes; u32 type; + u32 flags; }; #define MAX_PLANES 4 diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index e1f998656c07..380e8d1682e2 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -37,42 +37,52 @@ static const struct venus_format vdec_formats[] = { .pixfmt = V4L2_PIX_FMT_MPEG4, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_MPEG2, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_H263, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_VC1_ANNEX_G, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_VC1_ANNEX_L, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_H264, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_VP8, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_VP9, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_XVID, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .pixfmt = V4L2_PIX_FMT_HEVC, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, }; @@ -351,6 +361,7 @@ static int vdec_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f) return -EINVAL; f->pixelformat = fmt->pixfmt; + f->flags = fmt->flags; return 0; } From patchwork Wed Jul 24 11:05:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11056589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CC3713A0 for ; Wed, 24 Jul 2019 11:05:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58E9A26222 for ; Wed, 24 Jul 2019 11:05:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D64128741; Wed, 24 Jul 2019 11:05:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6C76285BA for ; Wed, 24 Jul 2019 11:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727398AbfGXLFf (ORCPT ); Wed, 24 Jul 2019 07:05:35 -0400 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:50095 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbfGXLFe (ORCPT ); Wed, 24 Jul 2019 07:05:34 -0400 Received: from tschai.fritz.box ([46.9.232.237]) by smtp-cloud7.xs4all.net with ESMTPA id qF5Hh3g5kLqASqF5QhNE28; Wed, 24 Jul 2019 13:05:32 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Cc: Maxime Jourdan , Tomasz Figa , Stanimir Varbanov , Sylwester Nawrocki , Alexandre Courbot , Maxime Ripard , Nicolas Dufresne , Paul Kocialkowski , Ezequiel Garcia , Boris Brezillon , Philipp Zabel , Hans Verkuil Subject: [PATCH 06/14] media: s5p_mfc_dec: set flags for OUTPUT coded formats Date: Wed, 24 Jul 2019 13:05:15 +0200 Message-Id: <20190724110523.29248-7-hverkuil-cisco@xs4all.nl> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> References: <20190724110523.29248-1-hverkuil-cisco@xs4all.nl> MIME-Version: 1.0 X-CMAE-Envelope: MS4wfMSf2wi/tLWAmyGQbqJEWh5+CNk3LG2ra76h3lUlnAPi8B4gotiYKVSLShy9Bl6l1/mq73ju6ftt2MlWk4NasrQp9ww1T8eZkZ1rU8m9z+LpwXBFVQxT Yb2n7a+115bDdBn77i5dzVetXJPM8Qzk8Rsda2XSInh8VPklMZw5rTukdyciThQFDxb4gKK5chqPGqQ6Fi//wn+c9Q+MUqANVrW7/k3mZzAsN5fFWUOh+HBf bcDQ9LB47QjvsA+nc+JBrlfrHmmIR3DTNrrJKXk2OLIHOdfn/9Ax6clhfi1ZLXSd0uZeRob57h2QLbgLz1VxMEI+gI5KeZ1WrY6XMXP/E1BS0koI1V5nyO40 vf/ChgaRVDH0hUh1zT1rJVXFpI7En2hZiYqMkRqBDbvkUumana8LlM8KfmijD1AhEJCPLlB8vRxnudBHIr66Wuc91aEAzGwU00/SejrTAPuXtdTNnHDHEaZz 9VeS0qnVzVShLOYpPZXnRYzwGA7hia0s30QGgVWxyuHU51n3flLaHi9E3hH1FP3paADfEeYui9jaVMTzv/jZkbu+4y0RK9+341tLpIgCQ0l6M1IuVMfF+EVW OyBlkAuIfZwx6i9weA41XMG5b0QBbtkdycsCtmOXHFmjBg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Maxime Jourdan Tag all the coded formats where the s5p_mfc decoder supports dynamic resolution switching or has a bitstream parser. Signed-off-by: Maxime Jourdan Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: added HAS_BITSTREAM_PARSER] --- .../media/platform/s5p-mfc/s5p_mfc_common.h | 1 + drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 96d1ecd1521b..31b133af91eb 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -723,6 +723,7 @@ struct s5p_mfc_fmt { enum s5p_mfc_fmt_type type; u32 num_planes; u32 versions; + u32 flags; }; /** diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index 61e144a35201..2d45a4d8d536 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -62,6 +62,8 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | + V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER, }, { .fourcc = V4L2_PIX_FMT_H264_MVC, @@ -69,6 +71,8 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V6PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | + V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER, }, { .fourcc = V4L2_PIX_FMT_H263, @@ -76,6 +80,7 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .fourcc = V4L2_PIX_FMT_MPEG1, @@ -83,6 +88,8 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | + V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER, }, { .fourcc = V4L2_PIX_FMT_MPEG2, @@ -90,6 +97,8 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | + V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER, }, { .fourcc = V4L2_PIX_FMT_MPEG4, @@ -97,6 +106,8 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | + V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER, }, { .fourcc = V4L2_PIX_FMT_XVID, @@ -104,6 +115,7 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .fourcc = V4L2_PIX_FMT_VC1_ANNEX_G, @@ -111,6 +123,7 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .fourcc = V4L2_PIX_FMT_VC1_ANNEX_L, @@ -118,6 +131,7 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V5PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .fourcc = V4L2_PIX_FMT_VP8, @@ -125,6 +139,7 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V6PLUS_BITS, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, { .fourcc = V4L2_PIX_FMT_HEVC, @@ -132,6 +147,8 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V10_BIT, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | + V4L2_FMT_FLAG_HAS_BITSTREAM_PARSER, }, { .fourcc = V4L2_PIX_FMT_VP9, @@ -139,6 +156,7 @@ static struct s5p_mfc_fmt formats[] = { .type = MFC_FMT_DEC, .num_planes = 1, .versions = MFC_V10_BIT, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION, }, };