Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"abhiraj21put@gmail.com" <abhiraj21put@gmail.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"simona@ffwll.ch" <simona@ffwll.ch>
Cc: "dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/mediatek: Convert legacy DRM logging to drm_* helpers in mtk_dsi.c
Date: Mon, 18 May 2026 08:29:13 +0000	[thread overview]
Message-ID: <2571f04d3d8f056780f73ba20eacb6d5b600dc61.camel@mediatek.com> (raw)
In-Reply-To: <20260420052008.5417-1-abhiraj21put@gmail.com>

On Mon, 2026-04-20 at 10:50 +0530, Abhishek Rajput wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> Replace DRM_INFO(), DRM_WARN() and DRM_ERROR() calls in
> drivers/gpu/drm/mediatek/mtk_dsi.c with the corresponding
> drm_info(), drm_warn() and drm_err() helpers.
> 
> The drm_*() logging helpers take a struct drm_device * argument,
> allowing the DRM core to prefix log messages with the correct device
> name and instance. This is required to correctly distinguish log
> messages on systems with multiple GPUs.
> 
> This change aligns the radeon driver with the DRM TODO item:
> "Convert logging to drm_* functions with drm_device parameter".

Reviewed-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: Abhishek Rajput <abhiraj21put@gmail.com>
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_dsi.c b/drivers/gpu/drm/mediatek/mtk_dsi.c
> index 0e2bcd5f67b7..a67ad575f5f0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_dsi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_dsi.c
> @@ -510,6 +510,7 @@ static void mtk_dsi_config_vdo_timing_per_line_lp(struct mtk_dsi *dsi)
>         u32 delta;
>         struct mtk_phy_timing *timing = &dsi->phy_timing;
>         struct videomode *vm = &dsi->vm;
> +       struct drm_device *drm = dsi->bridge.dev;
> 
>         if (dsi->format == MIPI_DSI_FMT_RGB565)
>                 dsi_tmp_buf_bpp = 2;
> @@ -543,7 +544,7 @@ static void mtk_dsi_config_vdo_timing_per_line_lp(struct mtk_dsi *dsi)
>                                              horizontal_backporch_byte /
>                                              horizontal_front_back_byte;
>         } else {
> -               DRM_WARN("HFP + HBP less than d-phy, FPS will under 60Hz\n");
> +               drm_warn(drm, "HFP + HBP less than d-phy, FPS will under 60Hz\n");
>         }
> 
>         if ((dsi->mode_flags & MIPI_DSI_HS_PKT_END_ALIGNED) &&
> @@ -623,12 +624,13 @@ static s32 mtk_dsi_wait_for_irq_done(struct mtk_dsi *dsi, u32 irq_flag,
>  {
>         s32 ret = 0;
>         unsigned long jiffies = msecs_to_jiffies(timeout);
> +       struct drm_device *drm = dsi->bridge.dev;
> 
>         ret = wait_event_interruptible_timeout(dsi->irq_wait_queue,
>                                                dsi->irq_data & irq_flag,
>                                                jiffies);
>         if (ret == 0) {
> -               DRM_WARN("Wait DSI IRQ(0x%08x) Timeout\n", irq_flag);
> +               drm_warn(drm, "Wait DSI IRQ(0x%08x) Timeout\n", irq_flag);
> 
>                 mtk_dsi_enable(dsi);
>                 mtk_dsi_reset_engine(dsi);
> @@ -663,9 +665,10 @@ static s32 mtk_dsi_switch_to_cmd_mode(struct mtk_dsi *dsi, u8 irq_flag, u32 t)
>  {
>         mtk_dsi_irq_data_clear(dsi, irq_flag);
>         mtk_dsi_set_cmd_mode(dsi);
> +       struct drm_device *drm = dsi->bridge.dev;
> 
>         if (!mtk_dsi_wait_for_irq_done(dsi, irq_flag, t)) {
> -               DRM_ERROR("failed to switch cmd mode\n");
> +               drm_err(drm, "failed to switch cmd mode\n");
>                 return -ETIME;
>         } else {
>                 return 0;
> @@ -849,11 +852,12 @@ static void mtk_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
>                                              struct drm_atomic_state *state)
>  {
>         struct mtk_dsi *dsi = bridge_to_dsi(bridge);
> +       struct drm_device *drm = bridge->dev;
>         int ret;
> 
>         ret = mtk_dsi_poweron(dsi);
>         if (ret < 0)
> -               DRM_ERROR("failed to power on dsi\n");
> +               drm_err(drm, "failed to power on dsi\n");
>  }
> 
>  static void mtk_dsi_bridge_atomic_post_disable(struct drm_bridge *bridge,
> @@ -916,7 +920,7 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
>         ret = drm_simple_encoder_init(drm, &dsi->encoder,
>                                       DRM_MODE_ENCODER_DSI);
>         if (ret) {
> -               DRM_ERROR("Failed to encoder init to drm\n");
> +               drm_err(drm, "Failed to encoder init to drm\n");
>                 return ret;
>         }
> 
> @@ -932,7 +936,7 @@ static int mtk_dsi_encoder_init(struct drm_device *drm, struct mtk_dsi *dsi)
> 
>         dsi->connector = drm_bridge_connector_init(drm, &dsi->encoder);
>         if (IS_ERR(dsi->connector)) {
> -               DRM_ERROR("Unable to create bridge connector\n");
> +               drm_err(drm, "Unable to create bridge connector\n");
>                 ret = PTR_ERR(dsi->connector);
>                 goto err_cleanup_encoder;
>         }
> @@ -985,6 +989,7 @@ static int mtk_dsi_host_attach(struct mipi_dsi_host *host,
>  {
>         struct mtk_dsi *dsi = host_to_dsi(host);
>         struct device *dev = host->dev;
> +       struct drm_device *drm = dsi->bridge.dev;
>         int ret;
> 
>         dsi->lanes = device->lanes;
> @@ -1012,7 +1017,7 @@ static int mtk_dsi_host_attach(struct mipi_dsi_host *host,
> 
>         ret = component_add(host->dev, &mtk_dsi_component_ops);
>         if (ret) {
> -               DRM_ERROR("failed to add dsi_host component: %d\n", ret);
> +               drm_err(drm, "failed to add dsi_host component: %d\n", ret);
>                 drm_bridge_remove(&dsi->bridge);
>                 return ret;
>         }
> @@ -1034,11 +1039,12 @@ static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)
>  {
>         int ret;
>         u32 val;
> +       struct drm_device *drm = dsi->bridge.dev;
> 
>         ret = readl_poll_timeout(dsi->regs + DSI_INTSTA, val, !(val & DSI_BUSY),
>                                  4, 2000000);
>         if (ret) {
> -               DRM_WARN("polling dsi wait not busy timeout!\n");
> +               drm_warn(drm, "polling dsi wait not busy timeout!\n");
> 
>                 mtk_dsi_enable(dsi);
>                 mtk_dsi_reset_engine(dsi);
> @@ -1123,6 +1129,7 @@ static ssize_t mtk_dsi_host_transfer(struct mipi_dsi_host *host,
>                                      const struct mipi_dsi_msg *msg)
>  {
>         struct mtk_dsi *dsi = host_to_dsi(host);
> +       struct drm_device *drm = dsi->bridge.dev;
>         ssize_t recv_cnt;
>         u8 read_data[16];
>         void *src_addr;
> @@ -1153,7 +1160,7 @@ static ssize_t mtk_dsi_host_transfer(struct mipi_dsi_host *host,
>         }
> 
>         if (!msg->rx_buf) {
> -               DRM_ERROR("dsi receive buffer size may be NULL\n");
> +               drm_err(drm, "dsi receive buffer size may be NULL\n");
>                 ret = -EINVAL;
>                 goto restore_dsi_mode;
>         }
> @@ -1177,7 +1184,7 @@ static ssize_t mtk_dsi_host_transfer(struct mipi_dsi_host *host,
>         if (recv_cnt)
>                 memcpy(msg->rx_buf, src_addr, recv_cnt);
> 
> -       DRM_INFO("dsi get %zd byte data from the panel address(0x%x)\n",
> +       drm_info(drm, "dsi get %zd byte data from the panel address(0x%x)\n",
>                  recv_cnt, *((u8 *)(msg->tx_buf)));
> 
>  restore_dsi_mode:
> --
> 2.43.0
> 


  reply	other threads:[~2026-05-18  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  5:20 [PATCH] drm/mediatek: Convert legacy DRM logging to drm_* helpers in mtk_dsi.c Abhishek Rajput
2026-05-18  8:29 ` CK Hu (胡俊光) [this message]
2026-05-18 13:39 ` Chun-Kuang Hu

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=2571f04d3d8f056780f73ba20eacb6d5b600dc61.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=abhiraj21put@gmail.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=simona@ffwll.ch \
    /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