mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "CK Hu (胡俊光)" <ck.hu@mediatek.com>,
	"chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Shawn Sung (宋孝謙)" <Shawn.Sung@mediatek.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v3] drm/mediatek: Move mtk_crtc_finish_page_flip() to ddp_cmdq_cb()
Date: Wed, 11 Dec 2024 03:27:59 +0000	[thread overview]
Message-ID: <c3935ca3e990f6f608326cef1dd495d5913c227d.camel@mediatek.com> (raw)
In-Reply-To: <1e953fb5a4e4965ba509a1bb45e7c8336102ff29.camel@mediatek.com>

Hi CK,

[snip]

> > @@ -109,9 +109,14 @@ static void mtk_crtc_finish_page_flip(struct
> > mtk_crtc *mtk_crtc)
> >  static void mtk_drm_finish_page_flip(struct mtk_crtc *mtk_crtc)
> >  {
> >  	unsigned long flags;
> > +	struct drm_crtc *crtc = &mtk_crtc->base;
> > +	struct mtk_drm_private *priv = crtc->dev->dev_private;
> >  
> >  	drm_crtc_handle_vblank(&mtk_crtc->base);
> >  
> > +	if (!priv->data->shadow_register)
> > +		return;
> > +
> 
> I forget one case.
> For the CPU case (SoC has no shadow register and CONFIG_MTK_CMDQ is
> not enable),
> this driver should still work.
> CPU case is not a usual case, but it could be used in some
> verification case.
> So the condition may be
> 
> #if IS_REACHABLE(CONFIG_MTK_CMDQ)
> 	if (mtk_crtc->cmdq_client.chan)
> 		return;
> #endif
> 

OK, I'll change the condition like this.

> >  	spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> >  	if (!mtk_crtc->config_updating && mtk_crtc-
> > >pending_needs_vblank) {
> >  		mtk_crtc_finish_page_flip(mtk_crtc);

[snip]

> > @@ -584,6 +592,10 @@ static void mtk_crtc_update_config(struct
> > mtk_crtc *mtk_crtc, bool needs_vblank)
> >  		mtk_mutex_acquire(mtk_crtc->mutex);
> >  		mtk_crtc_ddp_config(crtc, NULL);
> >  		mtk_mutex_release(mtk_crtc->mutex);
> > +
> > +		spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > +		mtk_crtc->config_updating = false;
> > +		spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> >  	}
> >  #if IS_REACHABLE(CONFIG_MTK_CMDQ)
> >  	if (mtk_crtc->cmdq_client.chan) {
> > @@ -606,13 +618,14 @@ static void mtk_crtc_update_config(struct
> > mtk_crtc *mtk_crtc, bool needs_vblank)
> >  		 */
> >  		mtk_crtc->cmdq_vblank_cnt = 3;
> >  
> > +		spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > +		mtk_crtc->config_updating = false;
> > +		spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> > +
> >  		mbox_send_message(mtk_crtc->cmdq_client.chan,
> > cmdq_handle);
> >  		mbox_client_txdone(mtk_crtc->cmdq_client.chan, 0);
> >  	}
> >  #endif
> > -	spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > -	mtk_crtc->config_updating = false;
> > -	spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> 
> For the CPU case (SoC has no shadow register and CONFIG_MTK_CMDQ is
> not enable),
> This code is necessary.
> Maybe keep these code or some modification for CPU case.
> 

OK, I'll keep the original flow and only modify for
IS_REACHABLE(CONFIG_MTK_CMDQ) case.

Regards,
Jason-JH.lin

> Regards,
> CK

      reply	other threads:[~2024-12-11  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10  3:28 Jason-JH.Lin
2024-12-10  6:47 ` CK Hu (胡俊光)
2024-12-11  3:27   ` Jason-JH Lin (林睿祥) [this message]

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=c3935ca3e990f6f608326cef1dd495d5913c227d.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Shawn.Sung@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=ck.hu@mediatek.com \
    --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 \
    /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®