mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "CK Hu (胡俊光)" <ck.hu@mediatek.com>
To: "jassisinghbrar@gmail.com" <jassisinghbrar@gmail.com>,
	"Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"simona@ffwll.ch" <simona@ffwll.ch>,
	"Sirius Wang (王皓昱)" <Sirius.Wang@mediatek.com>,
	"Zhenxing Qin (秦振兴)" <Zhenxing.Qin@mediatek.com>,
	"Xiandong Wang (王先冬)" <Xiandong.Wang@mediatek.com>,
	"Yongqiang Niu (牛永强)" <yongqiang.niu@mediatek.com>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"Paul-pl Chen (陳柏霖)" <Paul-pl.Chen@mediatek.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"fshao@chromium.org" <fshao@chromium.org>,
	"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"wenst@chromium.org" <wenst@chromium.org>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"Jarried Lin (林裕哲)" <Jarried.Lin@mediatek.com>,
	"Xavier Chang (張獻文)" <Xavier.Chang@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2 2/3] drm/mediatek: Add pm_runtime support for GCE power control
Date: Fri, 5 Sep 2025 05:28:42 +0000	[thread overview]
Message-ID: <1479834ed116744a089e08ff6ce217f06a02ed62.camel@mediatek.com> (raw)
In-Reply-To: <20250829091727.3745415-3-jason-jh.lin@mediatek.com>

On Fri, 2025-08-29 at 17:15 +0800, Jason-JH Lin wrote:
> Call pm_runtime_resume_and_get() before accessing GCE hardware in
> mbox_send_message(), and invoke pm_runtime_put_autosuspend() in the
> cmdq callback to release the PM reference and start autosuspend for
> GCE. This ensures correct power management for the GCE device.

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

> 
> Fixes: 8afe816b0c99 ("mailbox: mtk-cmdq-mailbox: Implement Runtime PM with autosuspend")
> Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_crtc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_crtc.c b/drivers/gpu/drm/mediatek/mtk_crtc.c
> index bc7527542fdc..c4c6d0249df5 100644
> --- a/drivers/gpu/drm/mediatek/mtk_crtc.c
> +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
> @@ -283,6 +283,10 @@ static void ddp_cmdq_cb(struct mbox_client *cl, void *mssg)
>  	unsigned int i;
>  	unsigned long flags;
>  
> +	/* release GCE HW usage and start autosuspend */
> +	pm_runtime_mark_last_busy(cmdq_cl->chan->mbox->dev);
> +	pm_runtime_put_autosuspend(cmdq_cl->chan->mbox->dev);
> +
>  	if (data->sta < 0)
>  		return;
>  
> @@ -618,6 +622,9 @@ static void mtk_crtc_update_config(struct mtk_crtc *mtk_crtc, bool needs_vblank)
>  		mtk_crtc->config_updating = false;
>  		spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
>  
> +		if (pm_runtime_resume_and_get(mtk_crtc->cmdq_client.chan->mbox->dev) < 0)
> +			goto update_config_out;
> +
>  		mbox_send_message(mtk_crtc->cmdq_client.chan, cmdq_handle);
>  		mbox_client_txdone(mtk_crtc->cmdq_client.chan, 0);
>  		goto update_config_out;


  reply	other threads:[~2025-09-05  5:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29  9:15 [PATCH v2 0/3] Fix sleeping function called from invalid context Jason-JH Lin
2025-08-29  9:15 ` [PATCH v2 1/3] mailbox: mtk-cmdq: Remove pm_runtime APIs from cmdq_mbox_send_data() Jason-JH Lin
2025-08-29  9:15 ` [PATCH v2 2/3] drm/mediatek: Add pm_runtime support for GCE power control Jason-JH Lin
2025-09-05  5:28   ` CK Hu (胡俊光) [this message]
2025-11-01 14:37   ` Chun-Kuang Hu
2025-08-29  9:16 ` [PATCH v2 3/3] media: platform: mtk-mdp3: " Jason-JH Lin
2025-09-05  9:15 ` [PATCH v2 0/3] Fix sleeping function called from invalid context AngeloGioacchino Del Regno

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=1479834ed116744a089e08ff6ce217f06a02ed62.camel@mediatek.com \
    --to=ck.hu@mediatek.com \
    --cc=Jarried.Lin@mediatek.com \
    --cc=Jason-JH.Lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Paul-pl.Chen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=Sirius.Wang@mediatek.com \
    --cc=Xavier.Chang@mediatek.com \
    --cc=Xiandong.Wang@mediatek.com \
    --cc=Zhenxing.Qin@mediatek.com \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fshao@chromium.org \
    --cc=jassisinghbrar@gmail.com \
    --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=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=simona@ffwll.ch \
    --cc=wenst@chromium.org \
    --cc=yongqiang.niu@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

all inboxes | Powered by JetHome®