From patchwork Mon Oct 23 18:58:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13433400 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 C5808C25B48 for ; Mon, 23 Oct 2023 18:59:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229462AbjJWS77 (ORCPT ); Mon, 23 Oct 2023 14:59:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjJWS7z (ORCPT ); Mon, 23 Oct 2023 14:59:55 -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 1E59B110; Mon, 23 Oct 2023 11:59:54 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (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 F289366071EF; Mon, 23 Oct 2023 19:59:51 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698087592; bh=1kYYBVVZKlPmwQg0v2fZqPSvNTFy7yF+ri1uhcr4paQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cWgRGnDwnr9wDW8Ok2OdHR5TTS6eRV580VatM6gq1t88ShZCxLOHfs5fWSUaAYJCh 8cdW6wfW8JuXxtNKQFJlmx0X0zPrRZhv2yAukJDZLdyEx2eJBwRj3rZjX2DeLwwPuv fipVzVCvER+XX3g0W1V7WdT5NegPO1Tv2m6D6+Qhe2rAQt7ZIipOc2xe877WkqK9oW ZGQyoVopLsR2zfpEw9XI8BuEjtVwLC7TMiUGTRKb0D0z/pIThSo5a1ydKhZs0XwQ90 qCFFNf19BKPuK33r+VvE41tq703k77vo9gIzNPQhU3MW+EvxfLhX0K+NiY6aVDne25 lKgm0TfBI3VaA== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH 1/5] media: visl: Fix params permissions/defaults mismatch Date: Mon, 23 Oct 2023 14:58:21 -0400 Message-ID: <20231023185850.67082-2-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023185850.67082-1-detlev.casanova@collabora.com> References: <20231023185850.67082-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. 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 Mon Oct 23 18:58:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13433399 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 93A90C25B46 for ; Mon, 23 Oct 2023 18:59:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231335AbjJWS76 (ORCPT ); Mon, 23 Oct 2023 14:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231256AbjJWS74 (ORCPT ); Mon, 23 Oct 2023 14:59:56 -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 8C377127; Mon, 23 Oct 2023 11:59:54 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (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 C696F66072A4; Mon, 23 Oct 2023 19:59:52 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698087593; bh=jTgPL1OeM0X1z2x+WFLvhIV0IslYwfdDVj96jANQcHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FExZWjm+PQnQOvaxlLjWmjitAFG+B5Smv/xZND9mg3AoOhzteL8am7pQ5NBWQz6B+ fz8Ltc0L4aoao+EnYDa4nFnCioeGHwq7jWA9X7smMsN0TwSM1K9j2gz5f103RbLqbV ItbQARNMxigXGMrVt7ZiXlMtBbcSMiIgtD6u7bp6jYMF942Twc9RYrl72LOEajLA1R 7O6MFljfXSJBYxWp+e08JUfckbCXUxk9/WGa9KpTNT1aAHoO1coZKIQ/h9XHdsWVeF +7FLDjFVRyC+Titg8tbPuelB2r4tOASRShAAIyIya9ydAOyYCelZd1SoDiQ4R4F7q3 PIsX8BOwdCBSQ== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH 2/5] media: visl: Add a stable_output parameter Date: Mon, 23 Oct 2023 14:58:22 -0400 Message-ID: <20231023185850.67082-3-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023185850.67082-1-detlev.casanova@collabora.com> References: <20231023185850.67082-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. 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 Mon Oct 23 18:58:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13433401 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 AFEEFC25B49 for ; Mon, 23 Oct 2023 19:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231480AbjJWTAA (ORCPT ); Mon, 23 Oct 2023 15:00:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjJWS75 (ORCPT ); Mon, 23 Oct 2023 14:59:57 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C576D68; Mon, 23 Oct 2023 11:59:55 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (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 A1CED66072AE; Mon, 23 Oct 2023 19:59:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698087594; bh=mp7PyZ9vAaUjeaw4jeF18DYXuzZrzrZrcZ2nFtR0WBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OzUlubulWrTJ6ypilllWJ7PmMBaqM34nB/uJHxJSicO162mhOgKZvMhNAGuUXn0ka ll701p2w1nL9LcthUT8LXDEwJFgd78KRH4jmayCLDPhzHlykA+yUoW3WDt3cyuFyYT eMVENCiWEitdGdD1ezy9GkoJ7aIAvF/I8YKqc3r1fxM66zOvg6U5A+/s13KKA400hZ +WNP/zUimJT4Llm8VxbQWFlsX5RVjAhLBjKklTPkkUDYAxvkuHJrFVDhu5v/5T7SQq 0Vry0568AL+bWRJcItyA40nppHTR0kRmzmHBMABV6cnj6sCsTg0xEgKP8/l/vpICag gQMGH2t9ofsfg== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH 3/5] doc: visl: Document stable_output parameter Date: Mon, 23 Oct 2023 14:58:23 -0400 Message-ID: <20231023185850.67082-4-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023185850.67082-1-detlev.casanova@collabora.com> References: <20231023185850.67082-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Mon Oct 23 18:58:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13433402 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 96AB0C25B45 for ; Mon, 23 Oct 2023 19:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231695AbjJWTAC (ORCPT ); Mon, 23 Oct 2023 15:00:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbjJWS76 (ORCPT ); Mon, 23 Oct 2023 14:59:58 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44342101; Mon, 23 Oct 2023 11:59:56 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (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 8825D66072BA; Mon, 23 Oct 2023 19:59:54 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698087595; bh=7U8/6XDOJhzMMzMPF2ztUQzBn+CYjBeQFdZWPFsfHD0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRfMMsYGTLyaRA/BJd9plMIZjQcgCwhf6GxxL8q4g9iGtiy9oR3IqCavGwhJ+UxDg K5GT8pNgFW2freF76CwEuyV5tumfxbrryvfzB+B1tS9yNKZD8KCIh/W3m8gX+klxAL JRD+DtQCsfVzqiDB6ma0z8mRpn6QX/okglHAE+C30VDHvkKlI27DSjMI9Jo9XFUt7D nSN7GyjcKJhUQIdaYXrZhUHUN/TXY4ZXkiyugJvI6q43bNt2qB9hpLZp1e2g3PZW88 hnrTr6L2U+SOYWlE1IpDwMZlA3JitH5Fd6pygWZz+4cex1EjTo5IVFsFpLM6F9wUr5 yAfYoZBppAe2w== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH 4/5] visl: Add a codec specific variability parameter Date: Mon, 23 Oct 2023 14:58:24 -0400 Message-ID: <20231023185850.67082-5-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023185850.67082-1-detlev.casanova@collabora.com> References: <20231023185850.67082-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. 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..c00a134a2171 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.265 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 Mon Oct 23 18:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 13433403 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 CD8FAC25B46 for ; Mon, 23 Oct 2023 19:00:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbjJWTAD (ORCPT ); Mon, 23 Oct 2023 15:00:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbjJWS77 (ORCPT ); Mon, 23 Oct 2023 14:59:59 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E566127; Mon, 23 Oct 2023 11:59:57 -0700 (PDT) Received: from arisu.mtl.collabora.ca (mtl.collabora.ca [66.171.169.34]) (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 633EA6606F65; Mon, 23 Oct 2023 19:59:55 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698087596; bh=o/FJjn4TuWXT7bS3XgNkUnwd6rBIim2FWrvD+41vxVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U1JUMANzmSqA47TMmJoq35jq0eTArY3BoQtThoElSUcnmlwW3VPXsjAh7n3p8ITE9 wM6eBUSvFvXpzwZjq1rD42FgD0FehFGycbLj1IN7EWip7J5DMX+U69vadO6nZHdbnV d0a55LNW1EGOiJ1yG6ifc7yR241rQ+rBoUF/6x3xl+qC//M78RDb70bfhdtTIOnf9x 1ktqfDlYbPOEI8GjuRXUC9zlAdAw6fYhwkF/aFuHlK58fS7D2Zp9tUm9nl+pNtbzwj Cc51ytmyU5btLfjTVdobJhrkm1RzXztWsL4n+/dn50UGSU+O8zMcr+/KaTVQLxqhLh 452uVqmQHdm9g== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: linux-media@vger.kernel.org, Daniel Almeida , Mauro Carvalho Chehab , Detlev Casanova Subject: [PATCH 5/5] doc: visl: Document codec_variability parameter Date: Mon, 23 Oct 2023 14:58:25 -0400 Message-ID: <20231023185850.67082-6-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231023185850.67082-1-detlev.casanova@collabora.com> References: <20231023185850.67082-1-detlev.casanova@collabora.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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? ---------------------------------------------