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: 68754 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1kcB5v-004fYv-EI; Mon, 09 Nov 2020 17:36:44 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732276AbgKIRgk (ORCPT + 1 other); Mon, 9 Nov 2020 12:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731962AbgKIRgG (ORCPT ); Mon, 9 Nov 2020 12:36:06 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 956EEC0613D6 for ; Mon, 9 Nov 2020 09:36:05 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id t9so6267261edq.8 for ; Mon, 09 Nov 2020 09:36:05 -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=iKbmmtuHH5UBtK/zozQLwE4ip+a5pNRFiR9hhwS71bPJ4Smnpw7Pd/FJXtLgSglqFJ HmWPiwRGz3mr+C6vLWkVWc2doVi8f7nn9tUQm4EhyAly1V+NGEbLmFqbHfPBszPru7yQ 6pgiWjHuLrSRhKYe/5Y1UV7qL1i9x1xWavQhVB2mxWG18K83fW1b+bgTmI7gW7RORF5H cJ9q87BzAWdwxqDn7DiEtZ3VFLDEbD1IFGxVtioQT9Dr1zd7Yz/aYABl/e7IVHHecxnM +Mb1H2X3u2ZzrsW+WxVcJ1+Z+XopIBsZ0/r7U2hS6mkl+tuqARIeLCUXFxeii10TLVgG nLWw== X-Gm-Message-State: AOAM531TP+JHuuszVahx1P6BV7n4s2NKWFBnqTF5THVxN6RWaAjHL6zg r2ju24CAyVin4bNCb847ZJBXRPha2UPW/Yo7 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 Cc: Kyungmin Park , Kamil Debski , Hans Verkuil , Ezequiel Garcia , Nicolas Dufresne , Marek Szyprowski , Stanimir Varbanov 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> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no 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) From patchwork Mon Nov 9 17:35:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 68752 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1kcB5V-004fYG-Os; Mon, 09 Nov 2020 17:36:18 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732153AbgKIRgO (ORCPT + 1 other); Mon, 9 Nov 2020 12:36:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731969AbgKIRgH (ORCPT ); Mon, 9 Nov 2020 12:36:07 -0500 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 344FEC0613D4 for ; Mon, 9 Nov 2020 09:36:06 -0800 (PST) Received: by mail-ej1-x644.google.com with SMTP id za3so13460999ejb.5 for ; Mon, 09 Nov 2020 09:36:06 -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=pFnWMBmOgfjRF3Cwrlx3uYofQt37aDdlePhMz4xU5fM=; b=iqaR9WXs1bpO3jxfnrqog2V3ZZ8NOeRIH1JbfpsU9eKC9o235qvTuKsqCqlmJgcOBw pbxE10HHH1JwPmFc67hRNVCOhSr8dplvvLeDmbpc5ysEas6Ms1+jtfNlPx+WkvfOAGhm 4aBXO1QP4IafcuJ2LfpGCM4G/M3jQRaTWj92+SohjcOTyUk2sEUzdE8aC+hde4ZT5Ygg RgaxXMEpqLD1r3RUAlMR656YhCshu7WssWky6m0OVkdyX2/h5snkzfoMsFIiS3nwDfax 7NRlWT96bzk7h7PT5uNlk1pK5ydXXtYiQO+XgMbHpxt8jkc8pOnDCFX9w8k9sVAx232O fkOA== 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=pFnWMBmOgfjRF3Cwrlx3uYofQt37aDdlePhMz4xU5fM=; b=U3WV/qavbcNerk5SdR3vS3jLKTt4VQGhOiyaV7rbWstgIHfMZOQowLnKUbqP6GXTjy 0Wbvk++UAp438vjD/8iwGWdwxninVS7R8ocE4VUwgEzjWOO3qWtMW7gFLWAj1wZ6aSOe m/9wgxZlZU1fumahla+EwhDoqp6ui3EHVLenu0pcVuRMJCyKaTQUafKhuQVEZTdjH2YS KJW0p4NtkYp38PAdS2ySKUKfp2+vo4sRB3QWyMwpVSp86oOoHaYEP2RVLWWh8aFO6F44 H5YopzMBvt9ZIyNHck6g9/cuhE7GD14ZenPGrzbMpaHsZUzY0PabU7ClssMUUi5CaFri +gDw== X-Gm-Message-State: AOAM531BEk/zCwNjcXFVmHiQDBGJ7StutfKNG1u+NYTNE+MkuIOnozDv M5z0XuTREmCUJ5fLycYGwFxtw4iJZWcjwdyy X-Google-Smtp-Source: ABdhPJxUPFj4nGgGSzK1G1qrofBnlrXVnJNZzohF8BBx7bAX1rdpztMMWitJOyO4ATH/RlME7Q/nRw== X-Received: by 2002:a17:906:1b09:: with SMTP id o9mr16814643ejg.79.1604943364389; Mon, 09 Nov 2020 09:36:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 09:36:03 -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 Cc: Kyungmin Park , Kamil Debski , Hans Verkuil , Ezequiel Garcia , Nicolas Dufresne , Marek Szyprowski , Stanimir Varbanov Subject: [PATCH 2/4] venus: vdec: Add support for display delay and delay enable controls Date: Mon, 9 Nov 2020 19:35:39 +0200 Message-Id: <20201109173541.10016-3-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> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no 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 7b79a33dc9d6..a57fb6f70e61 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -210,6 +210,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 ea13170a6a2c..1b3b819ccc83 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -615,7 +615,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) { @@ -625,6 +625,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..e1378532dec8 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_DECODER_DISPLAY_DELAY: + ctr->display_delay = ctrl->val; + break; + case V4L2_CID_MPEG_VIDEO_DECODER_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_DECODER_DISPLAY_DELAY, + 0, 16383, 1, 0); + + v4l2_ctrl_new_std(&inst->ctrl_handler, &vdec_ctrl_ops, + V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY_ENABLE, + 0, 1, 1, 0); + ret = inst->ctrl_handler.error; if (ret) { v4l2_ctrl_handler_free(&inst->ctrl_handler); From patchwork Mon Nov 9 17:35:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 68753 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1kcB5X-004fYG-2r; Mon, 09 Nov 2020 17:36:19 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732163AbgKIRgR (ORCPT + 1 other); Mon, 9 Nov 2020 12:36:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732069AbgKIRgJ (ORCPT ); Mon, 9 Nov 2020 12:36:09 -0500 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42F35C0617A6 for ; Mon, 9 Nov 2020 09:36:07 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id o20so9669289eds.3 for ; Mon, 09 Nov 2020 09:36:07 -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=SsKi06aFz0HTo2Yl+cJME4oxrb6MxPsHXouTbem6RGI=; b=BFxRxbsn5xdgpJDxro2qTxpz/f0nOnFDLq48DGON105z4GLn5pgjkZnbCOd9mCkkZJ CRI0u8Or6ciO+QGVcFfMZ1RJovaGb7gOfORQp3Yv+95GSQ729HL+ZPkBSlN4p2BoJJOu aDMvNBe7de5MnwHxmWaio5Z6fbRhA3U3uIs0GyhYJ5WqAkRnJ/xmylnSx/Nzu2utmZck EBlHZp5yLxaMGD2b47Thvh57MEwg3LhvhFAkTNuys+cwXZUGrTHaOJ0uBGtz5nUlpsLX 9DvrAh/iAVOBaboXZsGireRxpymIWivTswiOZwjPQ09vE3FrOKoslXyiCLTQmHHUGNo0 0Qcg== 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=SsKi06aFz0HTo2Yl+cJME4oxrb6MxPsHXouTbem6RGI=; b=gY0f/Imv+oD+YYXjlw9Q3E+KiQ2AOMW2hICdrESQAgRd/McIysKti/HGO4wxXrnhcy oQ3TievVXownZZgP1OBbXpvM99ch8wQs7WPtdd2Vvs7RqY/U4v1dtpzMIIowfp92fB4R vCT1TjK3XEUCn26sdOCdMq4iR8doL7P4HwJ2AJrfhmQTtMT24puzEM3bl9KqdBdMRUFZ x8febkl2vrdarYvOrM5Y2N1Q4bhKsBnArHY+hNfa6ISNjaolQwPKrVaRomiBtlfVQDrn WpwxUAIz/W19cV8xszQF04/cGI8rkySAoS+WrEqunXKSLe9KCgWFeyAMSZMGUHrXaztq Ljog== X-Gm-Message-State: AOAM533ON2CF4qvxfqvIDUObFjP1w7kCTRu0/8QYyTyHDszKTJbowbJf C5HLBfficj2UzrLSqqtw7yoc77cl2TL7ke6m X-Google-Smtp-Source: ABdhPJxJEqEwcqxwZ5dDOkeXSSn849iNUGTNFrtdZ1oAB0tJBm9PPvPsx4rxq4gFloPMZs4n3fi/jQ== X-Received: by 2002:a50:eb0a:: with SMTP id y10mr17307631edp.342.1604943365785; Mon, 09 Nov 2020 09:36:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 09:36:05 -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 Cc: Kyungmin Park , Kamil Debski , Hans Verkuil , Ezequiel Garcia , Nicolas Dufresne , Marek Szyprowski , Stanimir Varbanov Subject: [PATCH 3/4] s5p-mfc: Use display delay and display enable std controls Date: Mon, 9 Nov 2020 19:35:40 +0200 Message-Id: <20201109173541.10016-4-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> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Use the standard display_delay and display_delay_enable controls, the legacy private MFC controls are kept for backward compatibility. Signed-off-by: Stanimir Varbanov Acked-by: Marek Szyprowski --- 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 61e144a35201..4a3e8e9bbff2 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_DECODER_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_DECODER_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_DECODER_DISPLAY_DELAY: ctx->display_delay = ctrl->val; break; case V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE: + case V4L2_CID_MPEG_VIDEO_DECODER_DISPLAY_DELAY_ENABLE: ctx->display_delay_enable = ctrl->val; break; case V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER: From patchwork Mon Nov 9 17:35:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 68755 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1kcB5x-004fYv-34; Mon, 09 Nov 2020 17:36:46 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732223AbgKIRgk (ORCPT + 1 other); Mon, 9 Nov 2020 12:36:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732068AbgKIRgI (ORCPT ); Mon, 9 Nov 2020 12:36:08 -0500 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D2AEC0613CF for ; Mon, 9 Nov 2020 09:36:08 -0800 (PST) Received: by mail-ej1-x643.google.com with SMTP id oq3so13450181ejb.7 for ; Mon, 09 Nov 2020 09:36:08 -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=L9F3HkMW13rcGTb3bzExEGKic5ytenCIez631dN7HLE=; b=PitAaj9RXayVuhqFAVZImb2FJzaptvJrhnw4hRd7qLhtpHZt3/13gByfP2V52MOaUX aH5Y7+o8Wug0hJs2gyg/kpATu+uz4xGJqpaA+qMwMJNMx93z7o1RSZbdhe60teDElpma MZWjsED9bHeNSqbizQ32mr7FDj01m120ZIF+PLqQ2hWlxXqmbfq7/C7qIMbzCia4vpk0 wNo+WpH7HTWxUI88xYoFekEvbl+0OmG3mqHshaIormsO/9qngltHSg3J2kMiMZiybVvo rnnAax8INabenQwe0yl5nNUwZISmh+wVD3Xw0HE3/3I67qQhxFnAtuHbilgLmxjQDOnA wLSQ== 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=L9F3HkMW13rcGTb3bzExEGKic5ytenCIez631dN7HLE=; b=VY5dMUKl7TPoWDxiaxshCo39m82DbHzTM/tpO1SQYuP6surzE36/09ykH8n5X0vvHL OG6II1vL1qkBr3ZagT2ChRgee0YYYdr5W0Pt+gpFzZc0Pk96R3NMcUEQJRVeQcFZM2y/ spZmJtbvxmjqwGQMK7ec5OcWODVPBVJLJGgJCrFkI8VqglPz1LaTm5cuhSSuHBH4a46S fBzyDyTdnhH3LfIaer2Nm8xiaC7YpDXyog6Y0TByOiPue2KZxj/vR9xW3qmZuqNSJ+b+ hl5UVH543usLAl8erS4BcH/Lzz6xo8WeHDDirxel38RbmGe1bpv7CUGgaUZvn0DGgrUv P7nw== X-Gm-Message-State: AOAM532DD+5kcXtTGngw+2atc/Ygf//kvXhc3seWFKKqoik5t+7JeNw1 1qoco5Z9CqhOr/dyWK/xvJqcX2u1vFpKUYKs X-Google-Smtp-Source: ABdhPJyPOQ+Ryay5dRFIcvl4AnOiW4HTmIeH+B3sow5u7A2Zn8mHc5EEGOQcqZwKV+qqfynNNsUwQQ== X-Received: by 2002:a17:906:1381:: with SMTP id f1mr15609974ejc.87.1604943367038; Mon, 09 Nov 2020 09:36:07 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 09:36:06 -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 Cc: Kyungmin Park , Kamil Debski , Hans Verkuil , Ezequiel Garcia , Nicolas Dufresne , Marek Szyprowski , Stanimir Varbanov Subject: [PATCH 4/4] docs: Deprecate mfc display delay controls Date: Mon, 9 Nov 2020 19:35:41 +0200 Message-Id: <20201109173541.10016-5-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> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no Deprecate mfc private display delay and display enable controls for new clients and use the standard controls instead. Signed-off-by: Stanimir Varbanov --- .../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 82c9cda40270..b8f69c52b2a2 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2771,6 +2771,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_DECODER_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 @@ -2778,6 +2783,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_DECODER_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.