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>
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>,
	"fshao@chromium.org" <fshao@chromium.org>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH v2] drm/mediatek: Move mtk_crtc_finish_page_flip() to ddp_cmdq_cb()
Date: Tue, 10 Dec 2024 01:45:45 +0000	[thread overview]
Message-ID: <b7398d1fb0d5ee96acf3587c44379b3f639a9a38.camel@mediatek.com> (raw)
In-Reply-To: <c0092a07a9e6d0bc9b2dc85f379e6cddfa095ef7.camel@mediatek.com>

Hi CK,

Thanks for the review.

[snip]

> >  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);
> >  
> > -	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);
> > -		mtk_crtc->pending_needs_vblank = false;
> > +	if (priv->data->shadow_register) {
> 
> if (!priv->data->shadow_register)
> 	return;
> 
> And this would reduce the indent.
> 

OK, I'll adjust 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);
> > +			mtk_crtc->pending_needs_vblank = false;
> > +		}
> > +		spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> >  	}
> > -	spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> >  }
> >  
> >  static void mtk_crtc_destroy(struct drm_crtc *crtc)
> > @@ -284,10 +288,8 @@ static void ddp_cmdq_cb(struct mbox_client
> > *cl, void *mssg)
> >  	state = to_mtk_crtc_state(mtk_crtc->base.state);
> >  
> >  	spin_lock_irqsave(&mtk_crtc->config_lock, flags);
> > -	if (mtk_crtc->config_updating) {
> > -		spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> > +	if (mtk_crtc->config_updating)
> >  		goto ddp_cmdq_cb_out;
> > -	}
> >  
> >  	state->pending_config = false;
> >  
> > @@ -315,10 +317,15 @@ static void ddp_cmdq_cb(struct mbox_client
> > *cl, void *mssg)
> >  		mtk_crtc->pending_async_planes = false;
> >  	}
> >  
> > -	spin_unlock_irqrestore(&mtk_crtc->config_lock, flags);
> > -
> >  ddp_cmdq_cb_out:
> >  
> > +	if (mtk_crtc->pending_needs_vblank) {
> > +		mtk_crtc_finish_page_flip(mtk_crtc);
> > +		mtk_crtc->pending_needs_vblank = false;
> 
> In mtk_crtc_update_config(), after mbox_client_txdone() and before
> mtk_crtc->config_updating = false;
> cmdq may have finish the command and callback ddp_cmdq_cb().
> Because mtk_crtc->config_updating is true, so this page flip would be
> skipped.
> But if there is no next mtk_crtc_update_config() exist, this page
> flip would never happen.
> This may cause some deadlock.
> 

OK, I'll move the mtk_crtc->config_updating = false; earlier than 
mbox_client_txdone() to avoid skipping the page flip.

Regards,
Jason-JH.Lin

> Regards,
> CK

      reply	other threads:[~2024-12-10  1:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 16:36 Jason-JH.Lin
2024-12-06  9:28 ` CK Hu (胡俊光)
2024-12-10  1:45   ` 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=b7398d1fb0d5ee96acf3587c44379b3f639a9a38.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=fshao@chromium.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®