Skip to contentSkip to conversation

visl: Adapt output frames for reference comparison

PATCH Superseded Detlev Casanova 2 participants 14 messages Oct 24, 2023 – Nov 23, 2023

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover visl: Adapt output frames for reference comparison

When using visl in automated tests, we need to have output frames that can be compared to reference frames or hash of those to validate that the whole pipeline is working properly.

Add a "stable_output" module parameter to make sure that a given input stream always outputs the same frames.
This is done by skipping information like queues status and pointer values.

This also adds some stable variation in the frames so that different input give more different output.

Changes since v1:
- Fix typo in parameter documentation

Detlev Casanova (5):
media: visl: Fix params permissions/defaults mismatch
media: visl: Add a stable_output parameter
doc: visl: Document stable_output parameter
visl: Add a codec specific variability parameter
doc: visl: Document codec_variability parameter

 Documentation/admin-guide/media/visl.rst    |   9 ++
 drivers/media/test-drivers/visl/visl-core.c |  12 +-
 drivers/media/test-drivers/visl/visl-dec.c  | 152 +++++++++++++-------
 drivers/media/test-drivers/visl/visl.h      |   2 +
 4 files changed, 120 insertions(+), 55 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/5 media: visl: Fix params permissions/defaults mismatch

false was used as the keep_bitstream_buffers parameter permissions. This looks more like a default value for the parameter, so change it to 0 to avoid confusion.

---
 drivers/media/test-drivers/visl/visl-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/test-drivers/visl/visl-core.c +1 -1
index 9970dc739ca5..df6515530fbf 100644
@@ -74,7 +74,7 @@ MODULE_PARM_DESC(visl_dprintk_nframes,
 		 " the number of frames to trace with dprintk");
 
 bool keep_bitstream_buffers;
-module_param(keep_bitstream_buffers, bool, false);
+module_param(keep_bitstream_buffers, bool, 0);
 MODULE_PARM_DESC(keep_bitstream_buffers,
 		 " keep bitstream buffers in debugfs after streaming is stopped");
 
Signature · 1 line
2.41.0
#9 lore raw

PATCH v2 3/5 doc: visl: Document stable_output parameter

In reply to Detlev Casanova
---
 Documentation/admin-guide/media/visl.rst | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/admin-guide/media/visl.rst +4 -0
index 7d2dc78341c9..5b26fd943571 100644
@@ -49,6 +49,10 @@ Module parameters
   visl_dprintk_frame_start, visl_dprintk_nframes, but controls the dumping of
   buffer data through debugfs instead.
 
+- stable_output: Limit the information written on each output frame to make
+  sure that, for a given input, the output frames are always exactly the same.
+  This is useful for automated tests to check that output frames are correct.
+
 What is the default use case for this driver?
 ---------------------------------------------
 
Signature · 1 line
2.41.0
#5 lore raw

PATCH v2 2/5 media: visl: Add a stable_output parameter

In reply to Detlev Casanova

This parameter is used to ensure that for a given input, the output frames are always identical so that it can be compared against a reference in automatic tests.

---
 drivers/media/test-drivers/visl/visl-core.c |   5 +
 drivers/media/test-drivers/visl/visl-dec.c  | 125 +++++++++++---------
 drivers/media/test-drivers/visl/visl.h      |   1 +
 3 files changed, 77 insertions(+), 54 deletions(-)
drivers/media/test-drivers/visl/visl-core.c +5 -0
index df6515530fbf..d28d50afec02 100644
@@ -88,6 +88,11 @@ module_param(bitstream_trace_nframes, uint, 0);
 MODULE_PARM_DESC(bitstream_trace_nframes,
 		 " the number of frames to dump the bitstream through debugfs");
 
+bool stable_output;
+module_param(stable_output, bool, 0644);
+MODULE_PARM_DESC(stable_output,
+		 " only write stable data for a given input on the output frames");
+
 static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {
 	{
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
drivers/media/test-drivers/visl/visl-dec.c +71 -54

158 lines not on this page · raw message

drivers/media/test-drivers/visl/visl.h +1 -0
index 31639f2e593d..5a81b493f121 100644
@@ -85,6 +85,7 @@ extern unsigned int visl_dprintk_nframes;
 extern bool keep_bitstream_buffers;
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
+extern bool stable_output;
 
 #define frame_dprintk(dev, current, fmt, arg...) \
 	do { \
Signature · 1 line
2.41.0
#10 lore raw

PATCH v2 4/5 visl: Add a codec specific variability parameter

In reply to Detlev Casanova

When running tests with different input data, the stable output frames could be too similar and hide possible issues.

This commit adds variation by using some codec specific parameters.

Only HEVC and H.264 support this.

---
 drivers/media/test-drivers/visl/visl-core.c |  5 ++++
 drivers/media/test-drivers/visl/visl-dec.c  | 27 +++++++++++++++++++++
 drivers/media/test-drivers/visl/visl.h      |  1 +
 3 files changed, 33 insertions(+)
drivers/media/test-drivers/visl/visl-core.c +5 -0
index d28d50afec02..e7466f6a91e1 100644
@@ -93,6 +93,11 @@ module_param(stable_output, bool, 0644);
 MODULE_PARM_DESC(stable_output,
 		 " only write stable data for a given input on the output frames");
 
+bool codec_variability;
+module_param(codec_variability, bool, 0644);
+MODULE_PARM_DESC(codec_variability,
+		 " add codec specific variability data to generate more unique frames. (Only h.264 and hevc)");
+
 static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {
 	{
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
drivers/media/test-drivers/visl/visl-dec.c +27 -0
index 61cfca49ead9..002d5e3b0ea4 100644
@@ -223,6 +223,26 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx,
 	}
 }
 
+static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx,
+					 struct visl_run *run,
+					 char buf[], size_t bufsz)
+{
+	switch (ctx->current_codec) {
+	case VISL_CODEC_H264:
+		scnprintf(buf, bufsz,
+			  "H264: %u", run->h264.dpram->pic_order_cnt_lsb);
+		break;
+	case VISL_CODEC_HEVC:
+		scnprintf(buf, bufsz,
+			  "HEVC: %d", run->hevc.dpram->pic_order_cnt_val);
+		break;
+	default:
+		return false;
+	}
+
+	return true;
+}
+
 static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 {
 	u8 *basep[TPG_MAX_PLANES][2];
@@ -255,6 +275,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 	frame_dprintk(ctx->dev, run->dst->sequence, "");
 	line++;
 
+	if (codec_variability && visl_tpg_fill_codec_specific(ctx, run, buf, TPG_STR_BUF_SZ)) {
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		line++;
+	}
+
 	if (!stable_output) {
 		visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
 
drivers/media/test-drivers/visl/visl.h +1 -0
index 5a81b493f121..4ac2d1783020 100644
@@ -86,6 +86,7 @@ extern bool keep_bitstream_buffers;
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
 extern bool stable_output;
+extern bool codec_variability;
 
 #define frame_dprintk(dev, current, fmt, arg...) \
 	do { \
Signature · 1 line
2.41.0
#13 lore raw

PATCH v2 5/5 doc: visl: Document codec_variability parameter

In reply to Detlev Casanova
---
 Documentation/admin-guide/media/visl.rst | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/admin-guide/media/visl.rst +5 -0
index 5b26fd943571..56d2e9ab72cc 100644
@@ -53,6 +53,11 @@ Module parameters
   sure that, for a given input, the output frames are always exactly the same.
   This is useful for automated tests to check that output frames are correct.
 
+- codec_variability: Add codec specific variability in the ouput frames. It
+  adds a text line on the ouptut frames containing parameters that is specific
+  to the format of the input stream to ensure that different inputs do not give
+  the same output.
+
 What is the default use case for this driver?
 ---------------------------------------------
 
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH v2 1/5] media: visl: Fix params permissions/defaults mismatch

In reply to Detlev Casanova
Quoted 15 lines · Detlev Casanova

false was used as the keep_bitstream_buffers parameter permissions. This looks more like a default value for the parameter, so change it to 0 to avoid confusion.

---
 drivers/media/test-drivers/visl/visl-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/test-drivers/visl/visl-core.c +0 -0
index 9970dc739ca5..df6515530fbf 100644

drivers/media/test-drivers/visl/visl-core.c MODULE_PARM_DESC(visl_dprintk_nframes, · line 77

Quoted 5 lines
drivers/media/test-drivers/visl/visl-core.c +1 -1
@@ -74,7 +74,7 @@ MODULE_PARM_DESC(visl_dprintk_nframes,
 		 " the number of frames to trace with dprintk");
 
 bool keep_bitstream_buffers;
-module_param(keep_bitstream_buffers, bool, false);
+module_param(keep_bitstream_buffers, bool, 0);

???

This last parameter is the permission, it makes no sense that this is either 0 or false: then nobody can see it in /sys/modules/.

Typically this is 0444 if it is readable only, or 0644 if it can be written by root.

Regards,

Hans

Quoted 3 lines
drivers/media/test-drivers/visl/visl-core.c +0 -0
 MODULE_PARM_DESC(keep_bitstream_buffers,
 		 " keep bitstream buffers in debugfs after streaming is stopped");
 
#6 lore raw

Re: [PATCH v2 2/5] media: visl: Add a stable_output parameter

In reply to Detlev Casanova
Quoted 48 lines · Detlev Casanova

This parameter is used to ensure that for a given input, the output frames are always identical so that it can be compared against a reference in automatic tests.

---
 drivers/media/test-drivers/visl/visl-core.c |   5 +
 drivers/media/test-drivers/visl/visl-dec.c  | 125 +++++++++++---------
 drivers/media/test-drivers/visl/visl.h      |   1 +
 3 files changed, 77 insertions(+), 54 deletions(-)
drivers/media/test-drivers/visl/visl-core.c +5 -0
index df6515530fbf..d28d50afec02 100644
@@ -88,6 +88,11 @@ module_param(bitstream_trace_nframes, uint, 0);
 MODULE_PARM_DESC(bitstream_trace_nframes,
 		 " the number of frames to dump the bitstream through debugfs");
 
+bool stable_output;
+module_param(stable_output, bool, 0644);
+MODULE_PARM_DESC(stable_output,
+		 " only write stable data for a given input on the output frames");
+
 static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {
 	{
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
drivers/media/test-drivers/visl/visl-dec.c +0 -12
index 318d675e5668..61cfca49ead9 100644
@@ -197,19 +197,30 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx,
 {
 	u32 stream_ms;
 
-	stream_ms = jiffies_to_msecs(get_jiffies_64() - ctx->capture_streamon_jiffies);
-
-	scnprintf(buf, bufsz,
-		  "stream time: %02d:%02d:%02d:%03d sequence:%u timestamp:%lld field:%s",
-		  (stream_ms / (60 * 60 * 1000)) % 24,
-		  (stream_ms / (60 * 1000)) % 60,
-		  (stream_ms / 1000) % 60,
-		  stream_ms % 1000,
-		  run->dst->sequence,
-		  run->dst->vb2_buf.timestamp,
-		  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
-		  (run->dst->field == V4L2_FIELD_TOP ?

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx, · line 208

Quoted 10 lines
drivers/media/test-drivers/visl/visl-dec.c +9 -1
-		  " top" : " bottom") : "none");
+	if (!stable_output) {
+		stream_ms = jiffies_to_msecs(get_jiffies_64() - ctx->capture_streamon_jiffies);
+
+		scnprintf(buf, bufsz,
+			  "stream time: %02d:%02d:%02d:%03d sequence:%u timestamp:%lld field:%s",
+			  (stream_ms / (60 * 60 * 1000)) % 24,
+			  (stream_ms / (60 * 1000)) % 60,
+			  (stream_ms / 1000) % 60,
+			  stream_ms % 1000,

How useful is this 'stream time' anyway? I don't think this adds anything useful.

Quoted 19 lines
drivers/media/test-drivers/visl/visl-dec.c +15 -0
+			  run->dst->sequence,
+			  run->dst->vb2_buf.timestamp,
+			  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
+			  (run->dst->field == V4L2_FIELD_TOP ?
+			  " top" : " bottom") : "none");
+	} else {
+		scnprintf(buf, bufsz,
+			  "sequence:%u timestamp:%lld field:%s",
+			  run->dst->sequence,
+			  run->dst->vb2_buf.timestamp,
+			  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
+			  (run->dst->field == V4L2_FIELD_TOP ?
+			  " top" : " bottom") : "none");
+
+	}
 }
 
 static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) · line 247

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
@@ -244,15 +255,17 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 	frame_dprintk(ctx->dev, run->dst->sequence, "");
 	line++;
 
-	visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);

This function shows both the ts of the ref frames and the buffer index. Is it just the buffer index that causes the problem? If so, then wouldn't it be better to either never show the buffer index or only if !stable_output.

Quoted 118 lines
drivers/media/test-drivers/visl/visl-dec.c +47 -40
+	if (!stable_output) {
+		visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
 
-	while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) {
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, line_str);
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", line_str);
-	}
+		while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) {
+			tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, line_str);
+			frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", line_str);
+		}
 
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		line++;
+	}
 
 	scnprintf(buf,
 		  TPG_STR_BUF_SZ,
@@ -280,28 +293,30 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
 	}
 
-	line++;
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	scnprintf(buf, TPG_STR_BUF_SZ, "Output queue status:");
-	tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
-	frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+	if (!stable_output) {
+		line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		scnprintf(buf, TPG_STR_BUF_SZ, "Output queue status:");
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
 
-	len = 0;
-	for (i = 0; i < out_q->num_buffers; i++) {
-		char entry[] = "index: %u, state: %s, request_fd: %d, ";
-		u32 old_len = len;
-		char *q_status = visl_get_vb2_state(out_q->bufs[i]->state);
+		len = 0;
+		for (i = 0; i < out_q->num_buffers; i++) {
+			char entry[] = "index: %u, state: %s, request_fd: %d, ";
+			u32 old_len = len;
+			char *q_status = visl_get_vb2_state(out_q->bufs[i]->state);
 
-		len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
-				 entry, i, q_status,
-				 to_vb2_v4l2_buffer(out_q->bufs[i])->request_fd);
+			len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
+					 entry, i, q_status,
+					 to_vb2_v4l2_buffer(out_q->bufs[i])->request_fd);
 
-		len += visl_fill_bytesused(to_vb2_v4l2_buffer(out_q->bufs[i]),
-					   &buf[len],
-					   TPG_STR_BUF_SZ - len);
+			len += visl_fill_bytesused(to_vb2_v4l2_buffer(out_q->bufs[i]),
+						   &buf[len],
+						   TPG_STR_BUF_SZ - len);
 
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, &buf[old_len]);
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s", &buf[old_len]);
+			tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, &buf[old_len]);
+			frame_dprintk(ctx->dev, run->dst->sequence, "%s", &buf[old_len]);
+		}
 	}
 
 	line++;
@@ -333,25 +348,27 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
 	}
 
-	line++;
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	scnprintf(buf, TPG_STR_BUF_SZ, "Capture queue status:");
-	tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
-	frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+	if (!stable_output) {
+		line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		scnprintf(buf, TPG_STR_BUF_SZ, "Capture queue status:");
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
 
-	len = 0;
-	for (i = 0; i < cap_q->num_buffers; i++) {
-		u32 old_len = len;
-		char *q_status = visl_get_vb2_state(cap_q->bufs[i]->state);
+		len = 0;
+		for (i = 0; i < cap_q->num_buffers; i++) {
+			u32 old_len = len;
+			char *q_status = visl_get_vb2_state(cap_q->bufs[i]->state);
 
-		len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
-				 "index: %u, status: %s, timestamp: %llu, is_held: %d",
-				 cap_q->bufs[i]->index, q_status,
-				 cap_q->bufs[i]->timestamp,
-				 to_vb2_v4l2_buffer(cap_q->bufs[i])->is_held);
+			len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
+					 "index: %u, status: %s, timestamp: %llu, is_held: %d",
+					 cap_q->bufs[i]->index, q_status,
+					 cap_q->bufs[i]->timestamp,
+					 to_vb2_v4l2_buffer(cap_q->bufs[i])->is_held);
 
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, &buf[old_len]);
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s", &buf[old_len]);
+			tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, &buf[old_len]);
+			frame_dprintk(ctx->dev, run->dst->sequence, "%s", &buf[old_len]);
+		}
 	}
 }
 
drivers/media/test-drivers/visl/visl.h +0 -0
index 31639f2e593d..5a81b493f121 100644

drivers/media/test-drivers/visl/visl.h extern unsigned int visl_dprintk_nframes; · line 91

Quoted 7 lines
drivers/media/test-drivers/visl/visl.h +1 -0
@@ -85,6 +85,7 @@ extern unsigned int visl_dprintk_nframes;
 extern bool keep_bitstream_buffers;
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
+extern bool stable_output;
 
 #define frame_dprintk(dev, current, fmt, arg...) \
 	do { \

Should stable_output perhaps be 1 by default?

Regards,

Hans

#11 lore raw

Re: [PATCH v2 4/5] visl: Add a codec specific variability parameter

In reply to Detlev Casanova
Quoted 20 lines · Detlev Casanova

When running tests with different input data, the stable output frames could be too similar and hide possible issues.

This commit adds variation by using some codec specific parameters.

Only HEVC and H.264 support this.

---
 drivers/media/test-drivers/visl/visl-core.c |  5 ++++
 drivers/media/test-drivers/visl/visl-dec.c  | 27 +++++++++++++++++++++
 drivers/media/test-drivers/visl/visl.h      |  1 +
 3 files changed, 33 insertions(+)
drivers/media/test-drivers/visl/visl-core.c +0 -0
index d28d50afec02..e7466f6a91e1 100644

drivers/media/test-drivers/visl/visl-core.c module_param(stable_output, bool, 0644); · line 99

Quoted 7 lines
drivers/media/test-drivers/visl/visl-core.c +4 -0
@@ -93,6 +93,11 @@ module_param(stable_output, bool, 0644);
 MODULE_PARM_DESC(stable_output,
 		 " only write stable data for a given input on the output frames");
 
+bool codec_variability;
+module_param(codec_variability, bool, 0644);
+MODULE_PARM_DESC(codec_variability,
+		 " add codec specific variability data to generate more unique frames. (Only h.264 and hevc)");

Why make this a module parameter instead of always doing this?

It's not clear from the commit log why a parameter is needed.

Quoted 15 lines
drivers/media/test-drivers/visl/visl-core.c +1 -0
+
 static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {
 	{
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
drivers/media/test-drivers/visl/visl-dec.c +3 -0
index 61cfca49ead9..002d5e3b0ea4 100644
@@ -223,6 +223,26 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx,
 	}
 }
 
+static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx,
+					 struct visl_run *run,
+					 char buf[], size_t bufsz)

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx, · line 238

Quoted 10 lines
drivers/media/test-drivers/visl/visl-dec.c +10 -0
+{
+	switch (ctx->current_codec) {
+	case VISL_CODEC_H264:
+		scnprintf(buf, bufsz,
+			  "H264: %u", run->h264.dpram->pic_order_cnt_lsb);
+		break;
+	case VISL_CODEC_HEVC:
+		scnprintf(buf, bufsz,
+			  "HEVC: %d", run->hevc.dpram->pic_order_cnt_val);
+		break;

Perhaps mention here why these specific values are chosen?

Quoted 29 lines
drivers/media/test-drivers/visl/visl-dec.c +14 -0
+	default:
+		return false;
+	}
+
+	return true;
+}
+
 static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 {
 	u8 *basep[TPG_MAX_PLANES][2];
@@ -255,6 +275,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
 	frame_dprintk(ctx->dev, run->dst->sequence, "");
 	line++;
 
+	if (codec_variability && visl_tpg_fill_codec_specific(ctx, run, buf, TPG_STR_BUF_SZ)) {
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		line++;
+	}
+
 	if (!stable_output) {
 		visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
 
drivers/media/test-drivers/visl/visl.h +0 -0
index 5a81b493f121..4ac2d1783020 100644

drivers/media/test-drivers/visl/visl.h extern bool keep_bitstream_buffers; · line 92

Quoted 7 lines
drivers/media/test-drivers/visl/visl.h +1 -0
@@ -86,6 +86,7 @@ extern bool keep_bitstream_buffers;
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
 extern bool stable_output;
+extern bool codec_variability;
 
 #define frame_dprintk(dev, current, fmt, arg...) \
 	do { \

Regards,

Hans

#3 lore raw

Re: [PATCH v2 1/5] media: visl: Fix params permissions/defaults mismatch

In reply to Hans Verkuil
Quoted 23 lines · On Wednesday, November 22, 2023 10:56:20 A.M. EST Hans Verkuil wrote:
Quoted 22 lines · Detlev Casanova

false was used as the keep_bitstream_buffers parameter permissions. This looks more like a default value for the parameter, so change it to 0 to avoid confusion.

---

 drivers/media/test-drivers/visl/visl-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-core.c index 9970dc739ca5..df6515530fbf 100644

drivers/media/test-drivers/visl/visl-core.c +0 -0
@@ -74,7 +74,7 @@ MODULE_PARM_DESC(visl_dprintk_nframes,
 
 		 " the number of frames to trace with dprintk");
 
 bool keep_bitstream_buffers;
 
Quoted 7 lines

drivers/media/test-drivers/visl/visl-core.c MODULE_PARM_DESC(visl_dprintk_nframes, · line 77

Quoted 2 lines
drivers/media/test-drivers/visl/visl-core.c +1 -1
-module_param(keep_bitstream_buffers, bool, false);
+module_param(keep_bitstream_buffers, bool, 0);

???

This last parameter is the permission, it makes no sense that this is either 0 or false: then nobody can see it in /sys/modules/.

It makes sense if we want it set when the module is loaded only. This way, we don't have to manage the parameters values changing while work is being done and keep it simple.
It could be made readable if that looks better, but there is no real need for it to be read either.

Quoted 10 lines

Typically this is 0444 if it is readable only, or 0644 if it can be written by root.

Regards,

Hans

Quoted 3 lines
drivers/media/test-drivers/visl/visl-core.c +0 -0
 MODULE_PARM_DESC(keep_bitstream_buffers,

" keep bitstream buffers in debugfs after streaming is

stopped");

#7 lore raw

Re: [PATCH v2 2/5] media: visl: Add a stable_output parameter

In reply to Hans Verkuil
Quoted 21 lines · On Wednesday, November 22, 2023 11:03:53 A.M. EST Hans Verkuil wrote:
Quoted 20 lines · Detlev Casanova

This parameter is used to ensure that for a given input, the output frames are always identical so that it can be compared against a reference in automatic tests.

---

 drivers/media/test-drivers/visl/visl-core.c |   5 +
 drivers/media/test-drivers/visl/visl-dec.c  | 125 +++++++++++---------
 drivers/media/test-drivers/visl/visl.h      |   1 +
 3 files changed, 77 insertions(+), 54 deletions(-)
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-core.c index df6515530fbf..d28d50afec02 100644

drivers/media/test-drivers/visl/visl-core.c +0 -0
@@ -88,6 +88,11 @@ module_param(bitstream_trace_nframes, uint, 0);
 
Quoted 3 lines

drivers/media/test-drivers/visl/visl-core.c module_param(bitstream_trace_nframes, uint, 0);

Quoted 3 lines
drivers/media/test-drivers/visl/visl-core.c +0 -0
 MODULE_PARM_DESC(bitstream_trace_nframes,
 
 		 " the number of frames to dump the bitstream through 

debugfs");

Quoted 5 lines

drivers/media/test-drivers/visl/visl-core.c module_param(bitstream_trace_nframes, uint, 0);

Quoted 5 lines
drivers/media/test-drivers/visl/visl-core.c +4 -0
+bool stable_output;
+module_param(stable_output, bool, 0644);
+MODULE_PARM_DESC(stable_output,
+		 " only write stable data for a given input on the 

output frames");

Quoted 17 lines
Quoted 17 lines
drivers/media/test-drivers/visl/visl-core.c +1 -0
+
 
 static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {
drivers/media/test-drivers/visl/visl-core.c +0 -0
 	{
 
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-dec.c index 318d675e5668..61cfca49ead9 100644

drivers/media/test-drivers/visl/visl-dec.c +0 -0
@@ -197,19 +197,30 @@ static void visl_tpg_fill_sequence(struct visl_ctx
 *ctx,> 
 {
 
Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 6 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
 	u32 stream_ms;
 
-	stream_ms = jiffies_to_msecs(get_jiffies_64() -

ctx->capture_streamon_jiffies); -

drivers/media/test-drivers/visl/visl-dec.c +0 -2
-	scnprintf(buf, bufsz,
-		  "stream time: %02d:%02d:%02d:%03d sequence:%u 

timestamp:%lld

Quoted 6 lines
Quoted 6 lines

field:%s", - (stream_ms / (60 * 60 * 1000)) % 24,

drivers/media/test-drivers/visl/visl-dec.c +0 -5
-		  (stream_ms / (60 * 1000)) % 60,
-		  (stream_ms / 1000) % 60,
-		  stream_ms % 1000,
-		  run->dst->sequence,
-		  run->dst->vb2_buf.timestamp,
Quoted 8 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 8 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -3
-		  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
-		  (run->dst->field == V4L2_FIELD_TOP ?
-		  " top" : " bottom") : "none");
+	if (!stable_output) {
+		stream_ms = jiffies_to_msecs(get_jiffies_64() -

ctx->capture_streamon_jiffies); +

drivers/media/test-drivers/visl/visl-dec.c +2 -0
+		scnprintf(buf, bufsz,
+			  "stream time: %02d:%02d:%02d:%03d 

sequence:%u timestamp:%lld

Quoted 1 line
Quoted 1 line

field:%s", + (stream_ms / (60 * 60 *

1000)) % 24,

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx, · line 208

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +3 -0
+			  (stream_ms / (60 * 1000)) % 60,
+			  (stream_ms / 1000) % 60,
+			  stream_ms % 1000,

How useful is this 'stream time' anyway? I don't think this adds anything useful.

I suppose that the more debug information is shown, the better.

Quoted 25 lines
Quoted 25 lines
drivers/media/test-drivers/visl/visl-dec.c +15 -0
+			  run->dst->sequence,
+			  run->dst->vb2_buf.timestamp,
+			  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
+			  (run->dst->field == V4L2_FIELD_TOP ?
+			  " top" : " bottom") : "none");
+	} else {
+		scnprintf(buf, bufsz,
+			  "sequence:%u timestamp:%lld field:%s",
+			  run->dst->sequence,
+			  run->dst->vb2_buf.timestamp,
+			  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
+			  (run->dst->field == V4L2_FIELD_TOP ?
+			  " top" : " bottom") : "none");
+
+	}
 
 }
 
 static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
@@ -244,15 +255,17 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	frame_dprintk(ctx->dev, run->dst->sequence, "");
 	line++;
Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) · line 247

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-	visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);

This function shows both the ts of the ref frames and the buffer index. Is it just the buffer index that causes the problem? If so, then wouldn't it be better to either never show the buffer index or only if !stable_output.

Indeed, the buffer index is the issue, but I did not check if the ref frames ts are stable. I'll do some tests with it and keep the ref frames in stable output mode if they are stable.

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 5 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -2
+	if (!stable_output) {
+		visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
 
-	while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) {
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16, line_str);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

line_str);

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +1 -1
-	}
+		while ((line_str = strsep(&tmp, "\n")) && 

strlen(line_str)) {

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			tpg_gen_text(&ctx->tpg, basep, line++ * 

line_height, 16, line_str);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			frame_dprintk(ctx->dev, run->dst->sequence, 

"%s\n", line_str);

Quoted 8 lines
Quoted 8 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -2
+		}
 
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		line++;
+	}
Quoted 7 lines
Quoted 7 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	scnprintf(buf,
 
 		  TPG_STR_BUF_SZ,
@@ -280,28 +293,30 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>
frame_dprintk(ctx->dev, run->dst->sequence, "%s\n",

buf);

Quoted 13 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 13 lines
drivers/media/test-drivers/visl/visl-dec.c +5 -5
 	}
 
-	line++;
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	scnprintf(buf, TPG_STR_BUF_SZ, "Output queue status:");
-	tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
-	frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+	if (!stable_output) {
+		line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		scnprintf(buf, TPG_STR_BUF_SZ, "Output queue status:");
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16, buf);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

buf);

Quoted 4 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -3
-	len = 0;
-	for (i = 0; i < out_q->num_buffers; i++) {
-		char entry[] = "index: %u, state: %s, request_fd: %d, 

";

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -2
-		u32 old_len = len;
-		char *q_status = visl_get_vb2_state(out_q->bufs[i]-

state);

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +3 -0
+		len = 0;
+		for (i = 0; i < out_q->num_buffers; i++) {
+			char entry[] = "index: %u, state: %s, 

request_fd: %d, ";

Quoted 9 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -0
+			u32 old_len = len;
+			char *q_status = visl_get_vb2_state(out_q-

bufs[i]->state);

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -3
-		len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
-				 entry, i, q_status,
-				 to_vb2_v4l2_buffer(out_q-

bufs[i])->request_fd);

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			len += scnprintf(&buf[len], TPG_STR_BUF_SZ - 

len,

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -0
+					 entry, i, q_status,
+					 

to_vb2_v4l2_buffer(out_q->bufs[i])->request_fd);

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		len += visl_fill_bytesused(to_vb2_v4l2_buffer(out_q-

bufs[i]),

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -2
-					   &buf[len],
-					   TPG_STR_BUF_SZ - 

len);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			len += 

visl_fill_bytesused(to_vb2_v4l2_buffer(out_q->bufs[i]),

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+						   

&buf[len],

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+						   

TPG_STR_BUF_SZ - len);

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16,

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines

&buf[old_len]);

drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s", 

&buf[old_len]);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			tpg_gen_text(&ctx->tpg, basep, line++ * 

line_height, 16,

Quoted 11 lines
Quoted 1 line

&buf[old_len]); + frame_dprintk(ctx->dev, run-

dst->sequence, "%s",

Quoted 9 lines

&buf[old_len]); + }

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	}
 
 	line++;
@@ -333,25 +348,27 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>
frame_dprintk(ctx->dev, run->dst->sequence, "%s\n",

buf);

Quoted 12 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 12 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -5
 	}
 
-	line++;
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	scnprintf(buf, TPG_STR_BUF_SZ, "Capture queue status:");
-	tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
-	frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+	if (!stable_output) {
+		line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		scnprintf(buf, TPG_STR_BUF_SZ, "Capture queue 

status:");

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16, buf);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

buf);

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 5 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -4
-	len = 0;
-	for (i = 0; i < cap_q->num_buffers; i++) {
-		u32 old_len = len;
-		char *q_status = visl_get_vb2_state(cap_q->bufs[i]-

state);

Quoted 8 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -0
+		len = 0;
+		for (i = 0; i < cap_q->num_buffers; i++) {
+			u32 old_len = len;
+			char *q_status = visl_get_vb2_state(cap_q-

bufs[i]->state);

drivers/media/test-drivers/visl/visl-dec.c

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -2
-		len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
-				 "index: %u, status: %s, 

timestamp: %llu, is_held: %d",

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -3
-				 cap_q->bufs[i]->index, q_status,
-				 cap_q->bufs[i]->timestamp,
-				 to_vb2_v4l2_buffer(cap_q-

bufs[i])->is_held);

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			len += scnprintf(&buf[len], TPG_STR_BUF_SZ - 

len,

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 "index: %u, status: 

%s, timestamp: %llu, is_held: %d",

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 cap_q->bufs[i]-

index, q_status,

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 cap_q->bufs[i]-

timestamp,

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 

to_vb2_v4l2_buffer(cap_q->bufs[i])->is_held);

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16,

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines

&buf[old_len]);

drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s", 

&buf[old_len]);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			tpg_gen_text(&ctx->tpg, basep, line++ * 

line_height, 16,

Quoted 19 lines
Quoted 1 line

&buf[old_len]); + frame_dprintk(ctx->dev, run-

dst->sequence, "%s",

Quoted 17 lines

&buf[old_len]); + }

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	}
 
 }
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl.h index 31639f2e593d..5a81b493f121 100644

drivers/media/test-drivers/visl/visl.h +0 -0
@@ -85,6 +85,7 @@ extern unsigned int visl_dprintk_nframes;
 
 extern bool keep_bitstream_buffers;
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
 
Quoted 7 lines
Quoted 5 lines
drivers/media/test-drivers/visl/visl.h +1 -0
+extern bool stable_output;
 

#define frame_dprintk(dev, current, fmt, arg...) \

do { \

Should stable_output perhaps be 1 by default?

In that case, why not use the visl_debug parameter and show the unstable data only when it is set to one ?

--
Detlev

#12 lore raw

Re: [PATCH v2 4/5] visl: Add a codec specific variability parameter

In reply to Hans Verkuil
Quoted 24 lines · On Wednesday, November 22, 2023 11:07:18 A.M. EST Hans Verkuil wrote:
Quoted 23 lines · Detlev Casanova

When running tests with different input data, the stable output frames could be too similar and hide possible issues.

This commit adds variation by using some codec specific parameters.

Only HEVC and H.264 support this.

---

 drivers/media/test-drivers/visl/visl-core.c |  5 ++++
 drivers/media/test-drivers/visl/visl-dec.c  | 27 +++++++++++++++++++++
 drivers/media/test-drivers/visl/visl.h      |  1 +
 3 files changed, 33 insertions(+)
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-core.c index d28d50afec02..e7466f6a91e1 100644

drivers/media/test-drivers/visl/visl-core.c +0 -0
@@ -93,6 +93,11 @@ module_param(stable_output, bool, 0644);
 
Quoted 3 lines

drivers/media/test-drivers/visl/visl-core.c module_param(stable_output, bool, 0644);

Quoted 3 lines
drivers/media/test-drivers/visl/visl-core.c +0 -0
 MODULE_PARM_DESC(stable_output,
 
 		 " only write stable data for a given input on the 

output frames");

Quoted 5 lines

drivers/media/test-drivers/visl/visl-core.c module_param(stable_output, bool, 0644);

Quoted 5 lines
drivers/media/test-drivers/visl/visl-core.c +4 -0
+bool codec_variability;
+module_param(codec_variability, bool, 0644);
+MODULE_PARM_DESC(codec_variability,
+		 " add codec specific variability data to generate more 

unique frames.

Quoted 4 lines

drivers/media/test-drivers/visl/visl-core.c module_param(stable_output, bool, 0644); · line 101

Quoted 1 line
drivers/media/test-drivers/visl/visl-core.c +0 -0
 (Only h.264 and hevc)");

Why make this a module parameter instead of always doing this?

It's not clear from the commit log why a parameter is needed.

I agree with that, I started as a parameter when I wasn't sure what variability values or method would be used, but just showing a value can be integrated without a parameter and keep it more simple. I'll change that.

Quoted 17 lines
Quoted 17 lines
drivers/media/test-drivers/visl/visl-core.c +1 -0
+
 

static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {

drivers/media/test-drivers/visl/visl-core.c +0 -0
 	{
 
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-dec.c index 61cfca49ead9..002d5e3b0ea4 100644

drivers/media/test-drivers/visl/visl-dec.c +0 -0
@@ -223,6 +223,26 @@ static void visl_tpg_fill_sequence(struct visl_ctx
 *ctx,> 
 	}
 
Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx,

Quoted 5 lines
drivers/media/test-drivers/visl/visl-dec.c +3 -0
 }
 
+static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx,
+					 struct visl_run *run,
+					 char buf[], size_t 

bufsz)

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx,

Quoted 5 lines
drivers/media/test-drivers/visl/visl-dec.c +5 -0
+{
+	switch (ctx->current_codec) {
+	case VISL_CODEC_H264:
+		scnprintf(buf, bufsz,
+			  "H264: %u", run->h264.dpram-

pic_order_cnt_lsb);

Quoted 8 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx,

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -0
+		break;
+	case VISL_CODEC_HEVC:
+		scnprintf(buf, bufsz,
+			  "HEVC: %d", run->hevc.dpram-

pic_order_cnt_val);

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx · line 240

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		break;

Perhaps mention here why these specific values are chosen?

Will do.

Quoted 18 lines
Quoted 18 lines
drivers/media/test-drivers/visl/visl-dec.c +7 -0
+	default:
+		return false;
+	}
+
+	return true;
+}
+
 

static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) {

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	u8 *basep[TPG_MAX_PLANES][2];
@@ -255,6 +275,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	frame_dprintk(ctx->dev, run->dst->sequence, "");
 	line++;
Quoted 4 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+	if (codec_variability && visl_tpg_fill_codec_specific(ctx, run, buf,

TPG_STR_BUF_SZ)) { + tpg_gen_text(&ctx->tpg, basep, line++ *
line_height, 16, buf);

drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

buf);

Quoted 29 lines
Quoted 24 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -0
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		line++;
+	}
+
 
 	if (!stable_output) {
 
 		visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl.h index 5a81b493f121..4ac2d1783020 100644

drivers/media/test-drivers/visl/visl.h +1 -0
@@ -86,6 +86,7 @@ extern bool keep_bitstream_buffers;
 
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
 extern bool stable_output;
 
+extern bool codec_variability;
 

#define frame_dprintk(dev, current, fmt, arg...) \

Quoted 1 line

do { \

Regards,

Hans

#4 lore raw

Re: [PATCH v2 1/5] media: visl: Fix params permissions/defaults mismatch

In reply to Detlev Casanova
Quoted 29 lines · Detlev Casanova
Quoted 28 lines · On Wednesday, November 22, 2023 10:56:20 A.M. EST Hans Verkuil wrote:
Quoted 17 lines · Detlev Casanova

false was used as the keep_bitstream_buffers parameter permissions. This looks more like a default value for the parameter, so change it to 0 to avoid confusion.

---

 drivers/media/test-drivers/visl/visl-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-core.c index 9970dc739ca5..df6515530fbf 100644

drivers/media/test-drivers/visl/visl-core.c MODULE_PARM_DESC(visl_dprintk_nframes, · line 79

Quoted 7 lines
drivers/media/test-drivers/visl/visl-core.c +1 -1
@@ -74,7 +74,7 @@ MODULE_PARM_DESC(visl_dprintk_nframes,
 
 		 " the number of frames to trace with dprintk");
 
 bool keep_bitstream_buffers;
 
-module_param(keep_bitstream_buffers, bool, false);
+module_param(keep_bitstream_buffers, bool, 0);

???

Quoted 8 lines
Quoted 2 lines

This last parameter is the permission, it makes no sense that this is either 0 or false: then nobody can see it in /sys/modules/.

It makes sense if we want it set when the module is loaded only. This way, we don't have to manage the parameters values changing while work is being done and keep it simple.
It could be made readable if that looks better, but there is no real need for it to be read either.

Why not? It makes it easy to read what this module option's value is.

I now see that both visl and vidtv uses 0 a lot, so I'm OK with this patch for consistency.

But I think especially these test-drivers should use 0444 instead of 0 so you can see how the test driver is configured. That might actually be relevant when writing tests using these drivers.

Perhaps separate patches for visl and vidtv that change 0 to 0444 for all the module parameters?

Regards,

Hans

Quoted 13 lines
Quoted 11 lines

Typically this is 0444 if it is readable only, or 0644 if it can be written by root.

Regards,

Hans

Quoted 3 lines
drivers/media/test-drivers/visl/visl-core.c +0 -0
 MODULE_PARM_DESC(keep_bitstream_buffers,

" keep bitstream buffers in debugfs after streaming is

stopped");

#8 lore raw

Re: [PATCH v2 2/5] media: visl: Add a stable_output parameter

In reply to Detlev Casanova
Quoted 297 lines · Detlev Casanova
Quoted 21 lines · On Wednesday, November 22, 2023 11:03:53 A.M. EST Hans Verkuil wrote:
Quoted 20 lines · Detlev Casanova

This parameter is used to ensure that for a given input, the output frames are always identical so that it can be compared against a reference in automatic tests.

---

 drivers/media/test-drivers/visl/visl-core.c |   5 +
 drivers/media/test-drivers/visl/visl-dec.c  | 125 +++++++++++---------
 drivers/media/test-drivers/visl/visl.h      |   1 +
 3 files changed, 77 insertions(+), 54 deletions(-)
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-core.c index df6515530fbf..d28d50afec02 100644

drivers/media/test-drivers/visl/visl-core.c +0 -0
@@ -88,6 +88,11 @@ module_param(bitstream_trace_nframes, uint, 0);
 
Quoted 3 lines

drivers/media/test-drivers/visl/visl-core.c module_param(bitstream_trace_nframes, uint, 0);

Quoted 3 lines
drivers/media/test-drivers/visl/visl-core.c +0 -0
 MODULE_PARM_DESC(bitstream_trace_nframes,
 
 		 " the number of frames to dump the bitstream through 

debugfs");

Quoted 5 lines

drivers/media/test-drivers/visl/visl-core.c module_param(bitstream_trace_nframes, uint, 0);

Quoted 5 lines
drivers/media/test-drivers/visl/visl-core.c +4 -0
+bool stable_output;
+module_param(stable_output, bool, 0644);
+MODULE_PARM_DESC(stable_output,
+		 " only write stable data for a given input on the 

output frames");

Quoted 17 lines
Quoted 17 lines
drivers/media/test-drivers/visl/visl-core.c +1 -0
+
 
 static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = {
drivers/media/test-drivers/visl/visl-core.c +0 -0
 	{
 
 		.cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS,
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl-dec.c index 318d675e5668..61cfca49ead9 100644

drivers/media/test-drivers/visl/visl-dec.c +0 -0
@@ -197,19 +197,30 @@ static void visl_tpg_fill_sequence(struct visl_ctx
 *ctx,> 
 {
 
Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 6 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
 	u32 stream_ms;
 
-	stream_ms = jiffies_to_msecs(get_jiffies_64() -

ctx->capture_streamon_jiffies); -

drivers/media/test-drivers/visl/visl-dec.c +0 -2
-	scnprintf(buf, bufsz,
-		  "stream time: %02d:%02d:%02d:%03d sequence:%u 

timestamp:%lld

Quoted 6 lines
Quoted 6 lines

field:%s", - (stream_ms / (60 * 60 * 1000)) % 24,

drivers/media/test-drivers/visl/visl-dec.c +0 -5
-		  (stream_ms / (60 * 1000)) % 60,
-		  (stream_ms / 1000) % 60,
-		  stream_ms % 1000,
-		  run->dst->sequence,
-		  run->dst->vb2_buf.timestamp,
Quoted 8 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 8 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -3
-		  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
-		  (run->dst->field == V4L2_FIELD_TOP ?
-		  " top" : " bottom") : "none");
+	if (!stable_output) {
+		stream_ms = jiffies_to_msecs(get_jiffies_64() -

ctx->capture_streamon_jiffies); +

drivers/media/test-drivers/visl/visl-dec.c +2 -0
+		scnprintf(buf, bufsz,
+			  "stream time: %02d:%02d:%02d:%03d 

sequence:%u timestamp:%lld

Quoted 1 line
Quoted 1 line

field:%s", + (stream_ms / (60 * 60 *

1000)) % 24,

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill_sequence(struct visl_ctx *ctx, · line 208

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +3 -0
+			  (stream_ms / (60 * 1000)) % 60,
+			  (stream_ms / 1000) % 60,
+			  stream_ms % 1000,

How useful is this 'stream time' anyway? I don't think this adds anything useful.

I suppose that the more debug information is shown, the better.

Quoted 25 lines
Quoted 25 lines
drivers/media/test-drivers/visl/visl-dec.c +15 -0
+			  run->dst->sequence,
+			  run->dst->vb2_buf.timestamp,
+			  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
+			  (run->dst->field == V4L2_FIELD_TOP ?
+			  " top" : " bottom") : "none");
+	} else {
+		scnprintf(buf, bufsz,
+			  "sequence:%u timestamp:%lld field:%s",
+			  run->dst->sequence,
+			  run->dst->vb2_buf.timestamp,
+			  (run->dst->field == V4L2_FIELD_ALTERNATE) ?
+			  (run->dst->field == V4L2_FIELD_TOP ?
+			  " top" : " bottom") : "none");
+
+	}
 
 }
 
 static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)
@@ -244,15 +255,17 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	frame_dprintk(ctx->dev, run->dst->sequence, "");
 	line++;
Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) · line 247

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-	visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);

This function shows both the ts of the ref frames and the buffer index. Is it just the buffer index that causes the problem? If so, then wouldn't it be better to either never show the buffer index or only if !stable_output.

Indeed, the buffer index is the issue, but I did not check if the ref frames ts are stable. I'll do some tests with it and keep the ref frames in stable output mode if they are stable.

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 5 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -2
+	if (!stable_output) {
+		visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run);
 
-	while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) {
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16, line_str);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

line_str);

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +1 -1
-	}
+		while ((line_str = strsep(&tmp, "\n")) && 

strlen(line_str)) {

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			tpg_gen_text(&ctx->tpg, basep, line++ * 

line_height, 16, line_str);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			frame_dprintk(ctx->dev, run->dst->sequence, 

"%s\n", line_str);

Quoted 8 lines
Quoted 8 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -2
+		}
 
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		line++;
+	}
Quoted 7 lines
Quoted 7 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	scnprintf(buf,
 
 		  TPG_STR_BUF_SZ,
@@ -280,28 +293,30 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>
frame_dprintk(ctx->dev, run->dst->sequence, "%s\n",

buf);

Quoted 13 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 13 lines
drivers/media/test-drivers/visl/visl-dec.c +5 -5
 	}
 
-	line++;
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	scnprintf(buf, TPG_STR_BUF_SZ, "Output queue status:");
-	tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
-	frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+	if (!stable_output) {
+		line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		scnprintf(buf, TPG_STR_BUF_SZ, "Output queue status:");
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16, buf);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

buf);

Quoted 4 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -3
-	len = 0;
-	for (i = 0; i < out_q->num_buffers; i++) {
-		char entry[] = "index: %u, state: %s, request_fd: %d, 

";

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -2
-		u32 old_len = len;
-		char *q_status = visl_get_vb2_state(out_q->bufs[i]-

state);

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +3 -0
+		len = 0;
+		for (i = 0; i < out_q->num_buffers; i++) {
+			char entry[] = "index: %u, state: %s, 

request_fd: %d, ";

Quoted 9 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -0
+			u32 old_len = len;
+			char *q_status = visl_get_vb2_state(out_q-

bufs[i]->state);

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -3
-		len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
-				 entry, i, q_status,
-				 to_vb2_v4l2_buffer(out_q-

bufs[i])->request_fd);

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			len += scnprintf(&buf[len], TPG_STR_BUF_SZ - 

len,

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +2 -0
+					 entry, i, q_status,
+					 

to_vb2_v4l2_buffer(out_q->bufs[i])->request_fd);

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		len += visl_fill_bytesused(to_vb2_v4l2_buffer(out_q-

bufs[i]),

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -2
-					   &buf[len],
-					   TPG_STR_BUF_SZ - 

len);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			len += 

visl_fill_bytesused(to_vb2_v4l2_buffer(out_q->bufs[i]),

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+						   

&buf[len],

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+						   

TPG_STR_BUF_SZ - len);

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16,

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines

&buf[old_len]);

drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s", 

&buf[old_len]);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			tpg_gen_text(&ctx->tpg, basep, line++ * 

line_height, 16,

Quoted 11 lines
Quoted 1 line

&buf[old_len]); + frame_dprintk(ctx->dev, run-

dst->sequence, "%s",

Quoted 9 lines

&buf[old_len]); + }

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	}
 
 	line++;
@@ -333,25 +348,27 @@ static void visl_tpg_fill(struct visl_ctx *ctx,

struct visl_run *run)>
frame_dprintk(ctx->dev, run->dst->sequence, "%s\n",

buf);

Quoted 12 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 12 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -5
 	}
 
-	line++;
-	frame_dprintk(ctx->dev, run->dst->sequence, "");
-	scnprintf(buf, TPG_STR_BUF_SZ, "Capture queue status:");
-	tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 16, buf);
-	frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", buf);
+	if (!stable_output) {
+		line++;
+		frame_dprintk(ctx->dev, run->dst->sequence, "");
+		scnprintf(buf, TPG_STR_BUF_SZ, "Capture queue 

status:");

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16, buf);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+		frame_dprintk(ctx->dev, run->dst->sequence, "%s\n", 

buf);

Quoted 6 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 5 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -4
-	len = 0;
-	for (i = 0; i < cap_q->num_buffers; i++) {
-		u32 old_len = len;
-		char *q_status = visl_get_vb2_state(cap_q->bufs[i]-

state);

Quoted 8 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 4 lines
drivers/media/test-drivers/visl/visl-dec.c +4 -0
+		len = 0;
+		for (i = 0; i < cap_q->num_buffers; i++) {
+			u32 old_len = len;
+			char *q_status = visl_get_vb2_state(cap_q-

bufs[i]->state);

drivers/media/test-drivers/visl/visl-dec.c

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -2
-		len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len,
-				 "index: %u, status: %s, 

timestamp: %llu, is_held: %d",

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run)

Quoted 3 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -3
-				 cap_q->bufs[i]->index, q_status,
-				 cap_q->bufs[i]->timestamp,
-				 to_vb2_v4l2_buffer(cap_q-

bufs[i])->is_held);

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			len += scnprintf(&buf[len], TPG_STR_BUF_SZ - 

len,

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 "index: %u, status: 

%s, timestamp: %llu, is_held: %d",

Quoted 5 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 cap_q->bufs[i]-

index, q_status,

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 cap_q->bufs[i]-

timestamp,

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+					 

to_vb2_v4l2_buffer(cap_q->bufs[i])->is_held);

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines
drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		tpg_gen_text(&ctx->tpg, basep, line++ * line_height, 

16,

Quoted 2 lines

drivers/media/test-drivers/visl/visl-dec.c

Quoted 2 lines

&buf[old_len]);

drivers/media/test-drivers/visl/visl-dec.c +0 -1
-		frame_dprintk(ctx->dev, run->dst->sequence, "%s", 

&buf[old_len]);

Quoted 1 line

drivers/media/test-drivers/visl/visl-dec.c

Quoted 1 line
drivers/media/test-drivers/visl/visl-dec.c +1 -0
+			tpg_gen_text(&ctx->tpg, basep, line++ * 

line_height, 16,

Quoted 21 lines
Quoted 1 line

&buf[old_len]); + frame_dprintk(ctx->dev, run-

dst->sequence, "%s",

Quoted 19 lines

&buf[old_len]); + }

drivers/media/test-drivers/visl/visl-dec.c +0 -0
 	}
 
 }
(quoted diff) +0 -0

b/drivers/media/test-drivers/visl/visl.h index 31639f2e593d..5a81b493f121 100644

drivers/media/test-drivers/visl/visl.h +1 -0
@@ -85,6 +85,7 @@ extern unsigned int visl_dprintk_nframes;
 
 extern bool keep_bitstream_buffers;
 extern int bitstream_trace_frame_start;
 extern unsigned int bitstream_trace_nframes;
 
+extern bool stable_output;
 
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

#define frame_dprintk(dev, current, fmt, arg...) \

do { \

Should stable_output perhaps be 1 by default?

In that case, why not use the visl_debug parameter and show the unstable data only when it is set to one ?

I don't think that's a good idea. That parameter enables driver debugging output, and is meant to track down driver issues. It shouldn't be mixed with changing driver behavior.

Regards,

Hans

Quoted 3 lines

--
Detlev