Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp242428pxb; Fri, 15 Oct 2021 04:46:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3R+EpK8bNwW+2s7Ht5K+3H7xO8jQ65EOqD3LSlbIfyeJfSxalXzmtZmrsD5yZ8TomtDYQ X-Received: by 2002:a63:86c2:: with SMTP id x185mr8877475pgd.460.1634298409466; Fri, 15 Oct 2021 04:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634298409; cv=none; d=google.com; s=arc-20160816; b=VYDy78IITj8CzzzrHp11Dj6omLRKpcA8h6SEtbiI++3z9OhETyqNaDiFStP0q0bJpZ 9K8rrT/oC9ExcDFAF8A7KeUM8SonRw75XnHNRQKf6JND2+/VFF2atN5UncFB0Gk/LwHx nWVb+7pSD/6SysAuai1ocXvZ9Atbsgr/kQg83tjiw6hETytgWfdSRRPfV9D0dqNpt/jY KU9ini4ka4IFdcYPTmrIDy0BxIQbErm/sK/mVO975gMnsXi8KHLwTzDGKfjpm69AyVR1 DGKm1ny3tWYasQjbl9WowZVUQJm7E6A4PN+DWwzVzhLEGCtq3H05p6mxJk0/Hflt/mii gP2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=bSXrbHbt7/dIA6sc/pNrnA8A6ErtZdaYY2cWBXiSh7Q=; b=SRlkhL8EXy/CgDkWdwcVuP5sBtR15v/ERIGxJeJ+f283ZNmw/faLvIAeIonJfmrHou 362rVsHSdrCmijYLBphSaToMANilYrM0h7dnrdmM9WLl8rWAvnLycyrX1E0N1XAh0U1G 1PpIBJxP68Us6nOn888l632MnyBGTCzlE4mDTi8gIN/L/Tu+hG51B1JTzVwepgq4qj6l +E7/D8afVMRIF0WD45Dgr+ntJDJ7ojbs/x5ldz91TmX6lkIlakFEEIfkaVrMqp2D2Xus 7o4za8APVCAat6G7lWdgvpcYYeBH8eV9d0LWIPq/C3JqnEHmuunba5zQi4LG95OuHlsv VTCg== 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 u187si7107663pfc.174.2021.10.15.04.46.26; Fri, 15 Oct 2021 04:46:49 -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 S234172AbhJODcD (ORCPT + 99 others); Thu, 14 Oct 2021 23:32:03 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:8193 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234153AbhJODcC (ORCPT ); Thu, 14 Oct 2021 23:32:02 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 19F38CnT038176; Fri, 15 Oct 2021 11:08:12 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from [192.168.2.115] (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 15 Oct 2021 11:29:54 +0800 Message-ID: Date: Fri, 15 Oct 2021 11:29:55 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 6/6] media: aspeed: richer debugfs Content-Language: en-US To: Paul Menzel CC: "linux-aspeed@lists.ozlabs.org" , "andrew@aj.id.au" , "openbmc@lists.ozlabs.org" , "eajames@linux.ibm.com" , "linux-kernel@vger.kernel.org" , "mchehab@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" References: <20211014034819.2283-1-jammy_huang@aspeedtech.com> <20211014034819.2283-7-jammy_huang@aspeedtech.com> <53fa3d1a-d75b-2fb1-a315-c6406f33289c@molgen.mpg.de> From: Jammy Huang In-Reply-To: <53fa3d1a-d75b-2fb1-a315-c6406f33289c@molgen.mpg.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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 19F38CnT038176 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Paul, Thanks for you help. I will have an updated patch later accordingly. On 2021/10/14 下午 02:57, Paul Menzel wrote: > Dear Jammy, > > > Am 14.10.21 um 08:54 schrieb Paul Menzel: > >> Am 14.10.21 um 05:48 schrieb Jammy Huang: >> media: aspeed: richer debugfs > It’d be great if you used a statement by adding a verb in imperative > mood [1]. Maybe: > >> Extend debug message > or > >> Add more debug log messages >>> updated as below: >>> >>> Caputre: >> Capture >> >>>    Mode                : Direct fetch >>>    VGA bpp mode        : 32 >>>    Signal              : Unlock >>>    Width               : 1920 >>>    Height              : 1080 >>>    FRC                 : 30 >>> >>> Compression: >>>    Format              : JPEG >>>    Subsampling         : 444 >>>    Quality             : 0 >>>    HQ Mode             : N/A >>>    HQ Quality          : 0 >>>    Mode                : N/A >>> >>> Performance: >>>    Frame#              : 0 >>>    Frame Duration(ms)  : >>>      Now               : 0 >>>      Min               : 0 >>>      Max               : 0 >>>    FPS                 : 0 >> Do you have output with non-zero values? ;-) >> >> On what device did you test this? >> >>> 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 e1031fd09ac6..f2e5c49ee906 100644 >>> --- a/drivers/media/platform/aspeed-video.c >>> +++ b/drivers/media/platform/aspeed-video.c >>> @@ -464,6 +464,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) >>> @@ -1077,8 +1080,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) | >>> @@ -1795,9 +1796,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; >> Why does `08` refer to? >> >>>       seq_puts(s, "\n"); >>> +    val08 = aspeed_video_read(v, VE_CTRL); >>> +    seq_puts(s, "Caputre:\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); >>> @@ -1806,6 +1827,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)"); >> Remove the colon, and add a space before (? >> >>> @@ -1814,7 +1850,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; >>>   } > > Kind regards, > > Paul > > > [1]: https://chris.beams.io/posts/git-commit/