Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4290370rwd; Tue, 30 May 2023 03:21:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6S5Q8O+Cz8U02ez1G2Qy5BD3RA2sI9cErdOxWOlYul0X5ivzSnbdRQcPD5LlvGGhimUqli X-Received: by 2002:a17:90a:38a4:b0:250:c4c1:882 with SMTP id x33-20020a17090a38a400b00250c4c10882mr1963858pjb.30.1685442086227; Tue, 30 May 2023 03:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685442086; cv=none; d=google.com; s=arc-20160816; b=XEOb7VD///Mf1JR6XHuin0me63DCvdYVu0Y8N2A3YU2dBbGDCuAZX+FHO8EbBB4Z22 VCVyH6y4ji54VaRLCWqIsWedZoaPgL5eBE6vhETuGCKlc92S3gZ8AU/scbtqO3TJmFEA sQjyKjxgrRrjsqH/x8lrFu1c+cBYH2u7QeXlX8r2P81DUV24XLw7aaB/hs3XE/Zq7JYA OMWl95e0l6od5GiHL/Wr4PThP1FHD8et9iT56bAKU5vyiUzSZHrpRuFEZd4cpkqwFYGR 1ZRps2BFym6IBloqpwMBxRchir6rMLEgJscj5YhkN+NbgNfvAixFN/Hw9uHN6HHt77De 4/Aw== 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:dkim-signature; bh=D6+mS/Ur3zg6wdrhqB2Wvp1DcgSfvySmNpqDGstYYIo=; b=baPPBPLEjUQ/0BtB5iqgt4btefR10D4pWDtgpAaMIKGpT0vOrOJn3j5EBufwo6gzGC jPN6S+Vu3+iRPR1Z4IKmUHPz9o6MeAj+98eaI/2Euur+ydJ8BfDkn+XDkRp7OjPaGw6z Wk7mQh5m5haLolcJxedYXIOdupRg+thAdJw3sERWw4NZ63f5BVDIpOpwPL0qDwjv2dWW /rb9RKmowQwbQhV61QZdI2SPcXIy37l6KV875OdIARk0tAYt8ZiRS1i5nrDrS2rOCTGj Fug5UQbM4lZ4XK0/TPTNo7MLEWa7/IH9N23BWcsLnTt7uyXzXcp4HNxNZxVVpCKoBZcR 2nmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=j8cGkxrJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 23-20020a17090a199700b00247526ba960si684539pji.119.2023.05.30.03.21.12; Tue, 30 May 2023 03:21:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=j8cGkxrJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231388AbjE3KGM (ORCPT + 99 others); Tue, 30 May 2023 06:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231368AbjE3KGG (ORCPT ); Tue, 30 May 2023 06:06:06 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46F5D93; Tue, 30 May 2023 03:06:05 -0700 (PDT) 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-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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