From patchwork Fri Jan 15 09:26:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12021975 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 5B54BC433DB for ; Fri, 15 Jan 2021 09:28:08 +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 1EEA923403 for ; Fri, 15 Jan 2021 09:28:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EEA923403 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=EKhYT5CaQkvb9a9swSe9bBjC7myig5doouYINqprVSw=; b=rEj1uTYIITWtdu9AT3dxFXLeM4 Zy7b6N55iG0OUM9JnReSUP/0HnTyFPBOUrWOVZO1n8ldP/6Cvcur7SR/MH4rS5oVr0sVbceijTldb Y0QpuX9i5uhhhZu2vucIaIQh64k7mLKITZhLtFD/Jac4ySiDNKM7bA+32JrxoEaFAKCA8dVeJeDNI jQjlilVKmZuPpI4h1w5I6txiprAIb8eCc3cIB+S87J8AEh494uLYFKlIeEP3Xu/u/N0ahphbsHrO3 nKTkulSlZlpxRzBiW6KLEZ9d4JzMBtRYc5B24A8hX3sa8szjJemGfuXwRsAnLFfLEQxY3Ka20Sfta 6hDz4VVA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNG-00021e-FQ; Fri, 15 Jan 2021 09:26:30 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNB-000204-C8 for linux-arm-kernel@lists.infradead.org; Fri, 15 Jan 2021 09:26:26 +0000 Received: by mail-ej1-x62f.google.com with SMTP id 6so12333821ejz.5 for ; Fri, 15 Jan 2021 01:26:24 -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=t+LIjSQQZkRT5kA7Y1VVVn+LaJzyPGxbVa/mAnWmpfM=; b=Msso7NqhPhEB4q0UnUA8XAPok6JM03bozuMhwDOETKKxRwPjxCwRautZMeGgx5AsdV lJSzMqlyjQBcrcJgp95PfoEI2Q6fRp28H1lGx72DAu/EKKMjuf5hDuDVSAdcze/LajF5 35/Tg8PdCZNZx9klkRPJrkGaBym+hZM/W9FDqYaRYe0Qw2YbSeMoM0S+rY/NFp/XyFgv jFc1wRHx2I55nWpib5/zg7V+aRYN25LHx/tD27UgnUYxCi887GcM3n3UFftH+ijkrGKY TIlANhAGkBILk0j01SuWILKsjurPq5GzAdGBTiwvGryMi5xAqY9dhVR/C/dzmj+igDEj d9MA== 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=t+LIjSQQZkRT5kA7Y1VVVn+LaJzyPGxbVa/mAnWmpfM=; b=IA93ws+39S3n5kasQKibq1lPI+OAKt7mSdzsMuqnJgCmZwTA0FeWUdZgXoUgwVC/D+ 1ptcCKXYAIxPWoYYeCgzHQhPVd8NQtCoOBiO/OR1RxPmhF4WJx5bknspxvT3E1q3xB2V QhSY24LgUPI1jzONqnmfdA5gNysfSovLpNiLgE/NlcBraywza6xv/bgf86uneNUxnnW0 eek3Qw/BpvSpLYpIsyOeEv7f95S0NDRzZLyFAjLWxIBWhxipECcFjbdOMrvhc712nbDP xh6+8EvjYpM4DqcO+m7KfmVrrxgiqRcwUB/WwjM2W8W16UsLRJgCcJcZVUeZpIditxNB cIJw== X-Gm-Message-State: AOAM533sm4cKYC9f5H1Jqb2mSfn2GSZjYDOzdg1KKLPKtIklKQRUbjkW y8jS3pFyXT2eS+7HOHbV39BjjA== X-Google-Smtp-Source: ABdhPJxn30W4zKu9VCJ3o50F75dE3Sw6KR6uluS9N0XbHTzNL1rLZMcI1H9C7ygMJOID9q/CeST6DQ== X-Received: by 2002:a17:906:94d2:: with SMTP id d18mr8129364ejy.94.1610702783791; Fri, 15 Jan 2021 01:26:23 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u24sm3004140eje.71.2021.01.15.01.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 01:26:23 -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 v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Date: Fri, 15 Jan 2021 11:26:04 +0200 Message-Id: <20210115092607.29849-2-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115092607.29849-1-stanimir.varbanov@linaro.org> References: <20210115092607.29849-1-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_042625_432932_D592461E X-CRM114-Status: GOOD ( 16.29 ) 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: Hans Verkuil , Stanimir Varbanov 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 Acked-by: Hans Verkuil --- .../userspace-api/media/v4l/ext-ctrls-codec.rst | 15 +++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++ include/uapi/linux/v4l2-controls.h | 3 +++ 3 files changed, 22 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 00944e97d638..5d7c47837035 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_DEC_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_DEC_DISPLAY_DELAY``. This + feature can be used for example for generating thumbnails of videos. + Applicable to the decoder. + +``V4L2_CID_MPEG_VIDEO_DEC_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 f7b310240af2..2ae305d6db01 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_DEC_DISPLAY_DELAY: return "Display Delay"; + case V4L2_CID_MPEG_VIDEO_DEC_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"; @@ -1241,6 +1243,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_DEC_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: @@ -1276,6 +1279,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_DEC_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 039c0d7add1b..4b361fdce231 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -797,6 +797,9 @@ enum v4l2_mpeg_video_frame_skip_mode { #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MIN_QP (V4L2_CID_CODEC_BASE + 651) #define V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_MAX_QP (V4L2_CID_CODEC_BASE + 652) +#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY (V4L2_CID_CODEC_BASE + 653) +#define V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE (V4L2_CID_CODEC_BASE + 654) + /* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ #define V4L2_CID_CODEC_CX2341X_BASE (V4L2_CTRL_CLASS_CODEC | 0x1000) #define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_CODEC_CX2341X_BASE+0) From patchwork Fri Jan 15 09:26:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12021979 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 C0E53C43381 for ; Fri, 15 Jan 2021 09:28:10 +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 7786A23403 for ; Fri, 15 Jan 2021 09:28:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7786A23403 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=O6bXD/axZWfDcEf3wSpYu3K0x3tz9GaRspjNYTKeXXI=; b=ExNYu4jiPUZkf/8iobjwIymwip 3qvhUV49SZz78rkxsmoAmiK1qwuC/3R0K7GnoVB6Fk7i2IANqInv7YEc8adDlp06l6U5skbpVB4pp 7W2Nb4Q5G6YZt7qk+y2MzKgiqjVS1XWt+zGPx4F/sZx7HsWDD16Yd/nhyTQppM2kUNzAsZIbTjskN 3HIb2tsU+QlSOmufVIoIAWWlFu+yvzyGbQC3n89frXHVUme5Hakq1P0jjaxt+iUF3RzBRPIjVF86h Pv8EJpuUoBOXjc57hoPAAuEbP2IrG+JEy0RgehzDs7wSJ0LaiYKUL+lYarG8MLL0VFr8krZsiUdnV l3wemiCw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNN-00023J-ES; Fri, 15 Jan 2021 09:26:37 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNC-00020Y-SZ for linux-arm-kernel@lists.infradead.org; Fri, 15 Jan 2021 09:26:27 +0000 Received: by mail-ej1-x631.google.com with SMTP id jx16so12286592ejb.10 for ; Fri, 15 Jan 2021 01:26:26 -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=NiDOyGK2bOsrwUw3iahcb+Ehu3HtnFpXGarV1c+5LM8=; b=ZFsRL5mF1MBomvAa3QRzKuOzv/1Y2Eeyf90TC5tvrq8mNB+QD2ypMStgZXbhQldc8Y khcdK5GjLd4UuwFsmyOrVdhCNH2h6Wnvr0mtmWbl3Gt9R88Vvb8PlwY9U3oJ1SxVPTua BtPPn8Q7/t+xiasgCXlLVnSDzgQz5lrfMJGjYPszGDp0eVkj3Am0Ip9r5srZ7/PO+VGJ mu6xZsT0UlAQW4r7SuRsNnCEwrZ6AKoPBYwzBsc2SCNk/++uSUzf19EVdz2x+eTfPi5c RJHhIRIKslEbyCiJS/I8QDI4YRQmHy6VjQWru77tNEHq98MigM2rCso4Uj21+3rq49+n A7Iw== 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=NiDOyGK2bOsrwUw3iahcb+Ehu3HtnFpXGarV1c+5LM8=; b=i7CtuGCwX/o6lPTA97ARNCeETUd8xlJzaAFY77302vI08WFCCpFSwqXwwmIT7k+BB5 QMHT+MuzHudLBzPYRnPNy9Qf9Rl+6WzjVjCjQhmEdh+0CmsZZrOYtGI4rammxYHn2X32 TMQY+4po7FGHcotRni8pk5tC09Esj7jnUbpY5n/s7eelZ3diRImYmrio8b9J7yCm4txq Bw8LBNI2UjnXQB4iUV6nVS0OCI7bZNxQKrQQqpwBixWzMifW4eLJibjpG9QQ4u/aHjOH x+26LIl6d3LT0x9ucGoO/mE6u62a7f+RHhjBPQDbIJ++kHEaIgk0E6l4bhKxFeQNqPLo 1E0w== X-Gm-Message-State: AOAM533TG/c+k5azxD7CDzvuPE3cRbtwZw9BsWhKnkLFtXiigv8ZCIEZ MWv0lxXiDa1006fycCR7NMl2iHuQjrV84uQD X-Google-Smtp-Source: ABdhPJyX7rZZcVY49O3f8EhLNpc21KMU6uOJ/7/y1etku1GyJRlAIo6rilAKq9+Pcp7XWLDZS2ChKg== X-Received: by 2002:a17:907:96aa:: with SMTP id hd42mr3009334ejc.526.1610702785385; Fri, 15 Jan 2021 01:26:25 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u24sm3004140eje.71.2021.01.15.01.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 01:26:24 -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 v2 2/4] venus: vdec: Add support for display delay and delay enable controls Date: Fri, 15 Jan 2021 11:26:05 +0200 Message-Id: <20210115092607.29849-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115092607.29849-1-stanimir.varbanov@linaro.org> References: <20210115092607.29849-1-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_042626_953909_89446EB2 X-CRM114-Status: GOOD ( 17.37 ) 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: Hans Verkuil , Stanimir Varbanov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add support for display delay and display delay enable std controls. With this we implement decoder decode output order (decode vs display). Once firmware implement few new features the controls will be used for other use-cases. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.h | 2 ++ drivers/media/platform/qcom/venus/vdec.c | 10 +++++++++- drivers/media/platform/qcom/venus/vdec_ctrls.c | 16 +++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index b984d508ed71..1028b492216c 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -172,6 +172,8 @@ struct vdec_controls { u32 post_loop_deb_mode; u32 profile; u32 level; + u32 display_delay; + u32 display_delay_enable; }; struct venc_controls { diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index e4dc97f00fc3..c20496a14a55 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -620,7 +620,7 @@ static int vdec_set_properties(struct venus_inst *inst) { struct vdec_controls *ctr = &inst->controls.dec; struct hfi_enable en = { .enable = 1 }; - u32 ptype; + u32 ptype, decode_order; int ret; if (ctr->post_loop_deb_mode) { @@ -630,6 +630,14 @@ static int vdec_set_properties(struct venus_inst *inst) return ret; } + if (ctr->display_delay_enable && ctr->display_delay == 0) { + ptype = HFI_PROPERTY_PARAM_VDEC_OUTPUT_ORDER; + decode_order = HFI_OUTPUT_ORDER_DECODE; + ret = hfi_session_set_property(inst, ptype, &decode_order); + if (ret) + return ret; + } + return 0; } diff --git a/drivers/media/platform/qcom/venus/vdec_ctrls.c b/drivers/media/platform/qcom/venus/vdec_ctrls.c index 974110b75b93..07680aae0a36 100644 --- a/drivers/media/platform/qcom/venus/vdec_ctrls.c +++ b/drivers/media/platform/qcom/venus/vdec_ctrls.c @@ -30,6 +30,12 @@ static int vdec_op_s_ctrl(struct v4l2_ctrl *ctrl) case V4L2_CID_MPEG_VIDEO_VP9_LEVEL: ctr->level = ctrl->val; break; + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY: + ctr->display_delay = ctrl->val; + break; + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE: + ctr->display_delay_enable = ctrl->val; + break; default: return -EINVAL; } @@ -89,7 +95,7 @@ int vdec_ctrl_init(struct venus_inst *inst) struct v4l2_ctrl *ctrl; int ret; - ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 9); + ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 11); if (ret) return ret; @@ -158,6 +164,14 @@ int vdec_ctrl_init(struct venus_inst *inst) if (ctrl) ctrl->flags |= V4L2_CTRL_FLAG_VOLATILE; + v4l2_ctrl_new_std(&inst->ctrl_handler, &vdec_ctrl_ops, + V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY, + 0, 16383, 1, 0); + + v4l2_ctrl_new_std(&inst->ctrl_handler, &vdec_ctrl_ops, + V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE, + 0, 1, 1, 0); + ret = inst->ctrl_handler.error; if (ret) { v4l2_ctrl_handler_free(&inst->ctrl_handler); From patchwork Fri Jan 15 09:26:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12021981 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 F1184C433E0 for ; Fri, 15 Jan 2021 09:28:13 +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 A32CD23403 for ; Fri, 15 Jan 2021 09:28:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A32CD23403 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=iaFdXDWVKUt2SqDPChnTQw5WBoecFwg0hsvEiQGnxDI=; b=clwZJDXHddxt6RNJTuLDzEgE+O Vm1ovWEvN6azX+cEiTH+vY0nuqe9mWMRVEe6tat1q/1CN+oluJakBVpzkMg4YoTZGZ0PpBTXSpxAy NuNM1swFmMh50QxGqPV2RCwteho3Uu3iaYZnJgHU2IYzczGGX8bX+s1Bxs6Ifistws4TeVxAfXcC9 8Zs7SZEGhYMH9sQ8fk0UpyKPK29u5nsY7jKLxQZl9XL2q/cZ+/PVtK1oiBKl+4td9Odgc8L7Okg6j WK3pcKgHNBtZHk1ZgXaQ9Lwu8HvUFE2yaJZnwvC3mHGpyZc1SPh0QZPzZ8a4iUoIQnfd1F3e2N87k 0OOKI/uQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNO-00023g-S1; Fri, 15 Jan 2021 09:26:38 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNE-00020z-Cf for linux-arm-kernel@lists.infradead.org; Fri, 15 Jan 2021 09:26:29 +0000 Received: by mail-ej1-x635.google.com with SMTP id jx16so12286678ejb.10 for ; Fri, 15 Jan 2021 01:26:27 -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=VW5Rdf+XabAMEub3RqiNA/1skv+IyyCxHOSnvL012VA=; b=z2Wv0QSRd3GkWD535rvz6m8unClRZByA43tSFjS/7Okri/MEoSku1aBaSe0anhfGAZ rRX0/UivBJuFtEjBMWYGNBo5W5gHYfXZFksgkHaR7qud9BUTzHVU5/kU5sUp7l8fOXPS l/MGPeFUcfA8xFvJSphcCeGdMvXoeWgjvGSPi+6IK7RsAh0CZicbp8LTE0GQr0urncaA uWYbPVCb78dbzF4Q/EVyzSmY3sAukWQnDrlL5NKVi5mPtAb4JQeLEwupoMzb8eM2C8Es uztncevZbGcBWWKgi99aV8kCu05JSfQE0ez/flmPT/mMcynaJtBVKA6DrFmQIll+NO2z 2TiQ== 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=VW5Rdf+XabAMEub3RqiNA/1skv+IyyCxHOSnvL012VA=; b=Nesnhlbn7bFkt2CGbv1FhvvXyXtenTN370eKg9eVG5gRzgY7+wAySUFXkYG/GFK4u3 I+rQNpoJMK62PTRI/zrAhKj1aybv0Gu8v+Jg5Bivomhj9KjJ6ePA4j5+iARu8mqPNans qN4M4N2HRuQ18N4oiVcsetQEM2/NInDKQk61w5YCPbg2UXmX7Q3WHE42JKru1uThwYH6 wA3KorWXr/7dT/Kz43dV5+Jb360/rTuw5yZc8+ixRPNYZrCm9xMjixFZELgoVylO9LDK 1+HjhXcUGznZoCcQBVZ6oPj00VltcrDLrax6U1o+s5byrVu7wBoTpNecj8hCoper+KiG qUcw== X-Gm-Message-State: AOAM5312vVcz8CXRxYeBN+YXEGxengYAv+aDukzYqX7WeztLk8p7n2Vr khon0jWKbRNQc5gtKEzT2PJ4Ng== X-Google-Smtp-Source: ABdhPJzwuVLCk6y+NZ0ic1yM0vHMbHrK2z/3ikq1Z8bjk8WsJUtP9JjSNByNGhIqL9eo9utCmnYsxA== X-Received: by 2002:a17:907:3e02:: with SMTP id hp2mr7990039ejc.411.1610702786861; Fri, 15 Jan 2021 01:26:26 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u24sm3004140eje.71.2021.01.15.01.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 01:26:26 -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 v2 3/4] s5p-mfc: Use display delay and display enable std controls Date: Fri, 15 Jan 2021 11:26:06 +0200 Message-Id: <20210115092607.29849-4-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115092607.29849-1-stanimir.varbanov@linaro.org> References: <20210115092607.29849-1-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_042628_473262_539EBC20 X-CRM114-Status: GOOD ( 12.60 ) 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: Hans Verkuil , Stanimir Varbanov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the standard display_delay and display_delay_enable controls, the legacy private MFC controls are kept for backward compatibility. Acked-by: Marek Szyprowski Signed-off-by: Stanimir Varbanov --- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index a71753d459ba..a92a9ca6e87e 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -167,6 +167,13 @@ static struct mfc_control controls[] = { .step = 1, .default_value = 0, }, + { + .id = V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY, + .type = V4L2_CTRL_TYPE_INTEGER, + .minimum = 0, + .maximum = 16383, + .default_value = 0, + }, { .id = V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE, .type = V4L2_CTRL_TYPE_BOOLEAN, @@ -176,6 +183,13 @@ static struct mfc_control controls[] = { .step = 1, .default_value = 0, }, + { + .id = V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE, + .type = V4L2_CTRL_TYPE_BOOLEAN, + .minimum = 0, + .maximum = 1, + .default_value = 0, + }, { .id = V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER, .type = V4L2_CTRL_TYPE_BOOLEAN, @@ -690,9 +704,11 @@ static int s5p_mfc_dec_s_ctrl(struct v4l2_ctrl *ctrl) switch (ctrl->id) { case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY: + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY: ctx->display_delay = ctrl->val; break; case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE: + case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE: ctx->display_delay_enable = ctrl->val; break; case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: From patchwork Fri Jan 15 09:26:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 12021977 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 B024DC433E0 for ; Fri, 15 Jan 2021 09:28:08 +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 7476C23403 for ; Fri, 15 Jan 2021 09:28:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7476C23403 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=S6srdut4icfnyFOnTX+hdm/jbbJbUVui+1ngn12CK4w=; b=0HM3FaFe/vmLvoGsidyO9a6aZ4 ocOEaHTIR+YO21FTKGc/OlBdmPVtbroUuvfj2tYTPo5sJQpa4B9lePcaqSuAgTKab43sZE8UW21Db RGmkrmOkN3L3kUzNN6vb6Gry7kOs6zv5QXALQJtjWViq3CkXL0KUqqVk1JEIy5erANGFSG2K3o/I5 XSn8H39kT4+u+OUC2Hq77tWPhGl/X+oGPVVLEiDW8F9PxT73Ypm22uiACpvJmTzQCwI9fYWsVngOK HfpNIC2d0uWGdr8oX4zOL2B/bIr487XjTCthyV049na8Xqp3q7jBxG292/htsupCgJ0qoC14ihKog 0Px0r4Mg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNR-000249-EM; Fri, 15 Jan 2021 09:26:41 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0LNG-00021R-Go for linux-arm-kernel@lists.infradead.org; Fri, 15 Jan 2021 09:26:31 +0000 Received: by mail-ed1-x52f.google.com with SMTP id i24so8763183edj.8 for ; Fri, 15 Jan 2021 01:26:29 -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=NPpTp6a6u7fOZ3GfoVMqP0h5qwWkDaaqGx3MQZmmFIU=; b=uMAA8EshSzFzDykdzTxOtz+DOjd9oB+lBVytXRmkeZbkPOvJcWqiycin0jTas0XdPR Abx7o0jv/ZFIpGgUyOdpdwufLQpzCbgh7khYlSroxcprt0ZC//THezzvYBxX15pVrEB0 oC8YMc7jYOYu/9FwnfbCmkgKNocSg3QNnWYKeJBOm1gzE3nYTxNh5snzdRiAgtqFqpZ/ 6NSEnUyZfGsg6A3YXrCXYTcfAFNoGFyCFv4j8EdpzBDAGYkTt6QyNt5RLBS3F2/PtKN8 GTqDetFFpRmSBx2LI3hHvRC4CiBSOnSeRf0L5mu9mJWs94RFTHiAWQ0rVKfea4WUcTdD Y35A== 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=NPpTp6a6u7fOZ3GfoVMqP0h5qwWkDaaqGx3MQZmmFIU=; b=jStN7ec9OZiN9sgjWju05vTymCm8tLu6SAzQnH3IAEIlVtJwVaj0Hpg6oO/7A4upVn /strpO9Z4AsF7DX9sW0yyn7d2AWsMnOzjpWzJmu73YkwzH23OVjlNIhRoF+WAQmcO7F4 ReuQBkAjNXK76cm+UUeF6eZ2FaRwbLVgyWjJWI2U6Sbkmj0qqkxKjMoPq1U7/SxHmofb dduSzHyPRnBl7VvuUmvyhAAhTpk/mklYl7zrnxS/iBM8Vvs+5EBoouZOD1nlC+k1WHkD vNgPS45nHWaLbSnEFVxORy9ORdd24aBwACP2TiLYV+EajPRV2M1/J6QJoXFyNM432sv/ 0raA== X-Gm-Message-State: AOAM530D+LFWZ9YfvIuznhaKcWomZY3no40mR92Kvp8yCLZYE7qZ/k/2 OxlLQvNWRovtGp7maKDxdxAWcg== X-Google-Smtp-Source: ABdhPJw84zuV4cS7/a+LJQv0YdUKaq2TAeJk8mtppmG+PidICGNdaA6qBwFXKRGGNfr0Lj30tSEqiA== X-Received: by 2002:a05:6402:5206:: with SMTP id s6mr7291383edd.92.1610702788407; Fri, 15 Jan 2021 01:26:28 -0800 (PST) Received: from localhost.localdomain (hst-221-63.medicom.bg. [84.238.221.63]) by smtp.gmail.com with ESMTPSA id u24sm3004140eje.71.2021.01.15.01.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 01:26:27 -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 v2 4/4] docs: Deprecate mfc display delay controls Date: Fri, 15 Jan 2021 11:26:07 +0200 Message-Id: <20210115092607.29849-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210115092607.29849-1-stanimir.varbanov@linaro.org> References: <20210115092607.29849-1-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_042630_611458_0D51160C X-CRM114-Status: GOOD ( 12.98 ) 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: Hans Verkuil , Stanimir Varbanov MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Deprecate mfc private display delay and display enable controls for new clients and use the standard controls instead. Signed-off-by: Stanimir Varbanov Acked-by: Hans Verkuil --- .../userspace-api/media/v4l/ext-ctrls-codec.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst index 5d7c47837035..815c6eb4a0d0 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2111,6 +2111,11 @@ MFC 5.1 Control IDs feature can be used for example for generating thumbnails of videos. Applicable to the H264 decoder. + .. note:: + + This control is deprecated. Use the standard + ``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE`` control instead. + ``V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (integer)`` Display delay value for H264 decoder. The decoder is forced to return a decoded frame after the set 'display delay' number of @@ -2118,6 +2123,11 @@ MFC 5.1 Control IDs of display order, in addition the hardware may still be using the returned buffer as a reference picture for subsequent frames. + .. note:: + + This control is deprecated. Use the standard + ``V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY`` control instead. + ``V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (integer)`` The number of reference pictures used for encoding a P picture. Applicable to the H264 encoder.