From patchwork Tue Oct 24 19:09:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13435204 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2865FC07545 for ; Tue, 24 Oct 2023 19:10:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344227AbjJXTKZ (ORCPT ); Tue, 24 Oct 2023 15:10:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343884AbjJXTKX (ORCPT ); Tue, 24 Oct 2023 15:10:23 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91AE710C3; Tue, 24 Oct 2023 12:10:21 -0700 (PDT) Received: from arisu.hitronhub.home (unknown [23.233.251.139]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id B43936607333; Tue, 24 Oct 2023 20:10:19 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698174620; bh=QzXZQ5qW45emjNZOoZBacDZXLZ1f0TmfU80OiA4TC/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UYvc3HSAZvat0g51dUgwMnhIxMzTeig7f+ZRkCB+EbDN/SJLW34szjzL56d22Gp/J szJIoheeTE8w2mXrAj2lyu7Gs5PPUpJ/03vc3Zb5qfghWf7C9NeHSOtjksAVyrKQrR NV9V9dOUrSoRItv3hi/Xs8gKC1PDCuxI1ZlfRe8m9oZoyMgTDod5PB3QabOGuTv0U1 0miFeOdpiydJDk33YtmXLbzJPbaYNsoPanqP+2dzbzWOifdDbBHaQwN/y6ulr62xOi C0WGxZ4/TeZhRYumDIDXRoZNN6W/srooulskWly3Qq3MJ7Jmcx6GThxBXn8m+3ab6o pSFaRocKP16Og== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH v2 1/5] media: visl: Fix params permissions/defaults mismatch Date: Tue, 24 Oct 2023 15:09:46 -0400 Message-ID: <20231024191027.305622-2-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024191027.305622-1-detlev.casanova@collabora.com> References: <20231024191027.305622-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org `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. Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- drivers/media/test-drivers/visl/visl-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index 9970dc739ca5..df6515530fbf 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -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"); From patchwork Tue Oct 24 19:09:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13435206 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFBE7C25B6C for ; Tue, 24 Oct 2023 19:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344245AbjJXTK3 (ORCPT ); Tue, 24 Oct 2023 15:10:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344232AbjJXTKZ (ORCPT ); Tue, 24 Oct 2023 15:10:25 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF86F10C6; Tue, 24 Oct 2023 12:10:22 -0700 (PDT) Received: from arisu.hitronhub.home (unknown [23.233.251.139]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 9D4196607324; Tue, 24 Oct 2023 20:10:20 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698174621; bh=t1TeU6FLfPr3toRNJpSXAr038MxZO0xCNid62XMKzcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dr4eQw/5o1YwI4tNZEATXpkUIcGc1x3rpipznMaY0PiQ41pQ4sailtAPeK6xWsMSk YS66z0X7negEWFDdr1NOmaAal7FuYv/w3d+BaeUVOkFhAHwNC1NwwgjQsJ36Lsir2v /EC713GSih0b+4lI7G1tv0U45ZFfXzmvqRpJVhF0rQYUkGJ6uhlVyHNUZQnaOWDzZp TBVJFVLrFiijeH4mpYNXOpu/03KEpjZKmweI/nk95xmNvMLhsmmXCqMNobqTtQP20N 24ktXqHD8XJCiRe29uYo5Hoi1lB31vqFxJf32KTxRpOHGkl5937KZ9hw1R7agY1+BO qPKm1Wh0eEloA== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH v2 2/5] media: visl: Add a stable_output parameter Date: Tue, 24 Oct 2023 15:09:47 -0400 Message-ID: <20231024191027.305622-3-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024191027.305622-1-detlev.casanova@collabora.com> References: <20231024191027.305622-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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. Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- 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(-) diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index df6515530fbf..d28d50afec02 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, 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, diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c index 318d675e5668..61cfca49ead9 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -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 ? - " 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, + 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) frame_dprintk(ctx->dev, run->dst->sequence, ""); line++; - visl_get_ref_frames(ctx, buf, TPG_STR_BUF_SZ, run); + 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]); + } } } diff --git a/drivers/media/test-drivers/visl/visl.h b/drivers/media/test-drivers/visl/visl.h index 31639f2e593d..5a81b493f121 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 stable_output; #define frame_dprintk(dev, current, fmt, arg...) \ do { \ From patchwork Tue Oct 24 19:09:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13435205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7D0DC25B47 for ; Tue, 24 Oct 2023 19:10:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344240AbjJXTK2 (ORCPT ); Tue, 24 Oct 2023 15:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344229AbjJXTKZ (ORCPT ); Tue, 24 Oct 2023 15:10:25 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E8F10C3; Tue, 24 Oct 2023 12:10:23 -0700 (PDT) Received: from arisu.hitronhub.home (unknown [23.233.251.139]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 83524660733F; Tue, 24 Oct 2023 20:10:21 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698174622; bh=yF40Xq3h7w8x7LM+PWjWKuBLlfU8AeTqO96Ax5XsgdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wx89WaWSslOyustoDPiV09uboUE5dHipiNiUWBnTQG8C1LDXNIvMvTPMZmAWSiX03 xHSYl/COlxnH7hE0GjHhCaxv0sm1gmc48oXm1QB06Wp5YcCHt58sNMNgGS2cjMGapo MhogDwhidaEvqpwy1soTSHlzdY2CfFQ6qWP4dV/WpHetw9t1DqDCLIza7ol+xKxX8S 9J7kopjnsCmXK1P1Wuly/pR6rJ3TVz6CqqJnala621o1PymHsRlDmA9zP2n3CEkZMc W7vsYvawoEIZZE/mbZakqdrts3ziwUYCTXJelH3Rnm1GCsp8Q82kR95p1/D7Zt87Ix riSgceuhGHlHQ== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH v2 3/5] doc: visl: Document stable_output parameter Date: Tue, 24 Oct 2023 15:09:48 -0400 Message-ID: <20231024191027.305622-4-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024191027.305622-1-detlev.casanova@collabora.com> References: <20231024191027.305622-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- Documentation/admin-guide/media/visl.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/admin-guide/media/visl.rst b/Documentation/admin-guide/media/visl.rst index 7d2dc78341c9..5b26fd943571 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. +- 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? --------------------------------------------- From patchwork Tue Oct 24 19:09:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13435207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4623C07545 for ; Tue, 24 Oct 2023 19:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344238AbjJXTKc (ORCPT ); Tue, 24 Oct 2023 15:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344221AbjJXTK0 (ORCPT ); Tue, 24 Oct 2023 15:10:26 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780CF10CC; Tue, 24 Oct 2023 12:10:24 -0700 (PDT) Received: from arisu.hitronhub.home (unknown [23.233.251.139]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 72F816607341; Tue, 24 Oct 2023 20:10:22 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698174623; bh=QRNnyfDPh/PXwX0PmkSFtoq3caKA5wE007wFtnoCkZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iP0GJvzRyYxX85+iT4X7KbeUUy4WlRX1Mk22rzyRKFAzjIQDDAlp8lkaStrVjzBSc 02dDlU9qASwSsZku2fP1+RNPRX3rtE7XwgFYz4xxybzbUA0j827viQkc2nYVkIUuSu z53RZfyrr2jzzAXO3cfv0KBjzIlMoTf6lkNFyi0T3A4GlDtI/TfGpXBabYCB6/YwjW GEmc/EOFFOEiF4On8CVK7DXH40PlfV/a6AA45y9dypZe9Kz5BRMw1rSD6ITo5ebC95 Q+jUxH/oVLQHzxwfKEdHo4AbdZx5ib14kwxSP0EEsn32sB0/j6aGIXWDTcbl6T7t6c LzEIclzlh1HTA== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH v2 4/5] visl: Add a codec specific variability parameter Date: Tue, 24 Oct 2023 15:09:49 -0400 Message-ID: <20231024191027.305622-5-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024191027.305622-1-detlev.casanova@collabora.com> References: <20231024191027.305622-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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-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(+) diff --git a/drivers/media/test-drivers/visl/visl-core.c b/drivers/media/test-drivers/visl/visl-core.c index d28d50afec02..e7466f6a91e1 100644 --- a/drivers/media/test-drivers/visl/visl-core.c +++ b/drivers/media/test-drivers/visl/visl-core.c @@ -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, diff --git a/drivers/media/test-drivers/visl/visl-dec.c b/drivers/media/test-drivers/visl/visl-dec.c index 61cfca49ead9..002d5e3b0ea4 100644 --- a/drivers/media/test-drivers/visl/visl-dec.c +++ b/drivers/media/test-drivers/visl/visl-dec.c @@ -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); diff --git a/drivers/media/test-drivers/visl/visl.h b/drivers/media/test-drivers/visl/visl.h index 5a81b493f121..4ac2d1783020 100644 --- a/drivers/media/test-drivers/visl/visl.h +++ b/drivers/media/test-drivers/visl/visl.h @@ -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 { \ From patchwork Tue Oct 24 19:09:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13435208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9022FC25B6C for ; Tue, 24 Oct 2023 19:10:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344268AbjJXTKe (ORCPT ); Tue, 24 Oct 2023 15:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344250AbjJXTKb (ORCPT ); Tue, 24 Oct 2023 15:10:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4630293; Tue, 24 Oct 2023 12:10:25 -0700 (PDT) Received: from arisu.hitronhub.home (unknown [23.233.251.139]) (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 madras.collabora.co.uk (Postfix) with ESMTPSA id 69EE66607326; Tue, 24 Oct 2023 20:10:23 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698174624; bh=ik2lJ68nmMdHse/0Pbl+ym8554daPlCABLkgBBaT6pg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BAytmgOax273LxN5RaxTJMxPjBYDB523K3SXGGVOmBqz7bvx06OarJbHdzD9stAh2 OOO2XC4snhYG9igas+cjt1T1cmCsMEUry6zWUGJ/AKne4sy4Rp3d0SshIwxZnuHZhA qEkpO+Ge4OOhOeBW9kvl3LoZA4yLow830pA11CFkcz1nibv6wCgBYWTgEq+/vw/Jii yIrG54sGxX7X/hVUvjveW/6r5c8ye+GvqGGWKEQkeR9VMTSQMz5u+i9e7QmBrSBECp qn9334NEf+qJOBN2ogTGJObxmxnt5ObtHhg0qFYoM6CEjll8lqGOzn4dP1jcrDX1/G pFDukigOXdiEw== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH v2 5/5] doc: visl: Document codec_variability parameter Date: Tue, 24 Oct 2023 15:09:50 -0400 Message-ID: <20231024191027.305622-6-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231024191027.305622-1-detlev.casanova@collabora.com> References: <20231024191027.305622-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Reviewed-by: Daniel Almeida Signed-off-by: Detlev Casanova --- Documentation/admin-guide/media/visl.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/admin-guide/media/visl.rst b/Documentation/admin-guide/media/visl.rst index 5b26fd943571..56d2e9ab72cc 100644 --- a/Documentation/admin-guide/media/visl.rst +++ b/Documentation/admin-guide/media/visl.rst @@ -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? ---------------------------------------------