Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1416102pxb; Thu, 21 Oct 2021 23:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6mKMJtjBKgboAjXOnKKDU03+iSipt4jscM8cQOe1tqbMPLHWtP0QwFtD5ntEPbhECd3a5 X-Received: by 2002:a17:907:1c97:: with SMTP id nb23mr13128543ejc.488.1634885896111; Thu, 21 Oct 2021 23:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634885896; cv=none; d=google.com; s=arc-20160816; b=ouM0ZV7UXMb/lbYGF7UhX7mF+ufDCn50zr/B5fDNDUN/xgwU0xuaMJLuLvcPksVqFC Adxo97MbHSrxtS5WiGgnf2m0MH36BotG+gQaDjEKxC7mdB9BavPlhGMRg0jii4HcvWbB nfo66HNMWOCwTGmm+wmvww2HyeVsJjz2+Vx6S+swTDNTOKOQUflbT+sWgQNfNk5XK50e yp2qsR5GRAk/whdww9g9VCQrsUjnp7qFqFQsU9DlpwjgVmTDF3zfmL1/CCwvKQvwEKVs jm3yGxrlhtKVtpT8Mh2PyHGMuWmuLeFuKLfZ2DoUkKPGs9/2wuYSTmS4TZ23HxCMNr62 YRMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=ERQHyBDNuFkUZ47sagEqPlnXve3pn4vHUrfH5yToeJc=; b=DyHLJd/Z+iOUxkO7p8gs64wa2NDD9Oeu+CmxA2cMSaLzI9owt1moG6MjMdtRh+gZkP 7n+/Xhc/ib9rtovY3hyBXTYKCYW+WZfWUB5T+n6nh1v9JncyugvhDeqxUt/Mq8dO5JRQ SBcJ1F0nopflf8MnR6vve3OqEbRB8kR9UJfAIhyafrA5jK7jbMW4p1CtZcqXKIubsZuO a2uRwn3vZT6vBWBHomaPzF6w8rOdlonL/SbwrJWAC0XWH4mX9JY1oLT6VmMo4VAWOdcD +jKMOCD93r1sEQieWTWIXa5nW/9N2NmCnSfLtESBWXBZXXP+xAf08WKkPzuoxMF8VcPb QUCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ji7si4282109ejc.581.2021.10.21.23.57.50; Thu, 21 Oct 2021 23:58:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232139AbhJVG6G (ORCPT + 99 others); Fri, 22 Oct 2021 02:58:06 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:19567 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231941AbhJVG6B (ORCPT ); Fri, 22 Oct 2021 02:58:01 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 19M6XG8p087038; Fri, 22 Oct 2021 14:33:16 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from JammyHuang-PC.aspeed.com (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 22 Oct 2021 14:55:23 +0800 From: Jammy Huang To: , , , , , , , , Subject: [PATCH v3 7/7] media: aspeed: Extend debug message Date: Fri, 22 Oct 2021 14:55:39 +0800 Message-ID: <20211022065539.12392-8-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022065539.12392-1-jammy_huang@aspeedtech.com> References: <20211022065539.12392-1-jammy_huang@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 19M6XG8p087038 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org updated as below: Capture: Mode : Direct fetch VGA bpp mode : 32 Signal : lock Width : 1920 Height : 1080 FRC : 0 Compression: Format : JPEG Subsampling : 444 Quality : 4 HQ Mode : N/A HQ Quality : 0 Mode : N/A Performance: Frame# : 4 Frame Duration(ms) : Now : 22 Min : 21 Max : 22 FPS : 47 Signed-off-by: Jammy Huang --- drivers/media/platform/aspeed-video.c | 41 +++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 8e0c29551ffc..7b7a03d44af7 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -453,6 +453,9 @@ static const struct v4l2_dv_timings_cap aspeed_video_timings_cap = { }, }; +static const char * const compress_mode_str[] = {"DCT Only", + "DCT VQ mix 2-color", "DCT VQ mix 4-color"}; + static unsigned int debug; static void aspeed_video_init_jpeg_table(u32 *table, bool yuv420) @@ -1071,8 +1074,6 @@ static void aspeed_video_set_resolution(struct aspeed_video *video) static void aspeed_video_update_regs(struct aspeed_video *video) { - static const char * const compress_mode_str[] = {"DCT Only", - "DCT VQ mix 2-color", "DCT VQ mix 4-color"}; u32 comp_ctrl = FIELD_PREP(VE_COMP_CTRL_DCT_LUM, video->jpeg_quality) | FIELD_PREP(VE_COMP_CTRL_DCT_CHR, video->jpeg_quality | 0x10) | FIELD_PREP(VE_COMP_CTRL_EN_HQ, video->hq_mode) | @@ -1785,9 +1786,29 @@ static const struct vb2_ops aspeed_video_vb2_ops = { static int aspeed_video_debugfs_show(struct seq_file *s, void *data) { struct aspeed_video *v = s->private; + u32 val08; seq_puts(s, "\n"); + val08 = aspeed_video_read(v, VE_CTRL); + seq_puts(s, "Capture:\n"); + if (FIELD_GET(VE_CTRL_DIRECT_FETCH, val08)) { + seq_printf(s, " %-20s:\tDirect fetch\n", "Mode"); + seq_printf(s, " %-20s:\t%s\n", "VGA bpp mode", + FIELD_GET(VE_CTRL_INT_DE, val08) ? "16" : "32"); + } else { + seq_printf(s, " %-20s:\tSync\n", "Mode"); + seq_printf(s, " %-20s:\t%s\n", "Video source", + FIELD_GET(VE_CTRL_SOURCE, val08) ? + "external" : "internal"); + seq_printf(s, " %-20s:\t%s\n", "DE source", + FIELD_GET(VE_CTRL_INT_DE, val08) ? + "internal" : "external"); + seq_printf(s, " %-20s:\t%s\n", "Cursor overlay", + FIELD_GET(VE_CTRL_AUTO_OR_CURSOR, val08) ? + "Without" : "With"); + } + seq_printf(s, " %-20s:\t%s\n", "Signal", v->v4l2_input_status ? "Unlock" : "Lock"); seq_printf(s, " %-20s:\t%d\n", "Width", v->pix_fmt.width); @@ -1796,6 +1817,21 @@ static int aspeed_video_debugfs_show(struct seq_file *s, void *data) seq_puts(s, "\n"); + seq_puts(s, "Compression:\n"); + seq_printf(s, " %-20s:\t%s\n", "Format", + v->partial_jpeg ? "Aspeed" : "JPEG"); + seq_printf(s, " %-20s:\t%s\n", "Subsampling", + v->yuv420 ? "420" : "444"); + seq_printf(s, " %-20s:\t%d\n", "Quality", v->jpeg_quality); + seq_printf(s, " %-20s:\t%s\n", "HQ Mode", + v->partial_jpeg ? (v->hq_mode ? "on" : "off") : "N/A"); + seq_printf(s, " %-20s:\t%d\n", "HQ Quality", v->jpeg_hq_quality); + seq_printf(s, " %-20s:\t%s\n", "Mode", + v->partial_jpeg ? compress_mode_str[v->compression_mode] + : "N/A"); + + seq_puts(s, "\n"); + seq_puts(s, "Performance:\n"); seq_printf(s, " %-20s:\t%d\n", "Frame#", v->sequence); seq_printf(s, " %-20s:\n", "Frame Duration(ms)"); @@ -1804,7 +1840,6 @@ static int aspeed_video_debugfs_show(struct seq_file *s, void *data) seq_printf(s, " %-18s:\t%d\n", "Max", v->perf.duration_max); seq_printf(s, " %-20s:\t%d\n", "FPS", 1000/(v->perf.totaltime/v->sequence)); - return 0; } -- 2.25.1