linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] MFC private ctrls to std ctrls
@ 2021-01-15  9:26 Stanimir Varbanov
  2021-01-15  9:26 ` [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Stanimir Varbanov
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Stanimir Varbanov @ 2021-01-15  9:26 UTC (permalink / raw)
  To: linux-media, linux-kernel, linux-arm-msm, linux-arm-kernel
  Cc: Hans Verkuil, Stanimir Varbanov

Hello,

Changes in v2:

 * use _DEC_ instead of _DECODER_ in the name of the new controls (Hans)
 * rebase on top of media master branch

v1 can be found at [1]

regards,
Stan

[1] https://patchwork.linuxtv.org/project/linux-media/cover/20201109173541.10016-1-stanimir.varbanov@linaro.org/

Stanimir Varbanov (4):
  v4l2-ctrl: Make display delay and display enable std controls
  venus: vdec: Add support for display delay and delay enable controls
  s5p-mfc: Use display delay and display enable std controls
  docs: Deprecate mfc display delay controls

 .../media/v4l/ext-ctrls-codec.rst             | 25 +++++++++++++++++++
 drivers/media/platform/qcom/venus/core.h      |  2 ++
 drivers/media/platform/qcom/venus/vdec.c      | 10 +++++++-
 .../media/platform/qcom/venus/vdec_ctrls.c    | 16 +++++++++++-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c  | 16 ++++++++++++
 drivers/media/v4l2-core/v4l2-ctrls.c          |  4 +++
 include/uapi/linux/v4l2-controls.h            |  3 +++
 7 files changed, 74 insertions(+), 2 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls
  2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
@ 2021-01-15  9:26 ` Stanimir Varbanov
  2021-01-27 12:25   ` Hans Verkuil
  2021-01-15  9:26 ` [PATCH v2 2/4] venus: vdec: Add support for display delay and delay enable controls Stanimir Varbanov
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Stanimir Varbanov @ 2021-01-15  9:26 UTC (permalink / raw)
  To: linux-media, linux-kernel, linux-arm-msm, linux-arm-kernel
  Cc: Hans Verkuil, Stanimir Varbanov

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 <stanimir.varbanov@linaro.org>
---
 .../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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/4] venus: vdec: Add support for display delay and delay enable controls
  2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
  2021-01-15  9:26 ` [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Stanimir Varbanov
@ 2021-01-15  9:26 ` Stanimir Varbanov
  2021-01-15  9:26 ` [PATCH v2 3/4] s5p-mfc: Use display delay and display enable std controls Stanimir Varbanov
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Stanimir Varbanov @ 2021-01-15  9:26 UTC (permalink / raw)
  To: linux-media, linux-kernel, linux-arm-msm, linux-arm-kernel
  Cc: Hans Verkuil, Stanimir Varbanov

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 <stanimir.varbanov@linaro.org>
---
 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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/4] s5p-mfc: Use display delay and display enable std controls
  2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
  2021-01-15  9:26 ` [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Stanimir Varbanov
  2021-01-15  9:26 ` [PATCH v2 2/4] venus: vdec: Add support for display delay and delay enable controls Stanimir Varbanov
@ 2021-01-15  9:26 ` Stanimir Varbanov
  2021-01-15  9:26 ` [PATCH v2 4/4] docs: Deprecate mfc display delay controls Stanimir Varbanov
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Stanimir Varbanov @ 2021-01-15  9:26 UTC (permalink / raw)
  To: linux-media, linux-kernel, linux-arm-msm, linux-arm-kernel
  Cc: Hans Verkuil, Stanimir Varbanov

Use the standard display_delay and display_delay_enable controls,
the legacy private MFC controls are kept for backward compatibility.

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 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:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 4/4] docs: Deprecate mfc display delay controls
  2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
                   ` (2 preceding siblings ...)
  2021-01-15  9:26 ` [PATCH v2 3/4] s5p-mfc: Use display delay and display enable std controls Stanimir Varbanov
@ 2021-01-15  9:26 ` Stanimir Varbanov
  2021-01-27 12:25   ` Hans Verkuil
  2021-01-26 12:56 ` [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
  2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  5 siblings, 1 reply; 9+ messages in thread
From: Stanimir Varbanov @ 2021-01-15  9:26 UTC (permalink / raw)
  To: linux-media, linux-kernel, linux-arm-msm, linux-arm-kernel
  Cc: Hans Verkuil, Stanimir Varbanov

Deprecate mfc private display delay and display enable controls for
new clients and use the standard controls instead.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 .../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.
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/4] MFC private ctrls to std ctrls
  2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
                   ` (3 preceding siblings ...)
  2021-01-15  9:26 ` [PATCH v2 4/4] docs: Deprecate mfc display delay controls Stanimir Varbanov
@ 2021-01-26 12:56 ` Stanimir Varbanov
  2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  5 siblings, 0 replies; 9+ messages in thread
From: Stanimir Varbanov @ 2021-01-26 12:56 UTC (permalink / raw)
  To: Stanimir Varbanov, linux-media, linux-kernel, linux-arm-msm,
	linux-arm-kernel
  Cc: Hans Verkuil

Hans, any comments ?

On 1/15/21 11:26 AM, Stanimir Varbanov wrote:
> Hello,
> 
> Changes in v2:
> 
>  * use _DEC_ instead of _DECODER_ in the name of the new controls (Hans)
>  * rebase on top of media master branch
> 
> v1 can be found at [1]
> 
> regards,
> Stan
> 
> [1] https://patchwork.linuxtv.org/project/linux-media/cover/20201109173541.10016-1-stanimir.varbanov@linaro.org/
> 
> Stanimir Varbanov (4):
>   v4l2-ctrl: Make display delay and display enable std controls
>   venus: vdec: Add support for display delay and delay enable controls
>   s5p-mfc: Use display delay and display enable std controls
>   docs: Deprecate mfc display delay controls
> 
>  .../media/v4l/ext-ctrls-codec.rst             | 25 +++++++++++++++++++
>  drivers/media/platform/qcom/venus/core.h      |  2 ++
>  drivers/media/platform/qcom/venus/vdec.c      | 10 +++++++-
>  .../media/platform/qcom/venus/vdec_ctrls.c    | 16 +++++++++++-
>  drivers/media/platform/s5p-mfc/s5p_mfc_dec.c  | 16 ++++++++++++
>  drivers/media/v4l2-core/v4l2-ctrls.c          |  4 +++
>  include/uapi/linux/v4l2-controls.h            |  3 +++
>  7 files changed, 74 insertions(+), 2 deletions(-)
> 

-- 
regards,
Stan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls
  2021-01-15  9:26 ` [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Stanimir Varbanov
@ 2021-01-27 12:25   ` Hans Verkuil
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Verkuil @ 2021-01-27 12:25 UTC (permalink / raw)
  To: Stanimir Varbanov, linux-media, linux-kernel, linux-arm-msm,
	linux-arm-kernel

On 15/01/2021 10:26, Stanimir Varbanov wrote:
> 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 <stanimir.varbanov@linaro.org>

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Thanks!

	Hans

> ---
>  .../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)
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 4/4] docs: Deprecate mfc display delay controls
  2021-01-15  9:26 ` [PATCH v2 4/4] docs: Deprecate mfc display delay controls Stanimir Varbanov
@ 2021-01-27 12:25   ` Hans Verkuil
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Verkuil @ 2021-01-27 12:25 UTC (permalink / raw)
  To: Stanimir Varbanov, linux-media, linux-kernel, linux-arm-msm,
	linux-arm-kernel

On 15/01/2021 10:26, Stanimir Varbanov wrote:
> Deprecate mfc private display delay and display enable controls for
> new clients and use the standard controls instead.
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Thanks!

	Hans

> ---
>  .../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.
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/4] MFC private ctrls to std ctrls
  2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
                   ` (4 preceding siblings ...)
  2021-01-26 12:56 ` [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
@ 2021-05-26 19:03 ` patchwork-bot+linux-arm-msm
  5 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2021-05-26 19:03 UTC (permalink / raw)
  To: Stanimir Varbanov; +Cc: linux-arm-msm

Hello:

This series was applied to qcom/linux.git (refs/heads/for-next):

On Fri, 15 Jan 2021 11:26:03 +0200 you wrote:
> Hello,
> 
> Changes in v2:
> 
>  * use _DEC_ instead of _DECODER_ in the name of the new controls (Hans)
>  * rebase on top of media master branch
> 
> [...]

Here is the summary with links:
  - [v2,1/4] v4l2-ctrl: Make display delay and display enable std controls
    https://git.kernel.org/qcom/c/9f3d1056ea54
  - [v2,2/4] venus: vdec: Add support for display delay and delay enable controls
    https://git.kernel.org/qcom/c/8ec0b7b0b598
  - [v2,3/4] s5p-mfc: Use display delay and display enable std controls
    https://git.kernel.org/qcom/c/c3042bff918a
  - [v2,4/4] docs: Deprecate mfc display delay controls
    https://git.kernel.org/qcom/c/644bcc0315f2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-26 19:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15  9:26 [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
2021-01-15  9:26 ` [PATCH v2 1/4] v4l2-ctrl: Make display delay and display enable std controls Stanimir Varbanov
2021-01-27 12:25   ` Hans Verkuil
2021-01-15  9:26 ` [PATCH v2 2/4] venus: vdec: Add support for display delay and delay enable controls Stanimir Varbanov
2021-01-15  9:26 ` [PATCH v2 3/4] s5p-mfc: Use display delay and display enable std controls Stanimir Varbanov
2021-01-15  9:26 ` [PATCH v2 4/4] docs: Deprecate mfc display delay controls Stanimir Varbanov
2021-01-27 12:25   ` Hans Verkuil
2021-01-26 12:56 ` [PATCH v2 0/4] MFC private ctrls to std ctrls Stanimir Varbanov
2021-05-26 19:03 ` patchwork-bot+linux-arm-msm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).