linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Add base layer priority id control
@ 2021-01-04  5:41 Dikshita Agarwal
  2021-01-04  5:41 ` [PATCH v4 1/2] media: v4l2-ctrl: " Dikshita Agarwal
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dikshita Agarwal @ 2021-01-04  5:41 UTC (permalink / raw)
  To: linux-media, hverkuil-cisco, stanimir.varbanov
  Cc: linux-kernel, linux-arm-msm, vgarodia, Dikshita Agarwal

This series adds base layer priority id control for encoder
and support for the same in venus driver.

Changes since v3:
- Rebased the changes on latest media tree.
- Addressed the comments.
- Added driver side implementation for new control.

Dikshita Agarwal (2):
  media: v4l2-ctrl: Add base layer priority id control.
  venus: venc : Add support for priority ID control.

 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 9 +++++++++
 drivers/media/platform/qcom/venus/core.h                  | 2 ++
 drivers/media/platform/qcom/venus/venc_ctrls.c            | 9 ++++++++-
 drivers/media/v4l2-core/v4l2-ctrls.c                      | 1 +
 include/uapi/linux/v4l2-controls.h                        | 1 +
 5 files changed, 21 insertions(+), 1 deletion(-)

-- 
2.7.4


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

* [PATCH v4 1/2] media: v4l2-ctrl: Add base layer priority id control.
  2021-01-04  5:41 [PATCH v4 0/2] Add base layer priority id control Dikshita Agarwal
@ 2021-01-04  5:41 ` Dikshita Agarwal
  2021-01-04  5:41 ` [PATCH v4 2/2] venus: venc : Add support for priority ID control Dikshita Agarwal
  2021-01-13 16:44 ` [PATCH v4 0/2] Add base layer priority id control Hans Verkuil
  2 siblings, 0 replies; 5+ messages in thread
From: Dikshita Agarwal @ 2021-01-04  5:41 UTC (permalink / raw)
  To: linux-media, hverkuil-cisco, stanimir.varbanov
  Cc: linux-kernel, linux-arm-msm, vgarodia, Dikshita Agarwal

This control indicates the priority id to be applied
to base layer.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 9 +++++++++
 drivers/media/v4l2-core/v4l2-ctrls.c                      | 1 +
 include/uapi/linux/v4l2-controls.h                        | 1 +
 3 files changed, 11 insertions(+)

diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
index 1675bcf..24df818 100644
--- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
+++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst
@@ -3655,3 +3655,12 @@ enum v4l2_mpeg_video_hevc_size_of_length_field -
        This provides a bitmask which consists of bits [0, LTR_COUNT-1].
        This is applicable to H264 and HEVC encoder and can be applied using
        Request Api.
+
+``V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID (integer)``
+    Specifies a priority identifier for the NAL unit, which will be applied to
+    the base layer. By default this value is set to 0 for the base layer,
+    and the next layer will have the priority ID assigned as 1, 2, 3 and so on.
+    The video encoder can't decide the priority id to be applied to a layer,
+    so this has to come from client.
+    This is applicable to H264 and valid Range is from 0 to 63.
+    Source Rec. ITU-T H.264 (06/2019); G.7.4.1.1, G.8.8.1
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 2ad6b5a..9bd795f 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -953,6 +953,7 @@ const char *v4l2_ctrl_get_name(u32 id)
 	case V4L2_CID_MPEG_VIDEO_LTR_COUNT:			return "LTR Count";
 	case V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX:		return "frame LTR index";
 	case V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES:		return "Use LTR Frames";
+	case V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID:		return "Base Layer Priority ID";
 	case V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS:		return "MPEG-2 Slice Parameters";
 	case V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION:		return "MPEG-2 Quantization Matrices";
 	case V4L2_CID_FWHT_I_FRAME_QP:				return "FWHT I-Frame QP Value";
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index c0bb87b..404e69c 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -425,6 +425,7 @@ enum v4l2_mpeg_video_multi_slice_mode {
 #define V4L2_CID_MPEG_VIDEO_LTR_COUNT			(V4L2_CID_CODEC_BASE+230)
 #define V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX		(V4L2_CID_CODEC_BASE+231)
 #define V4L2_CID_MPEG_VIDEO_USE_LTR_FRAMES		(V4L2_CID_CODEC_BASE+232)
+#define V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID	(V4L2_CID_CODEC_BASE+233)
 
 /* CIDs for the MPEG-2 Part 2 (H.262) codec */
 #define V4L2_CID_MPEG_VIDEO_MPEG2_LEVEL			(V4L2_CID_CODEC_BASE+270)
-- 
2.7.4


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

* [PATCH v4 2/2] venus: venc : Add support for priority ID control.
  2021-01-04  5:41 [PATCH v4 0/2] Add base layer priority id control Dikshita Agarwal
  2021-01-04  5:41 ` [PATCH v4 1/2] media: v4l2-ctrl: " Dikshita Agarwal
@ 2021-01-04  5:41 ` Dikshita Agarwal
  2021-01-12  9:44   ` Stanimir Varbanov
  2021-01-13 16:44 ` [PATCH v4 0/2] Add base layer priority id control Hans Verkuil
  2 siblings, 1 reply; 5+ messages in thread
From: Dikshita Agarwal @ 2021-01-04  5:41 UTC (permalink / raw)
  To: linux-media, hverkuil-cisco, stanimir.varbanov
  Cc: linux-kernel, linux-arm-msm, vgarodia, Dikshita Agarwal

Add support for base layer priority ID control in
encoder.
This is a preparation patch to support v6.

Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
---
 drivers/media/platform/qcom/venus/core.h       | 2 ++
 drivers/media/platform/qcom/venus/venc_ctrls.c | 9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 54c42a3..a346ddc 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -274,6 +274,8 @@ struct venc_controls {
 		u32 hevc;
 		u32 vp9;
 	} level;
+
+	u32 base_priority_id;
 };
 
 struct venus_buffer {
diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c
index 7d010d8..3ead51c 100644
--- a/drivers/media/platform/qcom/venus/venc_ctrls.c
+++ b/drivers/media/platform/qcom/venus/venc_ctrls.c
@@ -294,6 +294,9 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
 			return ret;
 		}
 		break;
+	case V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID:
+		ctr->base_priority_id = ctrl->val;
+		break;
 	default:
 		return -EINVAL;
 	}
@@ -309,7 +312,7 @@ int venc_ctrl_init(struct venus_inst *inst)
 {
 	int ret;
 
-	ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 53);
+	ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 54);
 	if (ret)
 		return ret;
 
@@ -523,6 +526,10 @@ int venc_ctrl_init(struct venus_inst *inst)
 			  V4L2_CID_MPEG_VIDEO_FRAME_LTR_INDEX, 0,
 			  (MAX_LTR_FRAME_COUNT - 1), 1, 0);
 
+	v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops,
+			  V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID, 0,
+			  6, 1, 0);
+
 	ret = inst->ctrl_handler.error;
 	if (ret)
 		goto err;
-- 
2.7.4


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

* Re: [PATCH v4 2/2] venus: venc : Add support for priority ID control.
  2021-01-04  5:41 ` [PATCH v4 2/2] venus: venc : Add support for priority ID control Dikshita Agarwal
@ 2021-01-12  9:44   ` Stanimir Varbanov
  0 siblings, 0 replies; 5+ messages in thread
From: Stanimir Varbanov @ 2021-01-12  9:44 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media, hverkuil-cisco, stanimir.varbanov
  Cc: linux-kernel, linux-arm-msm, vgarodia



On 1/4/21 7:41 AM, Dikshita Agarwal wrote:
> Add support for base layer priority ID control in
> encoder.
> This is a preparation patch to support v6.
> 
> Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org>
> ---
>  drivers/media/platform/qcom/venus/core.h       | 2 ++
>  drivers/media/platform/qcom/venus/venc_ctrls.c | 9 ++++++++-
>  2 files changed, 10 insertions(+), 1 deletion(-)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>


-- 
regards,
Stan

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

* Re: [PATCH v4 0/2] Add base layer priority id control
  2021-01-04  5:41 [PATCH v4 0/2] Add base layer priority id control Dikshita Agarwal
  2021-01-04  5:41 ` [PATCH v4 1/2] media: v4l2-ctrl: " Dikshita Agarwal
  2021-01-04  5:41 ` [PATCH v4 2/2] venus: venc : Add support for priority ID control Dikshita Agarwal
@ 2021-01-13 16:44 ` Hans Verkuil
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Verkuil @ 2021-01-13 16:44 UTC (permalink / raw)
  To: Dikshita Agarwal, linux-media, stanimir.varbanov
  Cc: linux-kernel, linux-arm-msm, vgarodia

Hi Dikshita,

On 04/01/2021 06:41, Dikshita Agarwal wrote:
> This series adds base layer priority id control for encoder
> and support for the same in venus driver.

Posted a pull request for this series and the "Add new controls for QP and
layer bitrate" series.

Note that because the "Add encoder ctrls for long term reference" is not
merged, the control ID for V4L2_CID_MPEG_VIDEO_BASELAYER_PRIORITY_ID changed
and that you need to rebase the "Add encoder ctrls for long term reference"
series accordingly.

Regards,

	Hans

> 
> Changes since v3:
> - Rebased the changes on latest media tree.
> - Addressed the comments.
> - Added driver side implementation for new control.
> 
> Dikshita Agarwal (2):
>   media: v4l2-ctrl: Add base layer priority id control.
>   venus: venc : Add support for priority ID control.
> 
>  Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst | 9 +++++++++
>  drivers/media/platform/qcom/venus/core.h                  | 2 ++
>  drivers/media/platform/qcom/venus/venc_ctrls.c            | 9 ++++++++-
>  drivers/media/v4l2-core/v4l2-ctrls.c                      | 1 +
>  include/uapi/linux/v4l2-controls.h                        | 1 +
>  5 files changed, 21 insertions(+), 1 deletion(-)
> 


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

end of thread, other threads:[~2021-01-13 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04  5:41 [PATCH v4 0/2] Add base layer priority id control Dikshita Agarwal
2021-01-04  5:41 ` [PATCH v4 1/2] media: v4l2-ctrl: " Dikshita Agarwal
2021-01-04  5:41 ` [PATCH v4 2/2] venus: venc : Add support for priority ID control Dikshita Agarwal
2021-01-12  9:44   ` Stanimir Varbanov
2021-01-13 16:44 ` [PATCH v4 0/2] Add base layer priority id control Hans Verkuil

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