From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79F86C3A5A4 for ; Fri, 30 Aug 2019 09:45:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 560CA21670 for ; Fri, 30 Aug 2019 09:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727792AbfH3JpD (ORCPT ); Fri, 30 Aug 2019 05:45:03 -0400 Received: from lb2-smtp-cloud8.xs4all.net ([194.109.24.25]:55717 "EHLO lb2-smtp-cloud8.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726653AbfH3JpD (ORCPT ); Fri, 30 Aug 2019 05:45:03 -0400 Received: from [192.168.2.10] ([46.9.232.237]) by smtp-cloud8.xs4all.net with ESMTPA id 3dShiYEL4DqPe3dSkiRS9z; Fri, 30 Aug 2019 11:45:00 +0200 Subject: Re: [PATCH 2/8] videodev2.h: add V4L2_DEC_CMD_FLUSH To: Alexandre Courbot , Jernej Skrabec Cc: Mauro Carvalho Chehab , Paul Kocialkowski , mripard@kernel.org, Pawel Osciak , Marek Szyprowski , Kyungmin Park , Tomasz Figa , Chen-Yu Tsai , gregkh@linuxfoundation.org, Linux Media Mailing List , LKML , devel@driverdev.osuosl.org, "moderated list:ARM/Mediatek SoC support" , Ezequiel Garcia , jonas@kwiboo.se References: <20190822194500.2071-1-jernej.skrabec@siol.net> <20190822194500.2071-3-jernej.skrabec@siol.net> From: Hans Verkuil Message-ID: <907f3c43-b994-f1c7-a15b-116566e19003@xs4all.nl> Date: Fri, 30 Aug 2019 11:44:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfB4Iwpuxa4ZWt3WM5IScwN1zIREASBWnbgJamG02lqSTKf0f6j1jls/icFEBpt/+ljEr/9Y5Sq5Zd9sZVR6ANFlk/wmVSJVnMrssJpDPeJBWRqvn+U/p LVEEMt39B1UHj6sOC490LO9wF2NWibQ78kCPGnUAWmwR3oWf++lVNsd1bmDFh4tBqyCG4RjLtz+vPkfOYhbPEeoOa7+xOnaCdbl4H7IhWoAAXXIgl9IflOxH cc1PFgWU6u4fVCy3OJoqsgnYEWRFujH3WodDTFiTFlKM51XUi7nVSeigAS14/3E1BU4EqYrOkJlGmcgQzLN8XJmQ52J74mkYg7qSyzrmKWZ/4ZC2CEjeWQJZ XJk0wPWGnvRKw2bb+tiHbwkRY6r6CgAGmm8bu2mUaN/SZrqw4TVAHQuJtb8WvnSsKaijD5bREj07kRg4iflyy8L5MAAme/LpzwT2IMXyRsoSyuqOu3NBP1Z3 tzjcdWh2vLp/fcnK+DOELBvNwrvpRn6J6U4UKgf4j0MER/dsnK8hbKKzzMDwaQcSsCCZC1cHXRbDbrgZEY7hKCb/jdU5vyAdLncmCfmQDUGUajlV4vm07AF6 1RitpU4Y+gnyKJ6XOCngTKZ91X4yTPrdGy//Ui2pdXkitnE+yvdwRjlIcSjHYCwjGNoXohLW8KGcEHXZslxfljBBeBnZoRiHWZhS3dzUqz9aQkvfaq3E2a8N p4F05ydyvQwCdZKvYLxrSfrlWaxEa7nP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/19 11:38 AM, Alexandre Courbot wrote: > On Fri, Aug 23, 2019 at 4:45 AM Jernej Skrabec wrote: >> >> From: Hans Verkuil >> >> Add this new V4L2_DEC_CMD_FLUSH decoder command and document it. >> >> Signed-off-by: Hans Verkuil >> Signed-off-by: Jernej Skrabec >> --- >> Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 11 ++++++++++- >> Documentation/media/videodev2.h.rst.exceptions | 1 + >> include/uapi/linux/videodev2.h | 1 + >> 3 files changed, 12 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst >> index 57f0066f4cff..0bffef6058f7 100644 >> --- a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst >> +++ b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst >> @@ -208,7 +208,16 @@ introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decod >> been started yet, the driver will return an ``EPERM`` error code. When >> the decoder is already running, this command does nothing. No >> flags are defined for this command. >> - >> + * - ``V4L2_DEC_CMD_FLUSH`` >> + - 4 >> + - Flush any held capture buffers. Only valid for stateless decoders, >> + and only if ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` was set. >> + This command is typically used when the application reached the >> + end of the stream and the last output buffer had the >> + ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent >> + dequeueing the last capture buffer containing the last decoded frame. >> + So this command can be used to explicitly flush that last decoded >> + frame. > > Just for safety, can we also specify that it is valid to call this > command even if no buffer was held (in which case it is a no-op), as > this can help make user-space code simpler? Ah yes, thanks for the reminder. Jernej, when you post the next version of this series, can you change the text above to: - Flush any held capture buffers. Only valid for stateless decoders. This command is typically used when the application reached the end of the stream and the last output buffer had the ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent dequeueing the capture buffer containing the last decoded frame. So this command can be used to explicitly flush that final decoded frame. This command does nothing if there are no held capture buffers. Regards, Hans > >> >> Return Value >> ============ >> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions >> index adeb6b7a15cb..a79028e4d929 100644 >> --- a/Documentation/media/videodev2.h.rst.exceptions >> +++ b/Documentation/media/videodev2.h.rst.exceptions >> @@ -434,6 +434,7 @@ replace define V4L2_DEC_CMD_START decoder-cmds >> replace define V4L2_DEC_CMD_STOP decoder-cmds >> replace define V4L2_DEC_CMD_PAUSE decoder-cmds >> replace define V4L2_DEC_CMD_RESUME decoder-cmds >> +replace define V4L2_DEC_CMD_FLUSH decoder-cmds >> >> replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds >> replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds >> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h >> index 4fa9f543742d..91a79e16089c 100644 >> --- a/include/uapi/linux/videodev2.h >> +++ b/include/uapi/linux/videodev2.h >> @@ -1978,6 +1978,7 @@ struct v4l2_encoder_cmd { >> #define V4L2_DEC_CMD_STOP (1) >> #define V4L2_DEC_CMD_PAUSE (2) >> #define V4L2_DEC_CMD_RESUME (3) >> +#define V4L2_DEC_CMD_FLUSH (4) >> >> /* Flags for V4L2_DEC_CMD_START */ >> #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0) >> -- >> 2.22.1 >> From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB5FDC3A5A6 for ; Fri, 30 Aug 2019 09:45:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F83F23427 for ; Fri, 30 Aug 2019 09:45:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JSI/fH0T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F83F23427 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xs4all.nl Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AI/GJVonkHYJkJcTACp2zY4w9m9mFMrzSDYtVbR3Jlo=; b=JSI/fH0TyoB6GT BMSdgnIO5fKy3B6S9n/TS/v7huyCF+7D3ELln/Whqvd/lX50SPY0rNiI6+3adGyoT4umQyk/8RMsi YLV7o3RlvKerWoIepPHF6B9RVy1b73MidsdSyIEqNidWkEbJIGx6rsmPm0V0KZEfBvJ0JNrq4YJ3Z DCyIuXtQvzQHmqSFiofBiZFugGOguX67n9vRvg9qVRXvDo6lb7EZwBwglNYZYFcURPg8n0xPHDS3j pxu4efw9JCfyKFG+h7HpXfp7N/TtzSRhKv1XLAoxeaD7VH1It89/kw4TJthkk0eJnTCsgBAXgV6fX GtTC2RsUz+8RLtAGLagQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i3dSv-0006Uz-0H; Fri, 30 Aug 2019 09:45:09 +0000 Received: from lb2-smtp-cloud8.xs4all.net ([194.109.24.25]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i3dSp-0005N4-WC for linux-arm-kernel@lists.infradead.org; Fri, 30 Aug 2019 09:45:05 +0000 Received: from [192.168.2.10] ([46.9.232.237]) by smtp-cloud8.xs4all.net with ESMTPA id 3dShiYEL4DqPe3dSkiRS9z; Fri, 30 Aug 2019 11:45:00 +0200 Subject: Re: [PATCH 2/8] videodev2.h: add V4L2_DEC_CMD_FLUSH To: Alexandre Courbot , Jernej Skrabec References: <20190822194500.2071-1-jernej.skrabec@siol.net> <20190822194500.2071-3-jernej.skrabec@siol.net> From: Hans Verkuil Message-ID: <907f3c43-b994-f1c7-a15b-116566e19003@xs4all.nl> Date: Fri, 30 Aug 2019 11:44:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CMAE-Envelope: MS4wfB4Iwpuxa4ZWt3WM5IScwN1zIREASBWnbgJamG02lqSTKf0f6j1jls/icFEBpt/+ljEr/9Y5Sq5Zd9sZVR6ANFlk/wmVSJVnMrssJpDPeJBWRqvn+U/p LVEEMt39B1UHj6sOC490LO9wF2NWibQ78kCPGnUAWmwR3oWf++lVNsd1bmDFh4tBqyCG4RjLtz+vPkfOYhbPEeoOa7+xOnaCdbl4H7IhWoAAXXIgl9IflOxH cc1PFgWU6u4fVCy3OJoqsgnYEWRFujH3WodDTFiTFlKM51XUi7nVSeigAS14/3E1BU4EqYrOkJlGmcgQzLN8XJmQ52J74mkYg7qSyzrmKWZ/4ZC2CEjeWQJZ XJk0wPWGnvRKw2bb+tiHbwkRY6r6CgAGmm8bu2mUaN/SZrqw4TVAHQuJtb8WvnSsKaijD5bREj07kRg4iflyy8L5MAAme/LpzwT2IMXyRsoSyuqOu3NBP1Z3 tzjcdWh2vLp/fcnK+DOELBvNwrvpRn6J6U4UKgf4j0MER/dsnK8hbKKzzMDwaQcSsCCZC1cHXRbDbrgZEY7hKCb/jdU5vyAdLncmCfmQDUGUajlV4vm07AF6 1RitpU4Y+gnyKJ6XOCngTKZ91X4yTPrdGy//Ui2pdXkitnE+yvdwRjlIcSjHYCwjGNoXohLW8KGcEHXZslxfljBBeBnZoRiHWZhS3dzUqz9aQkvfaq3E2a8N p4F05ydyvQwCdZKvYLxrSfrlWaxEa7nP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190830_024504_206793_9BD4D1FA X-CRM114-Status: GOOD ( 21.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Linux Media Mailing List , Pawel Osciak , jonas@kwiboo.se, gregkh@linuxfoundation.org, Chen-Yu Tsai , mripard@kernel.org, Tomasz Figa , Paul Kocialkowski , Kyungmin Park , "moderated list:ARM/Mediatek SoC support" , Mauro Carvalho Chehab , Ezequiel Garcia , LKML , Marek Szyprowski Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 8/30/19 11:38 AM, Alexandre Courbot wrote: > On Fri, Aug 23, 2019 at 4:45 AM Jernej Skrabec wrote: >> >> From: Hans Verkuil >> >> Add this new V4L2_DEC_CMD_FLUSH decoder command and document it. >> >> Signed-off-by: Hans Verkuil >> Signed-off-by: Jernej Skrabec >> --- >> Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 11 ++++++++++- >> Documentation/media/videodev2.h.rst.exceptions | 1 + >> include/uapi/linux/videodev2.h | 1 + >> 3 files changed, 12 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst >> index 57f0066f4cff..0bffef6058f7 100644 >> --- a/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst >> +++ b/Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst >> @@ -208,7 +208,16 @@ introduced in Linux 3.3. They are, however, mandatory for stateful mem2mem decod >> been started yet, the driver will return an ``EPERM`` error code. When >> the decoder is already running, this command does nothing. No >> flags are defined for this command. >> - >> + * - ``V4L2_DEC_CMD_FLUSH`` >> + - 4 >> + - Flush any held capture buffers. Only valid for stateless decoders, >> + and only if ``V4L2_BUF_CAP_SUPPORTS_M2M_HOLD_CAPTURE_BUF`` was set. >> + This command is typically used when the application reached the >> + end of the stream and the last output buffer had the >> + ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent >> + dequeueing the last capture buffer containing the last decoded frame. >> + So this command can be used to explicitly flush that last decoded >> + frame. > > Just for safety, can we also specify that it is valid to call this > command even if no buffer was held (in which case it is a no-op), as > this can help make user-space code simpler? Ah yes, thanks for the reminder. Jernej, when you post the next version of this series, can you change the text above to: - Flush any held capture buffers. Only valid for stateless decoders. This command is typically used when the application reached the end of the stream and the last output buffer had the ``V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF`` flag set. This would prevent dequeueing the capture buffer containing the last decoded frame. So this command can be used to explicitly flush that final decoded frame. This command does nothing if there are no held capture buffers. Regards, Hans > >> >> Return Value >> ============ >> diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions >> index adeb6b7a15cb..a79028e4d929 100644 >> --- a/Documentation/media/videodev2.h.rst.exceptions >> +++ b/Documentation/media/videodev2.h.rst.exceptions >> @@ -434,6 +434,7 @@ replace define V4L2_DEC_CMD_START decoder-cmds >> replace define V4L2_DEC_CMD_STOP decoder-cmds >> replace define V4L2_DEC_CMD_PAUSE decoder-cmds >> replace define V4L2_DEC_CMD_RESUME decoder-cmds >> +replace define V4L2_DEC_CMD_FLUSH decoder-cmds >> >> replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds >> replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds >> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h >> index 4fa9f543742d..91a79e16089c 100644 >> --- a/include/uapi/linux/videodev2.h >> +++ b/include/uapi/linux/videodev2.h >> @@ -1978,6 +1978,7 @@ struct v4l2_encoder_cmd { >> #define V4L2_DEC_CMD_STOP (1) >> #define V4L2_DEC_CMD_PAUSE (2) >> #define V4L2_DEC_CMD_RESUME (3) >> +#define V4L2_DEC_CMD_FLUSH (4) >> >> /* Flags for V4L2_DEC_CMD_START */ >> #define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0) >> -- >> 2.22.1 >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel