devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: "Yunfei Dong" <yunfei.dong@mediatek.com>,
	"Nícolas F . R . A . Prado" <nfraprado@collabora.com>,
	"Nicolas Dufresne" <nicolas.dufresne@collabora.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
	"Nathan Hebert" <nhebert@chromium.org>
Cc: Chen-Yu Tsai <wenst@chromium.org>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Fritz Koenig <frkoenig@chromium.org>,
	Daniel Vetter <daniel@ffwll.ch>,
	Steve Cho <stevecho@chromium.org>,
	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
Subject: Re: [PATCH v7,06/11] media: mediatek: vcodec: replace pr_* with dev_* for v4l2 debug message
Date: Tue, 25 Jul 2023 11:37:21 +0200	[thread overview]
Message-ID: <b2f44154-79a2-b5e4-4f59-bc578e19e31f@xs4all.nl> (raw)
In-Reply-To: <20230722074230.30558-7-yunfei.dong@mediatek.com>

On 22/07/2023 09:42, Yunfei Dong wrote:
> Adding different macro mtk_v4l2_vdec_dbg and mtk_v4l2_venc_dbg for
> encoder and decoder. Then calling the common macro mtk_v4l2_debug to
> print debug message.
> 
> Replace pr_err with dev_err for 'mtk_v4l2_err' debug message.
> Replace pr_debug with dev_dbg for 'mtk_v4l2_debug' debug message.
> 
> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
>  .../platform/mediatek/vcodec/mtk_vcodec_dec.c | 116 +++++-----
>  .../mediatek/vcodec/mtk_vcodec_dec_drv.c      |  54 +++--
>  .../mediatek/vcodec/mtk_vcodec_dec_hw.c       |   7 +-
>  .../mediatek/vcodec/mtk_vcodec_dec_pm.c       |  19 +-
>  .../mediatek/vcodec/mtk_vcodec_dec_stateful.c | 143 ++++++------
>  .../vcodec/mtk_vcodec_dec_stateless.c         |  62 ++---
>  .../platform/mediatek/vcodec/mtk_vcodec_enc.c | 211 ++++++++----------
>  .../mediatek/vcodec/mtk_vcodec_enc_drv.c      |  45 ++--
>  .../mediatek/vcodec/mtk_vcodec_enc_pm.c       |   8 +-
>  .../platform/mediatek/vcodec/mtk_vcodec_fw.c  |   2 +-
>  .../mediatek/vcodec/mtk_vcodec_fw_scp.c       |   2 +-
>  .../mediatek/vcodec/mtk_vcodec_fw_vpu.c       |   7 +-
>  .../mediatek/vcodec/mtk_vcodec_intr.c         |  12 +-
>  .../mediatek/vcodec/mtk_vcodec_util.c         |  30 ++-
>  .../mediatek/vcodec/mtk_vcodec_util.h         |  27 ++-
>  .../vcodec/vdec/vdec_av1_req_lat_if.c         |  10 +-
>  .../mediatek/vcodec/vdec/vdec_h264_req_if.c   |  14 +-
>  .../vcodec/vdec/vdec_h264_req_multi_if.c      |  16 +-
>  .../vcodec/vdec/vdec_hevc_req_multi_if.c      |  14 +-
>  .../platform/mediatek/vcodec/vdec_drv_if.c    |   4 +-
>  .../platform/mediatek/vcodec/vdec_msg_queue.c |  52 +++--
>  .../platform/mediatek/vcodec/vdec_msg_queue.h |   2 +
>  .../platform/mediatek/vcodec/vdec_vpu_if.c    |   2 +-
>  23 files changed, 417 insertions(+), 442 deletions(-)
> 

<snip>

> diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> index fd951ff47fc3..6bc822c7d825 100644
> --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_util.h
> @@ -11,6 +11,9 @@
>  #include <linux/types.h>
>  #include <linux/dma-direction.h>
>  
> +#define MTK_DBG_VCODEC_STR "[MTK_VCODEC]"
> +#define MTK_DBG_V4L2_STR "[MTK_V4L2]"
> +
>  struct mtk_vcodec_mem {
>  	size_t size;
>  	void *va;
> @@ -28,8 +31,8 @@ struct mtk_vcodec_dev;
>  #undef pr_fmt
>  #define pr_fmt(fmt) "%s(),%d: " fmt, __func__, __LINE__
>  
> -#define mtk_v4l2_err(fmt, args...)                \
> -	pr_err("[MTK_V4L2][ERROR] " fmt "\n", ##args)
> +#define mtk_v4l2_err(plat_dev, fmt, args...)                            \
> +	dev_err(&(plat_dev)->dev, "[MTK_V4L2][ERROR] " fmt "\n", ##args)
>  
>  #define mtk_vcodec_err(inst_id, plat_dev, fmt, args...)                                 \
>  	dev_err(&(plat_dev)->dev, "[MTK_VCODEC][ERROR][%d]: " fmt "\n", inst_id, ##args)
> @@ -38,11 +41,11 @@ struct mtk_vcodec_dev;
>  extern int mtk_v4l2_dbg_level;
>  extern int mtk_vcodec_dbg;
>  
> -#define mtk_v4l2_debug(level, fmt, args...)				\
> -	do {								\
> -		if (mtk_v4l2_dbg_level >= (level))			\
> -			pr_debug("[MTK_V4L2] %s, %d: " fmt "\n",        \
> -				 __func__, __LINE__, ##args);	        \
> +#define mtk_v4l2_debug(plat_dev, level, fmt, args...)                             \
> +	do {                                                                      \
> +		if (mtk_v4l2_dbg_level >= (level))                                \
> +			dev_dbg(&(plat_dev)->dev, "[MTK_V4L2] %s, %d: " fmt "\n", \
> +				 __func__, __LINE__, ##args);                     \
>  	} while (0)

You forgot to add 'plat_dev' to the argument list of the mtk_v4l2_debug
macro when CONFIG_DEBUG_FS is not set. That causes zillions of compiler
warnings.

>  
>  #define mtk_vcodec_debug(inst_id, plat_dev, fmt, args...)                               \
> @@ -70,6 +73,16 @@ extern int mtk_vcodec_dbg;
>  #define mtk_venc_debug(ctx, fmt, args...)                              \
>  	mtk_vcodec_debug((ctx)->id, (ctx)->dev->plat_dev, fmt, ##args)
>  
> +#define mtk_v4l2_vdec_err(ctx, fmt, args...) mtk_v4l2_err((ctx)->dev->plat_dev, fmt, ##args)
> +
> +#define mtk_v4l2_vdec_dbg(level, ctx, fmt, args...)             \
> +	mtk_v4l2_debug((ctx)->dev->plat_dev, level, fmt, ##args)
> +
> +#define mtk_v4l2_venc_err(ctx, fmt, args...) mtk_v4l2_err((ctx)->dev->plat_dev, fmt, ##args)
> +
> +#define mtk_v4l2_venc_dbg(level, ctx, fmt, args...)             \
> +	mtk_v4l2_debug((ctx)->dev->plat_dev, level, fmt, ##args)
> +
>  void __iomem *mtk_vcodec_get_reg_addr(void __iomem **reg_base, unsigned int reg_idx);
>  int mtk_vcodec_write_vdecsys(struct mtk_vcodec_ctx *ctx, unsigned int reg, unsigned int val);
>  int mtk_vcodec_mem_alloc(void *priv, struct mtk_vcodec_mem *mem);

Regards,

	Hans


  reply	other threads:[~2023-07-25  9:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-22  7:42 [PATCH v7,0/11] media: mediatek: vcodec: separate encoder and decoder Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,01/11] media: mediatek: vcodec: remove unused parameter Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,02/11] media: mediatek: vcodec: align fw interface Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,03/11] media: mediatek: vcodec: Removing struct 'mtk_vcodec_ctx/dev' for shared interface Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,04/11] media: mediatek: vcodec: Removing useless debug log Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,05/11] media: mediatek: vcodec: remove the dependency of vcodec " Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,06/11] media: mediatek: vcodec: replace pr_* with dev_* for v4l2 debug message Yunfei Dong
2023-07-25  9:37   ` Hans Verkuil [this message]
2023-07-22  7:42 ` [PATCH v7,07/11] media: mediatek: vcodec: separate struct 'mtk_vcodec_ctx' Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,08/11] media: mediatek: vcodec: separate struct mtk_vcodec_dev Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,09/11] media: mediatek: vcodec: fix unreasonable parameter definition and style Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,10/11] media: mediatek: vcodec: remove unused include header Yunfei Dong
2023-07-22  7:42 ` [PATCH v7,11/11] media: mediatek: vcodec: separate decoder and encoder Yunfei Dong
2023-07-25  9:58 ` [PATCH v7,0/11] media: mediatek: vcodec: separate encoder and decoder Hans Verkuil
2023-07-28  9:25   ` Hans Verkuil
2023-07-29  2:54     ` Yunfei Dong (董云飞)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2f44154-79a2-b5e4-4f59-bc578e19e31f@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=benjamin.gaignard@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=frkoenig@chromium.org \
    --cc=hsinyi@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=nfraprado@collabora.com \
    --cc=nhebert@chromium.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=stevecho@chromium.org \
    --cc=wenst@chromium.org \
    --cc=yunfei.dong@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).