From patchwork Wed Jan 17 15:10:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13521882 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B90512231D; Wed, 17 Jan 2024 15:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504334; cv=none; b=OjjyTAJWz8Q4O3D/RJOSpzzUa6WJdjG4+8omG6df8zFgDetIgRqswlPlJTEwlGYXvH0iloxCj5xraXikrV7M0wmkNellvArGpRL8G60TsH6h3EXdY7Xp1Lw+U1iTYW8SV0OqF/OsXU5kFHEUcbRJBQ+Q/FCahRAxjP290NTEyRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504334; c=relaxed/simple; bh=KJL7fJjmSJOdFxPriDXpzXsW8jCVL1vlFWIgAEf+FPk=; h=DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=sVw9deqnXzVS2XYH/UU2uoeQOVRvNf3lwa91/B6Bd22tMlP495vYWJZZ3Ux6y2GZBD6Yhbw8qij4bxki/NYdGNlcpdPoS+xTOpCQ75CZDB5duLC3SdsTeFPjFpQ0horhXH0e3CNcr06H7nDyIpYK2WVFqUJEytaRvbAUvXBUr0w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=FEOWh83q; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="FEOWh83q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705504331; bh=KJL7fJjmSJOdFxPriDXpzXsW8jCVL1vlFWIgAEf+FPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FEOWh83qwtH/f/B0y1VcRZYp3s6j9NQSxFxqsXtJB5AsVUu8Gy/50VLAnhzSrVKLV OOdRYGUklUIVMEWoWzBjehlq0B6RWxnYJjfaRrCdCXjMdAktn/XfbKYlnwSJDYrOQr M4s87hozrkTxh5hxc8a5eZBrMuZoN0XN+i0TnWlrTfnB8icvHZTHmkqamgtlw+/Sr8 q9oG22AuVaFvIrMdPyhfrOdPyW+ya3Xu7zSTlNJszmTcTaKRtGfALZrGs+rZAx9Duk bsoMaTQ7fQPwC2Q4+m7kipRfYMiK+3cqdf+EgkolWH0PKiNPxuGelvTSzDSFF6ouoU JfXcb/GmzRIzA== Received: from arisu.hitronhub.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id DDFE03782033; Wed, 17 Jan 2024 15:12:09 +0000 (UTC) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Hans Verkuil , Detlev Casanova Subject: [PATCH v5 1/4] media: visl,vidtv: Set parameters permissions to 0444 Date: Wed, 17 Jan 2024 10:10:15 -0500 Message-ID: <20240117151202.405426-2-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117151202.405426-1-detlev.casanova@collabora.com> References: <20240117151202.405426-1-detlev.casanova@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This avoids confusion with default values and lets userspace programs get the modules parameters values at run time. This can be useful when setting up a test suite. Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- .../media/test-drivers/vidtv/vidtv_bridge.c | 26 +++++++++---------- drivers/media/test-drivers/visl/visl-core.c | 10 +++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/media/test-drivers/vidtv/vidtv_bridge.c b/drivers/media/test-drivers/vidtv/vidtv_bridge.c index 8b04e12af286..613949df897d 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_bridge.c +++ b/drivers/media/test-drivers/vidtv/vidtv_bridge.c @@ -45,28 +45,28 @@ #define LNB_HIGH_FREQ 10600000 /* transition frequency */ static unsigned int drop_tslock_prob_on_low_snr; -module_param(drop_tslock_prob_on_low_snr, uint, 0); +module_param(drop_tslock_prob_on_low_snr, uint, 0444); MODULE_PARM_DESC(drop_tslock_prob_on_low_snr, "Probability of losing the TS lock if the signal quality is bad"); static unsigned int recover_tslock_prob_on_good_snr; -module_param(recover_tslock_prob_on_good_snr, uint, 0); +module_param(recover_tslock_prob_on_good_snr, uint, 0444); MODULE_PARM_DESC(recover_tslock_prob_on_good_snr, "Probability recovering the TS lock when the signal improves"); static unsigned int mock_power_up_delay_msec; -module_param(mock_power_up_delay_msec, uint, 0); +module_param(mock_power_up_delay_msec, uint, 0444); MODULE_PARM_DESC(mock_power_up_delay_msec, "Simulate a power up delay"); static unsigned int mock_tune_delay_msec; -module_param(mock_tune_delay_msec, uint, 0); +module_param(mock_tune_delay_msec, uint, 0444); MODULE_PARM_DESC(mock_tune_delay_msec, "Simulate a tune delay"); static unsigned int vidtv_valid_dvb_t_freqs[NUM_VALID_TUNER_FREQS] = { 474000000 }; -module_param_array(vidtv_valid_dvb_t_freqs, uint, NULL, 0); +module_param_array(vidtv_valid_dvb_t_freqs, uint, NULL, 0444); MODULE_PARM_DESC(vidtv_valid_dvb_t_freqs, "Valid DVB-T frequencies to simulate, in Hz"); @@ -74,19 +74,19 @@ static unsigned int vidtv_valid_dvb_c_freqs[NUM_VALID_TUNER_FREQS] = { 474000000 }; -module_param_array(vidtv_valid_dvb_c_freqs, uint, NULL, 0); +module_param_array(vidtv_valid_dvb_c_freqs, uint, NULL, 0444); MODULE_PARM_DESC(vidtv_valid_dvb_c_freqs, "Valid DVB-C frequencies to simulate, in Hz"); static unsigned int vidtv_valid_dvb_s_freqs[NUM_VALID_TUNER_FREQS] = { 11362000 }; -module_param_array(vidtv_valid_dvb_s_freqs, uint, NULL, 0); +module_param_array(vidtv_valid_dvb_s_freqs, uint, NULL, 0444); MODULE_PARM_DESC(vidtv_valid_dvb_s_freqs, "Valid DVB-S/S2 frequencies to simulate at Ku-Band, in kHz"); static unsigned int max_frequency_shift_hz; -module_param(max_frequency_shift_hz, uint, 0); +module_param(max_frequency_shift_hz, uint, 0444); MODULE_PARM_DESC(max_frequency_shift_hz, "Maximum shift in HZ allowed when tuning in a channel"); @@ -96,24 +96,24 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nums); * Influences the signal acquisition time. See ISO/IEC 13818-1 : 2000. p. 113. */ static unsigned int si_period_msec = 40; -module_param(si_period_msec, uint, 0); +module_param(si_period_msec, uint, 0444); MODULE_PARM_DESC(si_period_msec, "How often to send SI packets. Default: 40ms"); static unsigned int pcr_period_msec = 40; -module_param(pcr_period_msec, uint, 0); +module_param(pcr_period_msec, uint, 0444); MODULE_PARM_DESC(pcr_period_msec, "How often to send PCR packets. Default: 40ms"); static unsigned int mux_rate_kbytes_sec = 4096; -module_param(mux_rate_kbytes_sec, uint, 0); +module_param(mux_rate_kbytes_sec, uint, 0444); MODULE_PARM_DESC(mux_rate_kbytes_sec, "Mux rate: will pad stream if below"); static unsigned int pcr_pid = 0x200; -module_param(pcr_pid, uint, 0); +module_param(pcr_pid, uint, 0444); MODULE_PARM_DESC(pcr_pid, "PCR PID for all channels: defaults to 0x200"); static unsigned int mux_buf_sz_pkts; -module_param(mux_buf_sz_pkts, uint, 0); +module_param(mux_buf_sz_pkts, uint, 0444); MODULE_PARM_DESC(mux_buf_sz_pkts, "Size for the internal mux buffer in multiples of 188 bytes"); diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index 68dac896277b..12e93a7798d1 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -64,27 +64,27 @@ MODULE_PARM_DESC(visl_transtime_ms, " simulated process time in milliseconds."); * particular number of frames */ int visl_dprintk_frame_start = -1; -module_param(visl_dprintk_frame_start, int, 0); +module_param(visl_dprintk_frame_start, int, 0444); MODULE_PARM_DESC(visl_dprintk_frame_start, " a frame number to start tracing with dprintk"); unsigned int visl_dprintk_nframes; -module_param(visl_dprintk_nframes, uint, 0); +module_param(visl_dprintk_nframes, uint, 0444); 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, 0444); MODULE_PARM_DESC(keep_bitstream_buffers, " keep bitstream buffers in debugfs after streaming is stopped"); int bitstream_trace_frame_start = -1; -module_param(bitstream_trace_frame_start, int, 0); +module_param(bitstream_trace_frame_start, int, 0444); MODULE_PARM_DESC(bitstream_trace_frame_start, " a frame number to start dumping the bitstream through debugfs"); unsigned int bitstream_trace_nframes; -module_param(bitstream_trace_nframes, uint, 0); +module_param(bitstream_trace_nframes, uint, 0444); MODULE_PARM_DESC(bitstream_trace_nframes, " the number of frames to dump the bitstream through debugfs"); From patchwork Wed Jan 17 15:10:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13521883 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DB0122305; Wed, 17 Jan 2024 15:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504336; cv=none; b=c0RCZvuN5NYa1KIljOyeAAV6BKOB/tvEBOANQdjmmKjwE1JTiMVo0pYdByrr12m8GAJYgLylfGumtP5IJa7Q/pX2x7GlOC/WXgSa0nvrstUZR7qLT8T56qIYMIDLGqLLqG/AKsGBPqo02/xuQw24JVURPXCe8Aww3Hf8Iwf2Crw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504336; c=relaxed/simple; bh=OeZGrzzDz9+Z7c+xqVkwiTYFpYtIHAKFnSsD5ywyRss=; h=DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=LLV1DHVTjVhRaZ6jz19dcAedIVCzBuNhsXn4G6aAT60hIfBaXTbf77Z4jipH9XtoHA4Xd4nxnVA66hNsqLHBHpR5GM/NbMAMC8UsPExtdBAbyFwYrwYRHJCKcaGUWImRFOLziYqS5sNdKHPDZCx7slQ24SZeAxeSKI8Xh30MeGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=h2fnKMtK; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="h2fnKMtK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705504332; bh=OeZGrzzDz9+Z7c+xqVkwiTYFpYtIHAKFnSsD5ywyRss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h2fnKMtKkfpNwUNFBUC9FtbrPSH5KPlD5UAAE+a1mjZzVw/htz2y+2Ddc+e5BIAKg qr1eKrw3OOdDcehQ/zgeEDefVVUxLS0eFfPtJvaSAiLsorGEDDeUKuf4oHvIXBFnYs xn8lZwgPadiHRzeaZQH3+LyTaTddDwJY2dUaotadjupArA/GitCGns2cQMHERbrSF1 i1+Cy8rDfQn2AANdtOKGqgbCt2V3Rl4hcPgbMfebnnyouKnQdeuP77Zrnl+jnW/7Kh 6f+E3hnfzOpelFvCrqcwAC/PE0yKCC6o4kfEgB0ueRufgdC9VX7UTQ0M9Cv2sqkc3y gvuNBmUZ9m3+w== Received: from arisu.hitronhub.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 6CA283781FC7; Wed, 17 Jan 2024 15:12:11 +0000 (UTC) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Hans Verkuil , Detlev Casanova Subject: [PATCH v5 2/4] media: visl: Add a tpg_verbose parameter Date: Wed, 17 Jan 2024 10:10:16 -0500 Message-ID: <20240117151202.405426-3-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117151202.405426-1-detlev.casanova@collabora.com> References: <20240117151202.405426-1-detlev.casanova@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The text written on the output frames stable for a given input. Remove the unstable elements like pointers, buffer indexes or queues status so that frames are always identical and can be compared against a reference in automatic tests. As the unstable information can be relevant when debugging the API, add a tpg_verbose parameter to show them. Signed-off-by: Detlev Casanova --- drivers/media/test-drivers/visl/visl-core.c | 5 + drivers/media/test-drivers/visl/visl-dec.c | 265 +++++++++++--------- drivers/media/test-drivers/visl/visl.h | 1 + 3 files changed, 153 insertions(+), 118 deletions(-) diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index 12e93a7798d1..5afa8b73d979 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -88,6 +88,11 @@ module_param(bitstream_trace_nframes, uint, 0444); MODULE_PARM_DESC(bitstream_trace_nframes, " the number of frames to dump the bitstream through debugfs"); +bool tpg_verbose = false; +module_param(tpg_verbose, bool, 0644); +MODULE_PARM_DESC(tpg_verbose, + " add more verbose information on the generated output frames"); + static const struct visl_ctrl_desc visl_fwht_ctrl_descs[] = { { .cfg.id = V4L2_CID_STATELESS_FWHT_PARAMS, diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c index f21260054e0f..4933caa4f2a6 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -42,6 +42,22 @@ static void *plane_vaddr(struct tpg_data *tpg, struct vb2_buffer *buf, return vbuf; } +static void visl_print_ts_idx(u8 **buf, __kernel_size_t *buflen, const char* name, + u64 ts, struct vb2_buffer *vb2_buf) +{ + u32 len; + + if (tpg_verbose && vb2_buf) { + len = scnprintf(*buf, *buflen, "%s: %lld, vb2_idx: %d\n", name, + ts, vb2_buf->index); + } else { + len = scnprintf(*buf, *buflen, "%s: %lld\n", name, ts); + } + + *buf += len; + *buflen -= len; +} + static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, __kernel_size_t buflen, struct visl_run *run) { @@ -63,9 +79,9 @@ static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, vb2_buf = vb2_find_buffer(cap_q, run->fwht.params->backward_ref_ts); - scnprintf(buf, buflen, "backwards_ref_ts: %lld, vb2_idx: %d", - run->fwht.params->backward_ref_ts, - vb2_buf ? vb2_buf->index : -1); + visl_print_ts_idx(&buf, &buflen, "backwards_ref_ts", + run->fwht.params->backward_ref_ts, vb2_buf); + break; } @@ -76,13 +92,11 @@ static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, b_ref = vb2_find_buffer(cap_q, run->mpeg2.pic->backward_ref_ts); f_ref = vb2_find_buffer(cap_q, run->mpeg2.pic->forward_ref_ts); - scnprintf(buf, buflen, - "backward_ref_ts: %llu, vb2_idx: %d\n" - "forward_ref_ts: %llu, vb2_idx: %d\n", - run->mpeg2.pic->backward_ref_ts, - b_ref ? b_ref->index : -1, - run->mpeg2.pic->forward_ref_ts, - f_ref ? f_ref->index : -1); + visl_print_ts_idx(&buf, &buflen, "backward_ref_ts", + run->mpeg2.pic->backward_ref_ts, b_ref); + visl_print_ts_idx(&buf, &buflen, "forward_ref_ts", + run->mpeg2.pic->forward_ref_ts, f_ref); + break; } @@ -95,16 +109,13 @@ static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, golden = vb2_find_buffer(cap_q, run->vp8.frame->golden_frame_ts); alt = vb2_find_buffer(cap_q, run->vp8.frame->alt_frame_ts); - scnprintf(buf, buflen, - "last_ref_ts: %llu, vb2_idx: %d\n" - "golden_ref_ts: %llu, vb2_idx: %d\n" - "alt_ref_ts: %llu, vb2_idx: %d\n", - run->vp8.frame->last_frame_ts, - last ? last->index : -1, - run->vp8.frame->golden_frame_ts, - golden ? golden->index : -1, - run->vp8.frame->alt_frame_ts, - alt ? alt->index : -1); + visl_print_ts_idx(&buf, &buflen, "last_ref_ts", + run->vp8.frame->last_frame_ts, last); + visl_print_ts_idx(&buf, &buflen, "golden_ref_ts", + run->vp8.frame->golden_frame_ts, golden); + visl_print_ts_idx(&buf, &buflen, "alt_ref_ts", + run->vp8.frame->alt_frame_ts, alt); + break; } @@ -117,28 +128,32 @@ static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, golden = vb2_find_buffer(cap_q, run->vp9.frame->golden_frame_ts); alt = vb2_find_buffer(cap_q, run->vp9.frame->alt_frame_ts); - scnprintf(buf, buflen, - "last_ref_ts: %llu, vb2_idx: %d\n" - "golden_ref_ts: %llu, vb2_idx: %d\n" - "alt_ref_ts: %llu, vb2_idx: %d\n", - run->vp9.frame->last_frame_ts, - last ? last->index : -1, - run->vp9.frame->golden_frame_ts, - golden ? golden->index : -1, - run->vp9.frame->alt_frame_ts, - alt ? alt->index : -1); + visl_print_ts_idx(&buf, &buflen, "last_ref_ts", + run->vp9.frame->last_frame_ts, last); + visl_print_ts_idx(&buf, &buflen, "golden_ref_ts", + run->vp9.frame->golden_frame_ts, golden); + visl_print_ts_idx(&buf, &buflen, "alt_ref_ts", + run->vp9.frame->alt_frame_ts, alt); + break; } case VISL_CODEC_H264: { char entry[] = "dpb[%d]:%u, vb2_index: %d\n"; + char entry_stable[] = "dpb[%d]:%u\n"; struct vb2_buffer *vb2_buf; for (i = 0; i < ARRAY_SIZE(run->h264.dpram->dpb); i++) { - vb2_buf = vb2_find_buffer(cap_q, run->h264.dpram->dpb[i].reference_ts); - len = scnprintf(buf, buflen, entry, i, - run->h264.dpram->dpb[i].reference_ts, - vb2_buf ? vb2_buf->index : -1); + vb2_buf = vb2_find_buffer(cap_q, + run->h264.dpram->dpb[i].reference_ts); + if (tpg_verbose && vb2_buf) { + len = scnprintf(buf, buflen, entry, i, + run->h264.dpram->dpb[i].reference_ts, + vb2_buf->index); + } else { + len = scnprintf(buf, buflen, entry_stable, i, + run->h264.dpram->dpb[i].reference_ts); + } buf += len; buflen -= len; } @@ -148,13 +163,20 @@ static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, case VISL_CODEC_HEVC: { char entry[] = "dpb[%d]:%u, vb2_index: %d\n"; + char entry_stable[] = "dpb[%d]:%u\n"; struct vb2_buffer *vb2_buf; for (i = 0; i < ARRAY_SIZE(run->hevc.dpram->dpb); i++) { vb2_buf = vb2_find_buffer(cap_q, run->hevc.dpram->dpb[i].timestamp); - len = scnprintf(buf, buflen, entry, i, - run->hevc.dpram->dpb[i].timestamp, - vb2_buf ? vb2_buf->index : -1); + if (tpg_verbose && vb2_buf) { + len = scnprintf(buf, buflen, entry, i, + run->hevc.dpram->dpb[i].timestamp, + vb2_buf->index); + } else { + len = scnprintf(buf, buflen, entry_stable, i, + run->hevc.dpram->dpb[i].timestamp); + } + buf += len; buflen -= len; } @@ -171,43 +193,38 @@ static void visl_get_ref_frames(struct visl_ctx *ctx, u8 *buf, int idx_alt2 = run->av1.frame->ref_frame_idx[ALT2_BUF_IDX]; int idx_alt = run->av1.frame->ref_frame_idx[ALT_BUF_IDX]; + const u64 *reference_frame_ts = run->av1.frame->reference_frame_ts; + struct vb2_buffer *ref_last = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_last]); + vb2_find_buffer(cap_q, reference_frame_ts[idx_last]); struct vb2_buffer *ref_last2 = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_last2]); + vb2_find_buffer(cap_q, reference_frame_ts[idx_last2]); struct vb2_buffer *ref_last3 = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_last3]); + vb2_find_buffer(cap_q, reference_frame_ts[idx_last3]); struct vb2_buffer *ref_golden = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_golden]); + vb2_find_buffer(cap_q, reference_frame_ts[idx_golden]); struct vb2_buffer *ref_bwd = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_bwd]); + vb2_find_buffer(cap_q, reference_frame_ts[idx_bwd]); struct vb2_buffer *ref_alt2 = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_alt2]); + vb2_find_buffer(cap_q, reference_frame_ts[idx_alt2]); struct vb2_buffer *ref_alt = - vb2_find_buffer(cap_q, run->av1.frame->reference_frame_ts[idx_alt]); - - scnprintf(buf, buflen, - "ref_last_ts: %llu, vb2_idx: %d\n" - "ref_last2_ts: %llu, vb2_idx: %d\n" - "ref_last3_ts: %llu, vb2_idx: %d\n" - "ref_golden_ts: %llu, vb2_idx: %d\n" - "ref_bwd_ts: %llu, vb2_idx: %d\n" - "ref_alt2_ts: %llu, vb2_idx: %d\n" - "ref_alt_ts: %llu, vb2_idx: %d\n", - run->av1.frame->reference_frame_ts[idx_last], - ref_last ? ref_last->index : -1, - run->av1.frame->reference_frame_ts[idx_last2], - ref_last2 ? ref_last2->index : -1, - run->av1.frame->reference_frame_ts[idx_last3], - ref_last3 ? ref_last3->index : -1, - run->av1.frame->reference_frame_ts[idx_golden], - ref_golden ? ref_golden->index : -1, - run->av1.frame->reference_frame_ts[idx_bwd], - ref_bwd ? ref_bwd->index : -1, - run->av1.frame->reference_frame_ts[idx_alt2], - ref_alt2 ? ref_alt2->index : -1, - run->av1.frame->reference_frame_ts[idx_alt], - ref_alt ? ref_alt->index : -1); + vb2_find_buffer(cap_q, reference_frame_ts[idx_alt]); + + visl_print_ts_idx(&buf, &buflen, "ref_last_ts", + reference_frame_ts[idx_last], ref_last); + visl_print_ts_idx(&buf, &buflen, "ref_last2_ts", + reference_frame_ts[idx_last2], ref_last2); + visl_print_ts_idx(&buf, &buflen, "ref_last3_ts", + reference_frame_ts[idx_last3], ref_last3); + visl_print_ts_idx(&buf, &buflen, "ref_golden_ts", + reference_frame_ts[idx_golden], ref_golden); + visl_print_ts_idx(&buf, &buflen, "ref_bwd_ts", + reference_frame_ts[idx_bwd], ref_bwd); + visl_print_ts_idx(&buf, &buflen, "ref_alt2_ts", + reference_frame_ts[idx_alt2], ref_alt2); + visl_print_ts_idx(&buf, &buflen, "ref_alt_ts", + reference_frame_ts[idx_alt], ref_alt); + break; } } @@ -254,15 +271,23 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx, struct visl_run *run, char buf[], size_t bufsz) { u32 stream_ms; - - stream_ms = jiffies_to_msecs(get_jiffies_64() - ctx->capture_streamon_jiffies); + int len; + + if (tpg_verbose) { + stream_ms = jiffies_to_msecs(get_jiffies_64() - ctx->capture_streamon_jiffies); + + len = scnprintf(buf, bufsz, + "stream time: %02d:%02d:%02d:%03d ", + (stream_ms / (60 * 60 * 1000)) % 24, + (stream_ms / (60 * 1000)) % 60, + (stream_ms / 1000) % 60, + stream_ms % 1000); + buf += len; + bufsz -= len; + } 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, + "sequence:%u timestamp:%lld field:%s", run->dst->sequence, run->dst->vb2_buf.timestamp, (run->dst->field == V4L2_FIELD_ALTERNATE) ? @@ -338,35 +363,37 @@ 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 (tpg_verbose) { + 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 < vb2_get_num_buffers(out_q); i++) { - char entry[] = "index: %u, state: %s, request_fd: %d, "; - u32 old_len = len; - struct vb2_buffer *vb2; - char *q_status; + len = 0; + for (i = 0; i < vb2_get_num_buffers(out_q); i++) { + char entry[] = "index: %u, state: %s, request_fd: %d, "; + u32 old_len = len; + struct vb2_buffer *vb2; + char *q_status; - vb2 = vb2_get_buffer(out_q, i); - if (!vb2) - continue; + vb2 = vb2_get_buffer(out_q, i); + if (!vb2) + continue; - q_status = visl_get_vb2_state(vb2->state); + q_status = visl_get_vb2_state(vb2->state); - len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len, - entry, i, q_status, - to_vb2_v4l2_buffer(vb2)->request_fd); + len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len, + entry, i, q_status, + to_vb2_v4l2_buffer(vb2)->request_fd); - len += visl_fill_bytesused(to_vb2_v4l2_buffer(vb2), - &buf[len], - TPG_STR_BUF_SZ - len); + len += visl_fill_bytesused(to_vb2_v4l2_buffer(vb2), + &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++; @@ -398,32 +425,34 @@ 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 (tpg_verbose) { + 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 < vb2_get_num_buffers(cap_q); i++) { - u32 old_len = len; - struct vb2_buffer *vb2; - char *q_status; + len = 0; + for (i = 0; i < vb2_get_num_buffers(cap_q); i++) { + u32 old_len = len; + struct vb2_buffer *vb2; + char *q_status; - vb2 = vb2_get_buffer(cap_q, i); - if (!vb2) - continue; + vb2 = vb2_get_buffer(cap_q, i); + if (!vb2) + continue; - q_status = visl_get_vb2_state(vb2->state); + q_status = visl_get_vb2_state(vb2->state); - len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len, - "index: %u, status: %s, timestamp: %llu, is_held: %d", - vb2->index, q_status, - vb2->timestamp, - to_vb2_v4l2_buffer(vb2)->is_held); + len += scnprintf(&buf[len], TPG_STR_BUF_SZ - len, + "index: %u, status: %s, timestamp: %llu, is_held: %d", + vb2->index, q_status, + vb2->timestamp, + to_vb2_v4l2_buffer(vb2)->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]); + } } } diff --git a/drivers/media/test-drivers/visl/visl.h b/drivers/media/test-drivers/visl/visl.h index c593b1337f11..434e9efbf9b2 100644 --- a/drivers/media/test-drivers/visl/visl.h +++ b/drivers/media/test-drivers/visl/visl.h @@ -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 tpg_verbose; #define frame_dprintk(dev, current, fmt, arg...) \ do { \ From patchwork Wed Jan 17 15:10:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13521884 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8C202232F; Wed, 17 Jan 2024 15:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504337; cv=none; b=uNqihsyyl7XfiAfbrLLl2Qbe44T4qtpOy3vmtiubzfCpaaHHNtZFCOQWZwiYHtsW6Sp4PrrveRk7A1V0gFprmpkuKG24eMAlqkQtmOEXJJr9W0OGWqylLCGoYneVTLq0hQoGEHWaAnxXTPyRMDzm/E4GmnH5C0hCS1JrR9cLNHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504337; c=relaxed/simple; bh=LlaH55pFjbWivU+dttpe9o8/QD9wyqoX5RfDenXs8uQ=; h=DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=eCmkVlrVW/dLxthTjVA44iVDZUASI57gE/kerBkBa/PpkVbt640gJQ4mhDvo8JlS5HbxrO17YtZXLFAU5jSs9PE+BZD0flKhhn9GTlwRwtb/LuSxpOBbQmgWAqRf7Kft6nsTTT/RnZUedCciI8xVI49GkoWTd4UjjMYwSltZX/g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=UXOWctkc; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="UXOWctkc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705504334; bh=LlaH55pFjbWivU+dttpe9o8/QD9wyqoX5RfDenXs8uQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UXOWctkcRIkFtTC1POhkkYkF0FzjkM5GarfK93CLKxuTVQlLRJk+dvs56P0Wwq7kr KEF2sUuxybHTZY/n7/VtxB3OYlT1UsXN/MVjJCtBRxB4rVs8MCLDopGrYDS8fw3YYZ PvmUkT52O9gk0afPRLUa4roebVkC6UFmSiXuQ0FPeoP5pEi1LFya38rGTBKho4tUvU XbIR03zKLFVFW2TTnPDIZetDGS5wYdnuOkrZUdjB1ADGcLjNJi/i2jwUnUONNt51xG z4FwTRiDPme09R+JHWJ78u2U2M9U3PbjJYsLgni2ruCD9W0pudaWGH7FU+spRQLVGC fNpAqq83Tt6tg== Received: from arisu.hitronhub.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id F1D1A378206F; Wed, 17 Jan 2024 15:12:12 +0000 (UTC) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Hans Verkuil , Detlev Casanova Subject: [PATCH v5 3/4] doc: visl: Document tpg_verbose parameter Date: Wed, 17 Jan 2024 10:10:17 -0500 Message-ID: <20240117151202.405426-4-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117151202.405426-1-detlev.casanova@collabora.com> References: <20240117151202.405426-1-detlev.casanova@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Also document stable frames and what it means for testing tools. Signed-off-by: Detlev Casanova --- Documentation/admin-guide/media/visl.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/media/visl.rst b/Documentation/admin-guide/media/visl.rst index db1ef29438e1..cd45145cde68 100644 --- a/Documentation/admin-guide/media/visl.rst +++ b/Documentation/admin-guide/media/visl.rst @@ -49,6 +49,10 @@ Module parameters visl_dprintk_frame_start, visl_dprintk_nframes, but controls the dumping of buffer data through debugfs instead. +- tpg_verbose: Write extra information on each output frame to ease debugging + the API. When set to true, the output frames are not stable for a given input + as some information like pointers or queue status will be added to them. + What is the default use case for this driver? --------------------------------------------- @@ -57,8 +61,12 @@ This assumes that a working client is run against visl and that the ftrace and OUTPUT buffer data is subsequently used to debug a work-in-progress implementation. -Information on reference frames, their timestamps, the status of the OUTPUT and -CAPTURE queues and more can be read directly from the CAPTURE buffers. +Even though no video decoding is actually done, the output frames can be used +against a reference for a given input, except if tpg_verbose is set to true. + +Depending on the tpg_verbose parameter value, information on reference frames, +their timestamps, the status of the OUTPUT and CAPTURE queues and more can be +read directly from the CAPTURE buffers. Supported codecs ---------------- From patchwork Wed Jan 17 15:10:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13521885 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A95224C6; Wed, 17 Jan 2024 15:12:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504338; cv=none; b=PD9WRQrIomyz847HRPzrfMrf55XHFYBD7F9kKECAJw3b9xvy4KzvyuxB9aArN6A7Tol0CiaQlkUYB2nymnYvyZ4Vbx43VAj59B+bZwRasUMy5n0v1qIl4Uv8wdcmZR46MpnoHKMmvbvGAtTG+KjVYtnPWq80nTqpYlxtqsSyK1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705504338; c=relaxed/simple; bh=YvV1/JkCbzQT0j8DI4iZqxHvsPZ+nnCbsag0eB+AyhY=; h=DKIM-Signature:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; b=izHjRkFT5d/wbxpor8uiNo1cVi/AcnhEqYpfeKS1rvY3eyGmE+wbR8g1NuSdfAPTF33VDmt1eugSoXbHQJBe8pwvdW2D82mb0nFoi5hwZ2LRRlqTlyY96cPsLfRivXG+5Mm+dcEf8Dy3XuKMqpUOvnqE/KWqlQAPvb11/byb2RY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=WueU6Fx7; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="WueU6Fx7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705504335; bh=YvV1/JkCbzQT0j8DI4iZqxHvsPZ+nnCbsag0eB+AyhY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WueU6Fx7NT8BEXRelCzVECi8C0NRwNZSidN4uV2UCe8WF4Uw+KgJFVI2jY7iFuWB6 LjDOVQA6aFqNZxddyniFF3i140Zm+c0EottykV2XrqECvq+c363ayDa8pXojiqKdsN 3aME0ak3066SPQvhkUPk3N01TxVACOfL0VSQt+I4BAT3qaHravqNb2eb6DjFe/ntFj dlTTfYfyJfrthgaiyQTR2aT6lqynr2lGyahZPCQScxMnc9YO3xk5sHz5ThcEh1Tr6l gyPdKfvfBEreZzVxW2mkSYs7bCuWoOZbJe2Tu6tKL34UAsKlKMSKofkWEuHIimO6cN JjG5I+Y8sCOqw== Received: from arisu.hitronhub.home (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: detlev) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 809B63782070; Wed, 17 Jan 2024 15:12:14 +0000 (UTC) From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Hans Verkuil , Detlev Casanova Subject: [PATCH v5 4/4] visl: Add codec specific variability on output frames Date: Wed, 17 Jan 2024 10:10:18 -0500 Message-ID: <20240117151202.405426-5-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117151202.405426-1-detlev.casanova@collabora.com> References: <20240117151202.405426-1-detlev.casanova@collabora.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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. Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- drivers/media/test-drivers/visl/visl-dec.c | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c index 4933caa4f2a6..1540948119ca 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -295,6 +295,35 @@ static void visl_tpg_fill_sequence(struct visl_ctx *ctx, " top" : " bottom") : "none"); } +static bool visl_tpg_fill_codec_specific(struct visl_ctx *ctx, + struct visl_run *run, + char buf[], size_t bufsz) +{ + /* + * To add variability, we need a value that is stable for a given + * input but is different than already shown fields. + * The pic order count value defines the display order of the frames + * (which can be different than the decoding order that is shown with + * the sequence number). + * Therefore it is stable for a given input and will add a different + * value that is more specific to the way the input is encoded. + */ + 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]; @@ -327,6 +356,13 @@ static void visl_tpg_fill(struct visl_ctx *ctx, struct visl_run *run) frame_dprintk(ctx->dev, run->dst->sequence, ""); line++; + if (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++; + } + visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run); while ((line_str = strsep(&tmp, "\n")) && strlen(line_str)) {