Skip to contentSkip to conversation

wave5 codec driver

PATCH Superseded jackson.lee 2 participants 10 messages Mar 11, 2024 – Mar 13, 2024

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

jackson.lee

author maintainer
#0 lore raw

v2 cover wave5 codec driver

From: "Jackson.lee" <[email protected]>

The wave5 codec driver is a stateful encoder/decoder.
The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things.

v4l2-compliance results:
========================

v4l2-compliance 1.24.1, 64 bits, 64-bit time_t

Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded: 45, Failed: 0, Warnings: 0

Fluster test results:
=====================

Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 132/147 tests successfully in 94.782 secs

(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 77/135 tests successfully in 37.364 secs

(58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)

Chnage since v1:
=================

* For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR
- define a macro for register addresses

* For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume
- add auto suspend/resume

* For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage
- use helper functions to calculate bytesperline and sizeimage

* For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder
- remove unnecessary codes

Change since v0:
=================
The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line.

Jackson.lee (4):
media: chips-media: wave5: Support SPS/PPS generation for each IDR
media: chips-media: wave5: Support runtime suspend/resume
media: chips-media: wave5: Use helpers to calculate bytesperline and
sizeimage.
media: chips-media: wave5: Support YUV422 raw pixel-formats on the
encoder.

 .../platform/chips-media/wave5/wave5-helper.c |  24 ++
 .../platform/chips-media/wave5/wave5-helper.h |   4 +
 .../platform/chips-media/wave5/wave5-hw.c     |  23 +-
 .../chips-media/wave5/wave5-vpu-dec.c         | 261 +++++-------------
 .../chips-media/wave5/wave5-vpu-enc.c         | 260 +++++++++--------
 .../platform/chips-media/wave5/wave5-vpu.c    |  43 +++
 .../platform/chips-media/wave5/wave5-vpu.h    |   4 -
 .../platform/chips-media/wave5/wave5-vpuapi.c |  14 +-
 .../platform/chips-media/wave5/wave5-vpuapi.h |   1 +
 .../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
 .../media/platform/chips-media/wave5/wave5.h  |   3 +
 11 files changed, 329 insertions(+), 333 deletions(-)
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH v2 1/4 media: chips-media: wave5: Support SPS/PPS generation for each IDR

From: "Jackson.lee" <[email protected]>

Provide a control to toggle (0 = off / 1 = on), whether the SPS and PPS are generated for every IDR.

---
 .../platform/chips-media/wave5/wave5-hw.c     | 19 +++++++++++++++----
 .../chips-media/wave5/wave5-vpu-enc.c         |  7 +++++++
 .../platform/chips-media/wave5/wave5-vpuapi.h |  1 +
 3 files changed, 23 insertions(+), 4 deletions(-)
drivers/media/platform/chips-media/wave5/wave5-hw.c +15 -4
index f1e022fb148e..4a262822bf17 100644
@@ -23,6 +23,15 @@
 #define FEATURE_AVC_ENCODER		BIT(1)
 #define FEATURE_HEVC_ENCODER		BIT(0)
 
+#define ENC_AVC_INTRA_IDR_PARAM_MASK	0x7ff
+#define ENC_AVC_INTRA_PERIOD		6
+#define ENC_AVC_IDR_PERIOD		17
+#define ENC_AVC_FORCED_IDR_HEADER	28
+
+#define ENC_HEVC_INTRA_QP		3
+#define ENC_HEVC_FORCED_IDR_HEADER	9
+#define ENC_HEVC_INTRA_PERIOD		16
+
 /* Decoder support fields */
 #define FEATURE_AVC_DECODER		BIT(3)
 #define FEATURE_HEVC_DECODER		BIT(2)
@@ -1601,12 +1610,14 @@ int wave5_vpu_enc_init_seq(struct vpu_instance *inst)
 
 	if (inst->std == W_AVC_ENC)
 		vpu_write_reg(inst->dev, W5_CMD_ENC_SEQ_INTRA_PARAM, p_param->intra_qp |
-				((p_param->intra_period & 0x7ff) << 6) |
-				((p_param->avc_idr_period & 0x7ff) << 17));
+				((p_param->intra_period & ENC_AVC_INTRA_IDR_PARAM_MASK) << ENC_AVC_INTRA_PERIOD) |
+				((p_param->avc_idr_period & ENC_AVC_INTRA_IDR_PARAM_MASK) << ENC_AVC_IDR_PERIOD) |
+				(p_param->forced_idr_header_enable << ENC_AVC_FORCED_IDR_HEADER));
 	else if (inst->std == W_HEVC_ENC)
 		vpu_write_reg(inst->dev, W5_CMD_ENC_SEQ_INTRA_PARAM,
-			      p_param->decoding_refresh_type | (p_param->intra_qp << 3) |
-				(p_param->intra_period << 16));
+			      p_param->decoding_refresh_type | (p_param->intra_qp << ENC_HEVC_INTRA_QP) |
+			      (p_param->forced_idr_header_enable << ENC_HEVC_FORCED_IDR_HEADER) |
+			      (p_param->intra_period << ENC_HEVC_INTRA_PERIOD));
 
 	reg_val = (p_param->rdo_skip << 2) |
 		(p_param->lambda_scaling_enable << 3) |
drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +7 -0
index f29cfa3af94a..f04baa93a9b7 100644
@@ -1061,6 +1061,9 @@ static int wave5_vpu_enc_s_ctrl(struct v4l2_ctrl *ctrl)
 	case V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE:
 		inst->enc_param.entropy_coding_mode = ctrl->val;
 		break;
+	case V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR:
+		inst->enc_param.forced_idr_header_enable = ctrl->val;
+		break;
 	case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT:
 		break;
 	default:
@@ -1219,6 +1222,7 @@ static void wave5_set_enc_openparam(struct enc_open_param *open_param,
 		else
 			open_param->wave_param.intra_refresh_arg = num_ctu_row;
 	}
+	open_param->wave_param.forced_idr_header_enable = input.forced_idr_header_enable;
 }
 
 static int initialize_sequence(struct vpu_instance *inst)
@@ -1702,6 +1706,9 @@ static int wave5_vpu_open_enc(struct file *filp)
 			  0, 1, 1, 0);
 	v4l2_ctrl_new_std(v4l2_ctrl_hdl, &wave5_vpu_enc_ctrl_ops,
 			  V4L2_CID_MIN_BUFFERS_FOR_OUTPUT, 1, 32, 1, 1);
+	v4l2_ctrl_new_std(v4l2_ctrl_hdl, &wave5_vpu_enc_ctrl_ops,
+			  V4L2_CID_MPEG_VIDEO_PREPEND_SPSPPS_TO_IDR,
+			  0, 1, 1, 0);
 
 	if (v4l2_ctrl_hdl->error) {
 		ret = -ENODEV;
drivers/media/platform/chips-media/wave5/wave5-vpuapi.h +1 -0
index 352f6e904e50..3ad6118550ac 100644
@@ -566,6 +566,7 @@ struct enc_wave_param {
 	u32 lambda_scaling_enable: 1; /* enable lambda scaling using custom GOP */
 	u32 transform8x8_enable: 1; /* enable 8x8 intra prediction and 8x8 transform */
 	u32 mb_level_rc_enable: 1; /* enable MB-level rate control */
+	u32 forced_idr_header_enable: 1; /* enable header encoding before IDR frame */
 };
 
 struct enc_open_param {
Signature · 1 line
2.43.0
author maintainer
#2 lore raw

PATCH v2 2/4 media: chips-media: wave5: Support runtime suspend/resume

In reply to jackson.lee

From: "Jackson.lee" <[email protected]>

For saving a power resource, we support runtime suspend/resume for an encoder/decoder. So our vpu module's power turns on only if an encoder/decoder is used.

---
 .../platform/chips-media/wave5/wave5-hw.c     |  4 +-
 .../chips-media/wave5/wave5-vpu-dec.c         | 16 ++++++-
 .../chips-media/wave5/wave5-vpu-enc.c         | 15 +++++++
 .../platform/chips-media/wave5/wave5-vpu.c    | 43 +++++++++++++++++++
 .../platform/chips-media/wave5/wave5-vpuapi.c | 14 ++++--
 .../media/platform/chips-media/wave5/wave5.h  |  3 ++
 6 files changed, 88 insertions(+), 7 deletions(-)
drivers/media/platform/chips-media/wave5/wave5-hw.c +2 -2
index 4a262822bf17..826b92b7b582 100644
@@ -1084,8 +1084,8 @@ int wave5_vpu_re_init(struct device *dev, u8 *fw, size_t size)
 	return setup_wave5_properties(dev);
 }
 
-static int wave5_vpu_sleep_wake(struct device *dev, bool i_sleep_wake, const uint16_t *code,
-				size_t size)
+int wave5_vpu_sleep_wake(struct device *dev, bool i_sleep_wake, const uint16_t *code,
+			 size_t size)
 {
 	u32 reg_val;
 	struct vpu_buf *common_vb;
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +14 -2
index ef227af72348..a199877c643b 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2021-2023 CHIPS&MEDIA INC
  */
 
+#include <linux/pm_runtime.h>
 #include "wave5-helper.h"
 
 #define VPU_DEC_DEV_NAME "C&M Wave5 VPU decoder"
@@ -518,6 +519,8 @@ static void wave5_vpu_dec_finish_decode(struct vpu_instance *inst)
 	if (q_status.report_queue_count == 0 &&
 	    (q_status.instance_queue_count == 0 || dec_info.sequence_changed)) {
 		dev_dbg(inst->dev->dev, "%s: finishing job.\n", __func__);
+		pm_runtime_mark_last_busy(inst->dev->dev);
+		pm_runtime_put_autosuspend(inst->dev->dev);
 		v4l2_m2m_job_finish(inst->v4l2_m2m_dev, m2m_ctx);
 	}
 }
@@ -1382,6 +1385,7 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count
 	int ret = 0;
 
 	dev_dbg(inst->dev->dev, "%s: type: %u\n", __func__, q->type);
+	pm_runtime_resume_and_get(inst->dev->dev);
 
 	v4l2_m2m_update_start_streaming_state(m2m_ctx, q);
 
@@ -1425,13 +1429,15 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count
 			}
 		}
 	}
-
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 	return ret;
 
 free_bitstream_vbuf:
 	wave5_vdi_free_dma_memory(inst->dev, &inst->bitstream_vbuf);
 return_buffers:
 	wave5_return_bufs(q, VB2_BUF_STATE_QUEUED);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 	return ret;
 }
 
@@ -1517,6 +1523,7 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)
 	bool check_cmd = TRUE;
 
 	dev_dbg(inst->dev->dev, "%s: type: %u\n", __func__, q->type);
+	pm_runtime_resume_and_get(inst->dev->dev);
 
 	while (check_cmd) {
 		struct queue_status_info q_status;
@@ -1540,6 +1547,9 @@ static void wave5_vpu_dec_stop_streaming(struct vb2_queue *q)
 		streamoff_output(q);
 	else
 		streamoff_capture(q);
+
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 }
 
 static const struct vb2_ops wave5_vpu_dec_vb2_ops = {
@@ -1626,7 +1636,7 @@ static void wave5_vpu_dec_device_run(void *priv)
 	int ret = 0;
 
 	dev_dbg(inst->dev->dev, "%s: Fill the ring buffer with new bitstream data", __func__);
-
+	pm_runtime_resume_and_get(inst->dev->dev);
 	ret = fill_ringbuffer(inst);
 	if (ret) {
 		dev_warn(inst->dev->dev, "Filling ring buffer failed\n");
@@ -1709,6 +1719,8 @@ static void wave5_vpu_dec_device_run(void *priv)
 
 finish_job_and_return:
 	dev_dbg(inst->dev->dev, "%s: leave and finish job", __func__);
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 	v4l2_m2m_job_finish(inst->v4l2_m2m_dev, m2m_ctx);
 }
 
drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +15 -0
index f04baa93a9b7..013e2bb37fbb 100644
@@ -5,6 +5,7 @@
  * Copyright (C) 2021-2023 CHIPS&MEDIA INC
  */
 
+#include <linux/pm_runtime.h>
 #include "wave5-helper.h"
 
 #define VPU_ENC_DEV_NAME "C&M Wave5 VPU encoder"
@@ -1310,6 +1311,7 @@ static int wave5_vpu_enc_start_streaming(struct vb2_queue *q, unsigned int count
 	struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx;
 	int ret = 0;
 
+	pm_runtime_resume_and_get(inst->dev->dev);
 	v4l2_m2m_update_start_streaming_state(m2m_ctx, q);
 
 	if (inst->state == VPU_INST_STATE_NONE && q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
@@ -1364,9 +1366,13 @@ static int wave5_vpu_enc_start_streaming(struct vb2_queue *q, unsigned int count
 	if (ret)
 		goto return_buffers;
 
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 	return 0;
 return_buffers:
 	wave5_return_bufs(q, VB2_BUF_STATE_QUEUED);
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 	return ret;
 }
 
@@ -1408,6 +1414,7 @@ static void wave5_vpu_enc_stop_streaming(struct vb2_queue *q)
 	 */
 
 	dev_dbg(inst->dev->dev, "%s: type: %u\n", __func__, q->type);
+	pm_runtime_resume_and_get(inst->dev->dev);
 
 	if (wave5_vpu_both_queues_are_streaming(inst))
 		switch_state(inst, VPU_INST_STATE_STOP);
@@ -1432,6 +1439,9 @@ static void wave5_vpu_enc_stop_streaming(struct vb2_queue *q)
 		streamoff_output(inst, q);
 	else
 		streamoff_capture(inst, q);
+
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 }
 
 static const struct vb2_ops wave5_vpu_enc_vb2_ops = {
@@ -1478,6 +1488,7 @@ static void wave5_vpu_enc_device_run(void *priv)
 	u32 fail_res = 0;
 	int ret = 0;
 
+	pm_runtime_resume_and_get(inst->dev->dev);
 	switch (inst->state) {
 	case VPU_INST_STATE_PIC_RUN:
 		ret = start_encode(inst, &fail_res);
@@ -1491,6 +1502,8 @@ static void wave5_vpu_enc_device_run(void *priv)
 			break;
 		}
 		dev_dbg(inst->dev->dev, "%s: leave with active job", __func__);
+		pm_runtime_mark_last_busy(inst->dev->dev);
+		pm_runtime_put_autosuspend(inst->dev->dev);
 		return;
 	default:
 		WARN(1, "Execution of a job in state %s is invalid.\n",
@@ -1498,6 +1511,8 @@ static void wave5_vpu_enc_device_run(void *priv)
 		break;
 	}
 	dev_dbg(inst->dev->dev, "%s: leave and finish job", __func__);
+	pm_runtime_mark_last_busy(inst->dev->dev);
+	pm_runtime_put_autosuspend(inst->dev->dev);
 	v4l2_m2m_job_finish(inst->v4l2_m2m_dev, m2m_ctx);
 }
 
drivers/media/platform/chips-media/wave5/wave5-vpu.c +43 -0

73 lines not on this page · raw message

drivers/media/platform/chips-media/wave5/wave5-vpuapi.c +11 -3
index 1a3efb638dde..b0911fef232f 100644
@@ -6,6 +6,8 @@
  */
 
 #include <linux/bug.h>
+#include <linux/pm_runtime.h>
+#include <linux/delay.h>
 #include "wave5-vpuapi.h"
 #include "wave5-regdefine.h"
 #include "wave5.h"
@@ -200,9 +202,13 @@ int wave5_vpu_dec_close(struct vpu_instance *inst, u32 *fail_res)
 	if (!inst->codec_info)
 		return -EINVAL;
 
+	pm_runtime_resume_and_get(inst->dev->dev);
+
 	ret = mutex_lock_interruptible(&vpu_dev->hw_lock);
-	if (ret)
+	if (ret) {
+		pm_runtime_put_sync(inst->dev->dev);
 		return ret;
+	}
 
 	do {
 		ret = wave5_vpu_dec_finish_seq(inst, fail_res);
@@ -234,7 +240,7 @@ int wave5_vpu_dec_close(struct vpu_instance *inst, u32 *fail_res)
 
 unlock_and_return:
 	mutex_unlock(&vpu_dev->hw_lock);
-
+	pm_runtime_put_sync(inst->dev->dev);
 	return ret;
 }
 
@@ -702,6 +708,8 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
 	if (!inst->codec_info)
 		return -EINVAL;
 
+	pm_runtime_resume_and_get(inst->dev->dev);
+
 	ret = mutex_lock_interruptible(&vpu_dev->hw_lock);
 	if (ret)
 		return ret;
@@ -733,9 +741,9 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
 	}
 
 	wave5_vdi_free_dma_memory(vpu_dev, &p_enc_info->vb_task);
-
 	mutex_unlock(&vpu_dev->hw_lock);
 
+	pm_runtime_put_sync(inst->dev->dev);
 	return 0;
 }
 
drivers/media/platform/chips-media/wave5/wave5.h +3 -0
index 063028eccd3b..6125eff938a8 100644
@@ -56,6 +56,9 @@ int wave5_vpu_get_version(struct vpu_device *vpu_dev, u32 *revision);
 
 int wave5_vpu_init(struct device *dev, u8 *fw, size_t size);
 
+int wave5_vpu_sleep_wake(struct device *dev, bool i_sleep_wake, const uint16_t *code,
+			 size_t size);
+
 int wave5_vpu_reset(struct device *dev, enum sw_reset_mode reset_mode);
 
 int wave5_vpu_build_up_dec_param(struct vpu_instance *inst, struct dec_open_param *param);
Signature · 1 line
2.43.0
author maintainer
#3 lore raw

PATCH v2 3/4 media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage.

In reply to jackson.lee

From: "Jackson.lee" <[email protected]>

Use v4l2-common helper functions to calculate bytesperline and sizeimage, instead of calculating in a wave5 driver directly. In case of raw(YUV) v4l2_pix_format, the wave5 driver updates v4l2_pix_format_mplane struct through v4l2_fill_pixfmt_mp() function. Encoder and Decoder need same bytesperline and sizeimage values for same v4l2_pix_format.
So, a wave5_update_pix_fmt is refactored to support both together.

---
 .../platform/chips-media/wave5/wave5-helper.c |  24 ++
 .../platform/chips-media/wave5/wave5-helper.h |   4 +
 .../chips-media/wave5/wave5-vpu-dec.c         | 245 ++++--------------
 .../chips-media/wave5/wave5-vpu-enc.c         | 179 +++++--------
 .../platform/chips-media/wave5/wave5-vpu.h    |   4 -
 .../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
 6 files changed, 164 insertions(+), 317 deletions(-)
drivers/media/platform/chips-media/wave5/wave5-helper.c +24 -0
index 8433ecab230c..53cad4d17aa7 100644
@@ -7,6 +7,8 @@
 
 #include "wave5-helper.h"
 
+#define DEFAULT_BS_SIZE(width, height) ((width) * (height) / 8 * 3)
+
 const char *state_to_str(enum vpu_instance_state state)
 {
 	switch (state) {
@@ -211,3 +213,25 @@ void wave5_return_bufs(struct vb2_queue *q, u32 state)
 		v4l2_m2m_buf_done(vbuf, state);
 	}
 }
+
+void wave5_update_pix_fmt(struct v4l2_pix_format_mplane *pix_mp,
+			  unsigned int width,
+			  unsigned int height,
+			  const struct v4l2_frmsize_stepwise frmsize)
+{
+	v4l2_apply_frmsize_constraints(&width, &height, &frmsize);
+
+	if (pix_mp->pixelformat == V4L2_PIX_FMT_HEVC ||
+	    pix_mp->pixelformat == V4L2_PIX_FMT_H264) {
+		pix_mp->width = width;
+		pix_mp->height = height;
+		pix_mp->num_planes = 1;
+		pix_mp->plane_fmt[0].bytesperline = 0;
+		pix_mp->plane_fmt[0].sizeimage = max(DEFAULT_BS_SIZE(width, height),
+						     pix_mp->plane_fmt[0].sizeimage);
+	} else {
+		v4l2_fill_pixfmt_mp(pix_mp, pix_mp->pixelformat, width, height);
+	}
+	pix_mp->flags = 0;
+	pix_mp->field = V4L2_FIELD_NONE;
+}
drivers/media/platform/chips-media/wave5/wave5-helper.h +4 -0
index 6cee1c14d3ce..a8ecd1920207 100644
@@ -28,4 +28,8 @@ const struct vpu_format *wave5_find_vpu_fmt_by_idx(unsigned int idx,
 						   const struct vpu_format fmt_list[MAX_FMTS]);
 enum wave_std wave5_to_vpu_std(unsigned int v4l2_pix_fmt, enum vpu_instance_type type);
 void wave5_return_bufs(struct vb2_queue *q, u32 state);
+void wave5_update_pix_fmt(struct v4l2_pix_format_mplane *pix_mp,
+			  unsigned int width,
+			  unsigned int height,
+			  const struct v4l2_frmsize_stepwise frmsize);
 #endif
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c +52 -193

375 lines not on this page · raw message

drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +63 -116

301 lines not on this page · raw message

drivers/media/platform/chips-media/wave5/wave5-vpu.h +0 -4
index 32b7fd3730b5..691d6341fcda 100644
@@ -38,10 +38,6 @@ enum vpu_fmt_type {
 
 struct vpu_format {
 	unsigned int v4l2_pix_fmt;
-	unsigned int max_width;
-	unsigned int min_width;
-	unsigned int max_height;
-	unsigned int min_height;
 };
 
 static inline struct vpu_instance *wave5_to_vpu_inst(struct v4l2_fh *vfh)
drivers/media/platform/chips-media/wave5/wave5-vpuconfig.h +21 -4
index d9751eedb0f9..e6a34ae7084e 100644
@@ -30,10 +30,27 @@
 
 #define MAX_NUM_INSTANCE                32
 
-#define W5_MIN_ENC_PIC_WIDTH            256
-#define W5_MIN_ENC_PIC_HEIGHT           128
-#define W5_MAX_ENC_PIC_WIDTH            8192
-#define W5_MAX_ENC_PIC_HEIGHT           8192
+#define W5_DEF_DEC_PIC_WIDTH            720U
+#define W5_DEF_DEC_PIC_HEIGHT           480U
+#define W5_MIN_DEC_PIC_WIDTH            32U
+#define W5_MIN_DEC_PIC_HEIGHT           32U
+#define W5_MAX_DEC_PIC_WIDTH            8192U
+#define W5_MAX_DEC_PIC_HEIGHT           4320U
+#define W5_DEC_CODEC_STEP_WIDTH         1U
+#define W5_DEC_CODEC_STEP_HEIGHT        1U
+#define W5_DEC_RAW_STEP_WIDTH           32U
+#define W5_DEC_RAW_STEP_HEIGHT          16U
+
+#define W5_DEF_ENC_PIC_WIDTH            416U
+#define W5_DEF_ENC_PIC_HEIGHT           240U
+#define W5_MIN_ENC_PIC_WIDTH            256U
+#define W5_MIN_ENC_PIC_HEIGHT           128U
+#define W5_MAX_ENC_PIC_WIDTH            8192U
+#define W5_MAX_ENC_PIC_HEIGHT           8192U
+#define W5_ENC_CODEC_STEP_WIDTH         8U
+#define W5_ENC_CODEC_STEP_HEIGHT        8U
+#define W5_ENC_RAW_STEP_WIDTH           32U
+#define W5_ENC_RAW_STEP_HEIGHT          16U
 
 //  application specific configuration
 #define VPU_ENC_TIMEOUT                 60000
Signature · 1 line
2.43.0
author maintainer
#4 lore raw

PATCH v2 4/4 media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder.

In reply to jackson.lee

From: "Jackson.lee" <[email protected]>

Add support for the YUV422P, NV16, NV61, YUV422M, NV16M, NV61M raw pixel-formats to the Wave5 encoder.
All these formats have a chroma subsampling ratio of 4:2:2 and therefore require a new image size calculation as the driver previously only handled a ratio of 4:2:0.

---
 .../chips-media/wave5/wave5-vpu-enc.c         | 59 +++++++++++++++++--
 1 file changed, 54 insertions(+), 5 deletions(-)
drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c +54 -5
index 5a32bb138158..77657f63a169 100644
@@ -39,6 +39,24 @@ static const struct vpu_format enc_fmt_list[FMT_TYPES][MAX_FMTS] = {
 		{
 			.v4l2_pix_fmt = V4L2_PIX_FMT_NV21M,
 		},
+		{
+			.v4l2_pix_fmt = V4L2_PIX_FMT_YUV422P,
+		},
+		{
+			.v4l2_pix_fmt = V4L2_PIX_FMT_NV16,
+		},
+		{
+			.v4l2_pix_fmt = V4L2_PIX_FMT_NV61,
+		},
+		{
+			.v4l2_pix_fmt = V4L2_PIX_FMT_YUV422M,
+		},
+		{
+			.v4l2_pix_fmt = V4L2_PIX_FMT_NV16M,
+		},
+		{
+			.v4l2_pix_fmt = V4L2_PIX_FMT_NV61M,
+		},
 	}
 };
 
@@ -101,13 +119,30 @@ static int start_encode(struct vpu_instance *inst, u32 *fail_res)
 	struct vb2_v4l2_buffer *dst_buf;
 	struct frame_buffer frame_buf;
 	struct enc_param pic_param;
-	u32 stride = ALIGN(inst->dst_fmt.width, 32);
-	u32 luma_size = (stride * inst->dst_fmt.height);
-	u32 chroma_size = ((stride / 2) * (inst->dst_fmt.height / 2));
+	u32 stride = inst->src_fmt.plane_fmt[0].bytesperline;
+	u32 luma_size = (stride * inst->src_fmt.height);
+	u32 chroma_size = 0;
 
 	memset(&pic_param, 0, sizeof(struct enc_param));
 	memset(&frame_buf, 0, sizeof(struct frame_buffer));
 
+	if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_YUV420 ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_YUV420M)
+		chroma_size = luma_size / 4;
+	else if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV12 ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV21 ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV12M ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV21M)
+		chroma_size = luma_size / 2;
+	else if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_YUV422P ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_YUV422M)
+		chroma_size = luma_size / 2;
+	else if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV16 ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV61 ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV16M ||
+		 inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV61M)
+		chroma_size = luma_size;
+
 	dst_buf = v4l2_m2m_next_dst_buf(m2m_ctx);
 	if (!dst_buf) {
 		dev_dbg(inst->dev->dev, "%s: No destination buffer found\n", __func__);
@@ -490,11 +525,15 @@ static int wave5_vpu_enc_s_fmt_out(struct file *file, void *fh, struct v4l2_form
 	}
 
 	if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV12 ||
-	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV12M) {
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV12M ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV16 ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV16M) {
 		inst->cbcr_interleave = true;
 		inst->nv21 = false;
 	} else if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV21 ||
-		   inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV21M) {
+		   inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV21M ||
+		   inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV61 ||
+		   inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV61M) {
 		inst->cbcr_interleave = true;
 		inst->nv21 = true;
 	} else {
@@ -1086,6 +1125,16 @@ static void wave5_set_enc_openparam(struct enc_open_param *open_param,
 	u32 num_ctu_row = ALIGN(inst->dst_fmt.height, 64) / 64;
 	u32 num_mb_row = ALIGN(inst->dst_fmt.height, 16) / 16;
 
+	if (inst->src_fmt.pixelformat == V4L2_PIX_FMT_YUV422P ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV16 ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV61 ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_YUV422M ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV16M ||
+	    inst->src_fmt.pixelformat == V4L2_PIX_FMT_NV61M)
+		open_param->src_format = FORMAT_422;
+	else
+		open_param->src_format = FORMAT_420;
+
 	open_param->wave_param.gop_preset_idx = PRESET_IDX_IPP_SINGLE;
 	open_param->wave_param.hvs_qp_scale = 2;
 	open_param->wave_param.hvs_max_delta_qp = 10;
Signature · 1 line
2.43.0
#5 lore raw
In reply to jackson.lee

Hey Jackson,

just as a quick info, I feel like the title of the cover letter is a bit confusing, as it sounds like it contains the source code for the wave5 codec driver, which we already have. Usually the title of the cover letter should indicate to the reader what to expect in the patch-set (which can also be a really nice indication for when you try to do too much in a single patch-set, because then it will be hard to make a concise title).

Greetings,
Sebastian

Quoted 81 lines · jackson.lee

From: "Jackson.lee" <[email protected]>

The wave5 codec driver is a stateful encoder/decoder.
The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things.

v4l2-compliance results:
========================

v4l2-compliance 1.24.1, 64 bits, 64-bit time_t

Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded: 45, Failed: 0, Warnings: 0

Fluster test results:
=====================

Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 132/147 tests successfully in 94.782 secs

(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 77/135 tests successfully in 37.364 secs

(58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)

Chnage since v1:
=================

* For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR
- define a macro for register addresses

* For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume
- add auto suspend/resume

* For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage
- use helper functions to calculate bytesperline and sizeimage

* For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder
- remove unnecessary codes

Change since v0:
=================
The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line.

Jackson.lee (4):
media: chips-media: wave5: Support SPS/PPS generation for each IDR
media: chips-media: wave5: Support runtime suspend/resume
media: chips-media: wave5: Use helpers to calculate bytesperline and
sizeimage.
media: chips-media: wave5: Support YUV422 raw pixel-formats on the
encoder.

.../platform/chips-media/wave5/wave5-helper.c |  24 ++
.../platform/chips-media/wave5/wave5-helper.h |   4 +
.../platform/chips-media/wave5/wave5-hw.c     |  23 +-
.../chips-media/wave5/wave5-vpu-dec.c         | 261 +++++-------------
.../chips-media/wave5/wave5-vpu-enc.c         | 260 +++++++++--------
.../platform/chips-media/wave5/wave5-vpu.c    |  43 +++
.../platform/chips-media/wave5/wave5-vpu.h    |   4 -
.../platform/chips-media/wave5/wave5-vpuapi.c |  14 +-
.../platform/chips-media/wave5/wave5-vpuapi.h |   1 +
.../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
.../media/platform/chips-media/wave5/wave5.h  |   3 +
11 files changed, 329 insertions(+), 333 deletions(-)
Signature · 1 line
2.43.0
#6 lore raw

Hey Jackson,

Ah and also you have to resend the series because you didn't send to:
[email protected]

Here what I wrote on V0:

Quoted 24 lines

you forgot to send this mail series to the media mailing list ([email protected]), which makes it a bit hard for people to review the patches.

Please use either the ./scripts/get_maintainer.p Script in the kernel root directory:

```
❯ ./scripts/get_maintainer.pl ~/Mail/patches/_PATCH_v0_1-5_wave5_Support_yuv422_input_format_for_encoder.patch Nas Chung <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER)
Jackson Lee <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER)
Mauro Carvalho Chehab <[email protected]> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB))
[email protected] (open list:WAVE5 VPU CODEC DRIVER)
[email protected] (open list)
```

Or use a tool like b4 to generate the list of receivers:
https://b4.docs.kernel.org/en/latest/contributor/prep.html#prepare-the-list-of-recipients

After that you can then add any additional receivers you like, but this makes sure that the most essential mails are present.
also just noting in case you want to just resend the series without doing any actual changes to the patches, please add a RESEND tag to the mails, like here:
https://lore.kernel.org/all/[email protected]/T/#t

Quoted 4 lines

e.g. [RESEND PATCH v0 0/5]

This can be changed for example like this:
git format-patch --subject-prefix="RESEND PATCH" ...

Greetings,
Sebastian

Quoted 95 lines · Sebastian Fricke

Hey Jackson,

just as a quick info, I feel like the title of the cover letter is a bit confusing, as it sounds like it contains the source code for the wave5 codec driver, which we already have. Usually the title of the cover letter should indicate to the reader what to expect in the patch-set (which can also be a really nice indication for when you try to do too much in a single patch-set, because then it will be hard to make a concise title).

Greetings,
Sebastian

Quoted 81 lines · jackson.lee

From: "Jackson.lee" <[email protected]>

The wave5 codec driver is a stateful encoder/decoder.
The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things.

v4l2-compliance results:
========================

v4l2-compliance 1.24.1, 64 bits, 64-bit time_t

Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not supported
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0, Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded: 45, Failed: 0, Warnings: 0

Fluster test results:
=====================

Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 132/147 tests successfully in 94.782 secs

(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0 Using 1 parallel job(s)
Ran 77/135 tests successfully in 37.364 secs

(58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)

Chnage since v1:
=================

* For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR
- define a macro for register addresses

* For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume
- add auto suspend/resume

* For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage
- use helper functions to calculate bytesperline and sizeimage

* For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder
- remove unnecessary codes

Change since v0:
=================
The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line.

Jackson.lee (4):
media: chips-media: wave5: Support SPS/PPS generation for each IDR
media: chips-media: wave5: Support runtime suspend/resume
media: chips-media: wave5: Use helpers to calculate bytesperline and
sizeimage.
media: chips-media: wave5: Support YUV422 raw pixel-formats on the
encoder.

.../platform/chips-media/wave5/wave5-helper.c |  24 ++
.../platform/chips-media/wave5/wave5-helper.h |   4 +
.../platform/chips-media/wave5/wave5-hw.c     |  23 +-
.../chips-media/wave5/wave5-vpu-dec.c         | 261 +++++-------------
.../chips-media/wave5/wave5-vpu-enc.c         | 260 +++++++++--------
.../platform/chips-media/wave5/wave5-vpu.c    |  43 +++
.../platform/chips-media/wave5/wave5-vpu.h    |   4 -
.../platform/chips-media/wave5/wave5-vpuapi.c |  14 +-
.../platform/chips-media/wave5/wave5-vpuapi.h |   1 +
.../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
.../media/platform/chips-media/wave5/wave5.h  |   3 +
11 files changed, 329 insertions(+), 333 deletions(-)
Signature · 1 line
2.43.0
author maintainer
#7 lore raw

Hello Sebastian

Thanks for your review.

Quoted 160 lines

-----Original Message-----
From: Sebastian Fricke <[email protected]>
Sent: Monday, March 11, 2024 6:39 PM
To: jackson.lee <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Nas Chung <[email protected]>; lafley.kim <[email protected]>
Subject: Re: [PATCH v2 0/4] wave5 codec driver

Hey Jackson,

Ah and also you have to resend the series because you didn't send to:
[email protected]

Here what I wrote on V0:

Quoted 28 lines

you forgot to send this mail series to the media mailing list ([email protected]), which makes it a bit hard for people to review the patches.

Please use either the ./scripts/get_maintainer.p Script in the kernel root directory:
```
❯ ./scripts/get_maintainer.pl ~/Mail/patches/_PATCH_v0_1-5_wave5_Support_yuv422_input_format_for_enc oder.patch Nas Chung <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER) Jackson Lee <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER) Mauro Carvalho Chehab <[email protected]> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)) [email protected] (open list:WAVE5 VPU CODEC DRIVER) [email protected] (open list) ```

Or use a tool like b4 to generate the list of receivers:
https://b4.docs.kernel.org/en/latest/contributor/prep.html#prepare-the
-list-of-recipients

After that you can then add any additional receivers you like, but this makes sure that the most essential mails are present. also just noting in case you want to just resend the series without doing any actual changes to the patches, please add a RESEND tag to the mails, like here:
https://lore.kernel.org/all/20240126192128.1210579-1-cristian.ciocalte
[email protected]/T/#t

Quoted 4 lines

e.g. [RESEND PATCH v0 0/5]

This can be changed for example like this:
git format-patch --subject-prefix="RESEND PATCH" ...

Greetings,
Sebastian

Quoted 10 lines · Sebastian Fricke

Hey Jackson,

just as a quick info, I feel like the title of the cover letter is a bit confusing, as it sounds like it contains the source code for the wave5 codec driver, which we already have. Usually the title of the cover letter should indicate to the reader what to expect in the patch-set (which can also be a really nice indication for when you try to do too much in a single patch-set, because then it will be hard to make a concise title).

Quoted 17 lines

Greetings,
Sebastian

Quoted 13 lines · jackson.lee

From: "Jackson.lee" <[email protected]>

The wave5 codec driver is a stateful encoder/decoder. The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things.

v4l2-compliance results:
========================

v4l2-compliance 1.24.1, 64 bits, 64-bit time_t

Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not

supported

Quoted 1 line
Quoted 1 line

warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not

supported

Quoted 4 lines
Quoted 4 lines

test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Quoted 8 lines
Quoted 8 lines

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0,
Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded: 45,
Failed: 0, Warnings: 0

Fluster test results:
=====================

Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-

Gst1.0 Using 1 parallel job(s)

Quoted 8 lines
Quoted 8 lines

Ran 132/147 tests successfully in 94.782 secs

(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0

Using 1 parallel job(s)

Quoted 56 lines
Quoted 56 lines

Ran 77/135 tests successfully in 37.364 secs

(58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)

Chnage since v1:
=================

* For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR
- define a macro for register addresses

* For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume
- add auto suspend/resume

* For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage
- use helper functions to calculate bytesperline and sizeimage

* For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder
- remove unnecessary codes

Change since v0:
=================
The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line.

Jackson.lee (4):
media: chips-media: wave5: Support SPS/PPS generation for each IDR
media: chips-media: wave5: Support runtime suspend/resume
media: chips-media: wave5: Use helpers to calculate bytesperline and
sizeimage.
media: chips-media: wave5: Support YUV422 raw pixel-formats on the
encoder.

.../platform/chips-media/wave5/wave5-helper.c |  24 ++
.../platform/chips-media/wave5/wave5-helper.h |   4 +
.../platform/chips-media/wave5/wave5-hw.c     |  23 +-
.../chips-media/wave5/wave5-vpu-dec.c         | 261 +++++-------------
.../chips-media/wave5/wave5-vpu-enc.c         | 260 +++++++++--------
.../platform/chips-media/wave5/wave5-vpu.c    |  43 +++
.../platform/chips-media/wave5/wave5-vpu.h    |   4 -
.../platform/chips-media/wave5/wave5-vpuapi.c |  14 +-
.../platform/chips-media/wave5/wave5-vpuapi.h |   1 +
.../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
.../media/platform/chips-media/wave5/wave5.h  |   3 +
11 files changed, 329 insertions(+), 333 deletions(-)

--
2.43.0

#8 lore raw

Hey Jackson,

Quoted 3 lines · jackson.lee

Hello Sebastian

Thanks for your review.

just to clarify, what I meant with the title is not that it needs to be a mini summary, as that is what the body of the cover letter is for. But it should show clearly what to expect in the series, like do you:
- introduce a new driver?
- fix bugs on an existing driver?
- add features to an existing driver?
- refactor code?
- add support for new hardware?

That makes it easier for a maintainer for example to quickly judge priority of a patch set and makes it easy to distinguish the different patch series in the mail reader.

So if you have a single change you can just describe that fully (if you even need a cover letter in that case), otherwise try to basically describe on a very broad level what you have done. For these patches a title like: "additional features and formats for the Wave5 Codec" might be fitting, but no need to RESEND for that again, just keep that in mind for the future.

Greetings,
Sebastian

Quoted 162 lines
Quoted 162 lines

-----Original Message-----
From: Sebastian Fricke <[email protected]>
Sent: Monday, March 11, 2024 6:39 PM
To: jackson.lee <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Nas Chung <[email protected]>; lafley.kim <[email protected]>
Subject: Re: [PATCH v2 0/4] wave5 codec driver

Hey Jackson,

Ah and also you have to resend the series because you didn't send to:
[email protected]

Here what I wrote on V0:

Quoted 28 lines

you forgot to send this mail series to the media mailing list ([email protected]), which makes it a bit hard for people to review the patches.

Please use either the ./scripts/get_maintainer.p Script in the kernel root directory:
```
❯ ./scripts/get_maintainer.pl ~/Mail/patches/_PATCH_v0_1-5_wave5_Support_yuv422_input_format_for_enc oder.patch Nas Chung <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER) Jackson Lee <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER) Mauro Carvalho Chehab <[email protected]> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)) [email protected] (open list:WAVE5 VPU CODEC DRIVER) [email protected] (open list) ```

Or use a tool like b4 to generate the list of receivers:
https://b4.docs.kernel.org/en/latest/contributor/prep.html#prepare-the
-list-of-recipients

After that you can then add any additional receivers you like, but this makes sure that the most essential mails are present. also just noting in case you want to just resend the series without doing any actual changes to the patches, please add a RESEND tag to the mails, like here:
https://lore.kernel.org/all/20240126192128.1210579-1-cristian.ciocalte
[email protected]/T/#t

Quoted 4 lines

e.g. [RESEND PATCH v0 0/5]

This can be changed for example like this:
git format-patch --subject-prefix="RESEND PATCH" ...

Greetings,
Sebastian

Quoted 10 lines · Sebastian Fricke

Hey Jackson,

just as a quick info, I feel like the title of the cover letter is a bit confusing, as it sounds like it contains the source code for the wave5 codec driver, which we already have. Usually the title of the cover letter should indicate to the reader what to expect in the patch-set (which can also be a really nice indication for when you try to do too much in a single patch-set, because then it will be hard to make a concise title).

Quoted 17 lines

Greetings,
Sebastian

Quoted 13 lines · jackson.lee

From: "Jackson.lee" <[email protected]>

The wave5 codec driver is a stateful encoder/decoder. The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things.

v4l2-compliance results:
========================

v4l2-compliance 1.24.1, 64 bits, 64-bit time_t

Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not

supported

Quoted 1 line
Quoted 1 line

warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not

supported

Quoted 4 lines
Quoted 4 lines

test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Quoted 8 lines
Quoted 8 lines

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed: 0,
Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded: 45,
Failed: 0, Warnings: 0

Fluster test results:
=====================

Running test suite JCT-VC-HEVC_V1 with decoder GStreamer-H.265-V4L2-

Gst1.0 Using 1 parallel job(s)

Quoted 8 lines
Quoted 8 lines

Ran 132/147 tests successfully in 94.782 secs

(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)

Running test suite JVT-AVC_V1 with decoder GStreamer-H.264-V4L2-Gst1.0

Using 1 parallel job(s)

Quoted 56 lines
Quoted 56 lines

Ran 77/135 tests successfully in 37.364 secs

(58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)

Chnage since v1:
=================

* For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR
- define a macro for register addresses

* For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume
- add auto suspend/resume

* For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage
- use helper functions to calculate bytesperline and sizeimage

* For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder
- remove unnecessary codes

Change since v0:
=================
The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line.

Jackson.lee (4):
media: chips-media: wave5: Support SPS/PPS generation for each IDR
media: chips-media: wave5: Support runtime suspend/resume
media: chips-media: wave5: Use helpers to calculate bytesperline and
sizeimage.
media: chips-media: wave5: Support YUV422 raw pixel-formats on the
encoder.

.../platform/chips-media/wave5/wave5-helper.c |  24 ++
.../platform/chips-media/wave5/wave5-helper.h |   4 +
.../platform/chips-media/wave5/wave5-hw.c     |  23 +-
.../chips-media/wave5/wave5-vpu-dec.c         | 261 +++++-------------
.../chips-media/wave5/wave5-vpu-enc.c         | 260 +++++++++--------
.../platform/chips-media/wave5/wave5-vpu.c    |  43 +++
.../platform/chips-media/wave5/wave5-vpu.h    |   4 -
.../platform/chips-media/wave5/wave5-vpuapi.c |  14 +-
.../platform/chips-media/wave5/wave5-vpuapi.h |   1 +
.../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
.../media/platform/chips-media/wave5/wave5.h  |   3 +
11 files changed, 329 insertions(+), 333 deletions(-)

--
2.43.0

author maintainer
#9 lore raw

Thanks for your comment

Jackson

Quoted 208 lines

-----Original Message-----
From: Sebastian Fricke <[email protected]>
Sent: Tuesday, March 12, 2024 12:25 AM
To: jackson.lee <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Nas Chung <[email protected]>; lafley.kim <[email protected]>
Subject: Re: [PATCH v2 0/4] wave5 codec driver

Hey Jackson,

Quoted 3 lines · jackson.lee

Hello Sebastian

Thanks for your review.

just to clarify, what I meant with the title is not that it needs to be a mini summary, as that is what the body of the cover letter is for. But it should show clearly what to expect in the series, like do you:
- introduce a new driver?
- fix bugs on an existing driver?
- add features to an existing driver?
- refactor code?
- add support for new hardware?

That makes it easier for a maintainer for example to quickly judge priority of a patch set and makes it easy to distinguish the different patch series in the mail reader.

So if you have a single change you can just describe that fully (if you even need a cover letter in that case), otherwise try to basically describe on a very broad level what you have done. For these patches a title like: "additional features and formats for the Wave5 Codec" might be fitting, but no need to RESEND for that again, just keep that in mind for the future.

Greetings,
Sebastian

Quoted 169 lines
Quoted 169 lines

-----Original Message-----
From: Sebastian Fricke <[email protected]>
Sent: Monday, March 11, 2024 6:39 PM
To: jackson.lee <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Nas Chung <[email protected]>; lafley.kim <[email protected]>
Subject: Re: [PATCH v2 0/4] wave5 codec driver

Hey Jackson,

Ah and also you have to resend the series because you didn't send to:
[email protected]

Here what I wrote on V0:

Quoted 31 lines

you forgot to send this mail series to the media mailing list ([email protected]), which makes it a bit hard for people to review the patches.

Please use either the ./scripts/get_maintainer.p Script in the kernel root directory:
```
❯ ./scripts/get_maintainer.pl ~/Mail/patches/_PATCH_v0_1-5_wave5_Support_yuv422_input_format_for_ enc oder.patch Nas Chung <[email protected]> (maintainer:WAVE5 VPU CODEC DRIVER) Jackson Lee <[email protected]>
(maintainer:WAVE5 VPU CODEC DRIVER) Mauro Carvalho Chehab <[email protected]> (maintainer:MEDIA INPUT INFRASTRUCTURE (V4L/DVB)) [email protected] (open list:WAVE5 VPU CODEC DRIVER) [email protected] (open list) ```

Or use a tool like b4 to generate the list of receivers:
https://b4.docs.kernel.org/en/latest/contributor/prep.html#prepare-
the
-list-of-recipients

After that you can then add any additional receivers you like, but this makes sure that the most essential mails are present. also just noting in case you want to just resend the series without doing any actual changes to the patches, please add a RESEND tag to the mails, like here:
https://lore.kernel.org/all/20240126192128.1210579-1-cristian.cioca
lte
[email protected]/T/#t

Quoted 4 lines

e.g. [RESEND PATCH v0 0/5]

This can be changed for example like this:
git format-patch --subject-prefix="RESEND PATCH" ...

Greetings,
Sebastian

Quoted 10 lines · Sebastian Fricke

Hey Jackson,

just as a quick info, I feel like the title of the cover letter is a bit confusing, as it sounds like it contains the source code for the wave5 codec driver, which we already have. Usually the title of the cover letter should indicate to the reader what to expect in the patch-set (which can also be a really nice indication for when you try to do too much in a single patch-set, because then it will be hard to make a concise title).

Quoted 17 lines

Greetings,
Sebastian

Quoted 13 lines · jackson.lee

From: "Jackson.lee" <[email protected]>

The wave5 codec driver is a stateful encoder/decoder. The following patches is for supporting yuv422 inpuy format, supporting runtime suspend/resume feature and extra things.

v4l2-compliance results:
========================

v4l2-compliance 1.24.1, 64 bits, 64-bit time_t

Buffer ioctls:
warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not

supported

Quoted 1 line
Quoted 1 line

warn: v4l2-test-buffers.cpp(693): VIDIOC_CREATE_BUFS not

supported

Quoted 10 lines
Quoted 10 lines

test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK (Not Supported)

Total for wave5-dec device /dev/video0: 45, Succeeded: 45, Failed:
0,
Warnings: 2 Total for wave5-enc device /dev/video1: 45, Succeeded:
45,
Failed: 0, Warnings: 0

Quoted 5 lines
Quoted 5 lines

Fluster test results:
=====================

Running test suite JCT-VC-HEVC_V1 with decoder
GStreamer-H.265-V4L2-

Gst1.0 Using 1 parallel job(s)

Quoted 9 lines
Quoted 9 lines

Ran 132/147 tests successfully in 94.782 secs

(1 test fails because of not supporting to parse multi frames, 1 test fails because of a missing frame and slight corruption, 2 tests fail because of sizes which are incompatible with the IP, 11 tests fail because of unsupported 10 bit format)

Running test suite JVT-AVC_V1 with decoder
GStreamer-H.264-V4L2-Gst1.0

Using 1 parallel job(s)

Quoted 56 lines
Quoted 56 lines

Ran 77/135 tests successfully in 37.364 secs

(58 fail because the hardware is unable to decode MBAFF / FMO / Field / Extended profile streams.)

Chnage since v1:
=================

* For [PATCH v2 0/4] media: chips-media: wave5: Support SPS/PPS generation for each IDR
- define a macro for register addresses

* For [PATCH v2 1/4] media: chips-media: wave5: Support runtime suspend/resume
- add auto suspend/resume

* For [PATCH v2 2/4] media: chips-media: wave5: Use helpers to calculate bytesperline and sizeimage
- use helper functions to calculate bytesperline and sizeimage

* For [PATCH v2 3/4] media: chips-media: wave5: Support YUV422 raw pixel-formats on the encoder
- remove unnecessary codes

Change since v0:
=================
The DEFAULT_SRC_SIZE macro was defined using multiple lines, To make a simple define, tab and multiple lines has been removed, The macro is defined using one line.

Jackson.lee (4):
media: chips-media: wave5: Support SPS/PPS generation for each IDR
media: chips-media: wave5: Support runtime suspend/resume
media: chips-media: wave5: Use helpers to calculate bytesperline and
sizeimage.
media: chips-media: wave5: Support YUV422 raw pixel-formats on the
encoder.

.../platform/chips-media/wave5/wave5-helper.c |  24 ++
.../platform/chips-media/wave5/wave5-helper.h |   4 +
.../platform/chips-media/wave5/wave5-hw.c     |  23 +-
.../chips-media/wave5/wave5-vpu-dec.c         | 261 +++++-------------
.../chips-media/wave5/wave5-vpu-enc.c         | 260 +++++++++--------
.../platform/chips-media/wave5/wave5-vpu.c    |  43 +++
.../platform/chips-media/wave5/wave5-vpu.h    |   4 -
.../platform/chips-media/wave5/wave5-vpuapi.c |  14 +-
.../platform/chips-media/wave5/wave5-vpuapi.h |   1 +
.../chips-media/wave5/wave5-vpuconfig.h       |  25 +-
.../media/platform/chips-media/wave5/wave5.h  |   3 +
11 files changed, 329 insertions(+), 333 deletions(-)

--
2.43.0