From patchwork Mon Nov 9 17:35:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 11892065 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=-12.8 required=3.0 tests=BAYES_00,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_GIT 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 25967C388F7 for ; Mon, 9 Nov 2020 17:36:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A9D2720578 for ; Mon, 9 Nov 2020 17:36:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ituQYPEL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O7BrI5oN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9D2720578 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TCA8WMMUMyHMdaifm+WyO2MxPc4mqeGuspsJLecgHlM=; b=ituQYPELW/ekaAtQh7vg6+WLv4 3mPhAhg8ElXwHZDVbRPdOX0c+SR4Inbs4rj3ZbzYPfSxgOpP64+i4Sv1aoBiQak/DXzv09MBJj3Is h7SD0eIbcNrKfHzv//TAbIAcWdDzRQD1wacSiWwW14xGZEGS4L5mZd6j+v040o3ZTgttWdXCSLkP4 3ftqLxR9KJXasfAGpbp+SIgTqmoJX0U8kCLL/H/PMNNfZRgdq9+uYIxPcD6kUuSfF+HPt3olEBTm3 BVDw0H7HbKT96siHQhZJTF4cM6n4pGK8RnHj30Qv9pFRnfXW9BUte+fg1+ls5oDSkOWBuJauofoDn F21J7aRQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcB5c-0005rl-Ln; Mon, 09 Nov 2020 17:36:24 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcB5K-0005lQ-14 for linux-arm-kernel@lists.infradead.org; Mon, 09 Nov 2020 17:36:10 +0000 Received: by mail-ed1-x542.google.com with SMTP id t9so6267230edq.8 for ; Mon, 09 Nov 2020 09:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4uG33267VrZPuq/TP2MGJz5yF4YqwpdNO7AQA5+ar2s=; b=O7BrI5oNvRv+OmwF/UkCImulVAiaztkPKqytKHXY+phxO3mvlbqqkcs7BYsB3rn+Ek gt/KpHJr49OZdbt3NADQHFhpcYjja0bSgE7+WXDaEpg9tTcJTvd6K9bJpFw7UGkQ6IPD zQD8Op68Wh8S0LF2m8pknytLEj1QY2q0+RspgasOMtL1dALe96WnNFKUYYvK+hSXueoQ +oLlVcUZJOe0gwrYm8fEiHaIm6U+zLyzi0+qN7XU+p4k1d/G15GbNbsUen5muluj1D8a WN9VnyOW3Mgpq3uRVEuGPeRZVRta5YJGcTWNftJ1lbfp+i4BmT7fpVjOCs1UsKaMm7tV 6kuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4uG33267VrZPuq/TP2MGJz5yF4YqwpdNO7AQA5+ar2s=; b=dAwKn2z4s29NdSqYX6Tb6kekXFRppxOegnalFjTkE7s3OrZEpOSi7CPXHxlPqLzhBi f0MO/iT/fXMXcOhZC56ygfYyA8DQGdCZNCFArBsNX9iIZlCjTv03LuQ7IeVtXraExZt4 c+AUawY1PkGGJi8V3qWgsNrQ4p1Z0q2vzHdTIkG7y1RkYNUXbfGkAareC2BkIrDtnRrR o2m/ZeQznWGsq+tiiRi+Iq23OFDoa2z6I82IKuA8TLBxUHtQC/2oz1gUKWgdA2rUc6sx lBcPZ31EzAw9xDCZ0bGTAltKkagUf3w6RsyiYsJOlbETeO/+Ll5IayhYlOF3HfUk/QRd I3Zw== X-Gm-Message-State: AOAM531l+y4Al2NJq0ErwtMtvJtLB1nfLNS+7lqcZsLPVXDdcKzqyh7F /MfPoSalr25wKLJs6pScpv5IBw== X-Google-Smtp-Source: ABdhPJwd5XROm0SteLGhK+SA+asZkfwB4SG1O6GLXXZCMl1pEL4LS2NKMI2H3wIFjOKUXuYZgkXwcQ== X-Received: by 2002:a50:a40f:: with SMTP id u15mr17002139edb.307.1604943362974; Mon, 09 Nov 2020 09:36:02 -0800 (PST) Received: from localhost.localdomain (hst-221-89.medicom.bg. [84.238.221.89]) by smtp.gmail.com with ESMTPSA id jw7sm9123981ejb.54.2020.11.09.09.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 09:36:02 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] v4l2-ctrl: Make display delay and display enable std controls Date: Mon, 9 Nov 2020 19:35:38 +0200 Message-Id: <20201109173541.10016-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201109173541.10016-1-stanimir.varbanov@linaro.org> References: <20201109173541.10016-1-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_123606_136890_7246FC40 X-CRM114-Status: GOOD ( 17.19 ) 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: Kamil Debski , Stanimir Varbanov , Kyungmin Park , Hans Verkuil , Nicolas Dufresne , Ezequiel Garcia , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Make display delay and display delay enable MFC controls standard v4l controls. This will allow reuse of the controls for other decoder drivers. Also the new proposed controls are now codec agnostic because they could be used for any codec. Signed-off-by: Stanimir Varbanov --- .../userspace-api/media/v4l/ext-ctrls-codec.rst | 15 +++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++ include/uapi/linux/v4l2-controls.h | 2 ++ 3 files changed, 21 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index ce728c757eaf..82c9cda40270 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -679,6 +679,21 @@ enum v4l2_mpeg_video_frame_skip_mode - otherwise the decoder expects a single frame in per buffer. Applicable to the decoder, all codecs. +``V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY_ENABLE (boolean)`` + If the display delay is enabled then the decoder is forced to return + a CAPTURE buffer (decoded frame) after processing a certain number + of OUTPUT buffers. The delay can be set through + ``V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY``. This + feature can be used for example for generating thumbnails of videos. + Applicable to the decoder. + +``V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY (integer)`` + Display delay value for decoder. The decoder is forced to + return a decoded frame after the set 'display delay' number of + frames. If this number is low it may result in frames returned out + of display order, in addition the hardware may still be using the + returned buffer as a reference picture for subsequent frames. + ``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (boolean)`` Enable writing sample aspect ratio in the Video Usability Information. Applicable to the H264 encoder. diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index bd7f330c941c..4a21802e026b 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -874,6 +874,8 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MPEG_VIDEO_HEADER_MODE: return "Sequence Header Mode"; case V4L2_CID_MPEG_VIDEO_MAX_REF_PIC: return "Max Number of Reference Pics"; case V4L2_CID_MPEG_VIDEO_FRAME_SKIP_MODE: return "Frame Skip Mode"; + case V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY: return "Display Delay"; + case V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY_ENABLE: return "Display Delay Enable"; case V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP: return "H263 I-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP: return "H263 P-Frame QP Value"; case V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP: return "H263 B-Frame QP Value"; @@ -1221,6 +1223,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_FLASH_READY: case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: case V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE: + case V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY_ENABLE: case V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE: case V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE: case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM: @@ -1256,6 +1259,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, break; case V4L2_CID_MPEG_VIDEO_MV_H_SEARCH_RANGE: case V4L2_CID_MPEG_VIDEO_MV_V_SEARCH_RANGE: + case V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY: *type = V4L2_CTRL_TYPE_INTEGER; break; case V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME: diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index 7035f4fb182c..d6b19f8d0022 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -773,6 +773,8 @@ enum v4l2_mpeg_video_frame_skip_mode { V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1, V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2, }; +#define V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY (V4L2_CID_MPEG_BASE + 647) +#define V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_BASE + 648) /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)