From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53991C77B7A for ; Tue, 30 May 2023 10:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D6+mS/Ur3zg6wdrhqB2Wvp1DcgSfvySmNpqDGstYYIo=; b=jZIQxk99dWwanOJayRSLDeonD2 Rr0bJGe9BuOBYpy1sDJNkfdTOMmD32wb6ta+L3twGxQXYPB2Crk8waX2S5BLExVSThycum8dtv1Cj PkjEbks1AJQ4Ih4++1aCJBtG2C7nS/WefQsyH8ekn+iy07Fm30Wj+C7pdefKGDZc7HpgJ4k5v54A+ yOJ0TSVzg515gzI6n/zTe86TAu7pkxfWxH0JWHiLmdQ8wYZT2OSM9yd7iG1kfzP/RO1KYfQPMd2IS Gk8JzOJqNb4lzIttX42oHnvkn5CspN4CKAu5xecerZyMuR21IGpAdAGrI/jRc6zHfA6/z1JrbJJMK Kl0/y/Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3wFE-00DIwd-2D; Tue, 30 May 2023 10:06:24 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3wEv-00DImS-0x; Tue, 30 May 2023 10:06:06 +0000 Received: from [IPV6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab] (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 4B2EB66059A8; Tue, 30 May 2023 11:06:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685441164; bh=h0G8aacKqdBgS5C1qg9jRMOSlWZ7H/k7T1lOosYm1Mc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=j8cGkxrJY6l2EEhgjzw1vbKYkXTrr+ION8Bu6BWlrU/yaGtexhg0Af7H2oZuoSzDj P/IwJvxngRCz9TDCE9OE/rVMxbEqudQIhmQx6BrdLDO6yLecvozQkuLjX84d+UXjZD 9tyUYFI7jooiBTv7y0yh44QSly4ehpCwV072VZJfgDxRNJxkoGRfAQOKYb+GNC3SMK bRkrTD4GEbKOEEVF/fN5brgAoZMnUkLf+jJzWfpEnl+XUAHHh0/tWpXvYdsaELF4WT lCSUDbGIwJc9XEJQpfbDot+qVr5eEuBR3xV1FPdefWoWbPQxKeYr4jBYiy4CQtNh1s U0Ok3OPj2Z5ZA== Message-ID: Date: Tue, 30 May 2023 12:06:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v5,8/8] media: mediatek: vcodec: Add dbgfs help function Content-Language: en-US To: Yunfei Dong , Chen-Yu Tsai , Nicolas Dufresne , Hans Verkuil , Benjamin Gaignard , =?UTF-8?Q?N=c3=adcolas_F_=2e_R_=2e_A_=2e_Prado?= , Nathan Hebert Cc: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20230525021219.23638-1-yunfei.dong@mediatek.com> <20230525021219.23638-9-yunfei.dong@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20230525021219.23638-9-yunfei.dong@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230530_030605_458502_87BDA3EC X-CRM114-Status: GOOD ( 19.98 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Il 25/05/23 04:12, Yunfei Dong ha scritto: > Getting dbgfs help information with command "echo -help > vdec". > > Signed-off-by: Yunfei Dong > --- > .../mediatek/vcodec/mtk_vcodec_dbgfs.c | 24 ++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c > index 237d0dc8a1fc..2372fc449b45 100644 > --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c > +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dbgfs.c > @@ -52,6 +52,23 @@ static void mtk_vdec_dbgfs_get_format_type(struct mtk_vcodec_ctx *ctx, char *buf > *used += curr_len; > } > > +static void mtk_vdec_dbgfs_get_help(char *buf, int *used, int total) > +{ > + int curr_len; > + > + curr_len = snprintf(buf + *used, total - *used, > + "help: (1: echo -'info' > vdec 2: cat vdec)\n"); > + *used += curr_len; > + > + curr_len = snprintf(buf + *used, total - *used, > + "\t-picinfo: get resolution\n"); > + *used += curr_len; > + > + curr_len = snprintf(buf + *used, total - *used, > + "\t-format: get output & capture queue format\n"); > + *used += curr_len; > +} > + > static ssize_t mtk_vdec_dbgfs_write(struct file *filp, const char __user *ubuf, > size_t count, loff_t *ppos) > { > @@ -84,6 +101,11 @@ static ssize_t mtk_vdec_dbgfs_read(struct file *filp, char __user *ubuf, > if (!buf) > return -ENOMEM; > > + if (strstr(dbgfs->dbgfs_buf, "-help")) { I would print the help strings in two conditions: 1. -help 2. (nothing) ...so that if you don't echo anything to vdec (no params), you get the help text. Otherwise, you would have to know that "-help" is a parameter that gives you help text in the first place. As for this commit "as is", it works as intended and it is useful to retrieve the help text; you can either send a followup commit that extends the help to the corner case that I've explained, or send a v6 adding that to this same commit. I would prefer to see a v6 -- BUT -- since this series was sent a long time ago, you will get my R-b and I will leave the final choice to Hans. Reviewed-by: AngeloGioacchino Del Regno