mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason-JH Lin (林睿祥)" <Jason-JH.Lin@mediatek.com>
To: "chunkuang.hu@kernel.org" <chunkuang.hu@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Singo Chang (張興國)" <Singo.Chang@mediatek.com>,
	"Nancy Lin (林欣螢)" <Nancy.Lin@mediatek.com>,
	"jkardatzke@google.com" <jkardatzke@google.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>,
	"angelogioacchino.delregno@collabora.com"
	<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH] drm/mediatek: Fix missing configuration flags in mtk_crtc_ddp_config()
Date: Mon, 19 Aug 2024 10:06:38 +0000	[thread overview]
Message-ID: <4c0867e2a53b70638504438e12fb55651fe4f0d1.camel@mediatek.com> (raw)
In-Reply-To: <CAAOTY__xOVgdF1iEtcbXrmnM40og8XJGZ+-5K02q58XbYY3GGQ@mail.gmail.com>

Hi CK,

> > --- a/drivers/gpu/drm/mediatek/mtk_crtc.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_crtc.c
> > @@ -314,30 +314,32 @@ static void ddp_cmdq_cb(struct mbox_client
> *cl, void *mssg)
> >
> >         state = to_mtk_crtc_state(mtk_crtc->base.state);
> >
> > -       state->pending_config = false;
> > +       if (!mtk_crtc->config_updating) {
> > +               state->pending_config = false;
> 
> I think if mtk_crtc->config_updating == true, the whole clear job
> could be skipped.
> And use spin_lock to protect the clear job in irq.
> 
> /*
> spin_lock():
> if (mtk_crtc->config_updating) {
>         spin_unlock();
>         goto out;
> }
> 
> /* clear job */
> 
> spin_unlock();
> */
> out:
> 
> In mtk_crtc_config_update(), use spin_lock to protect mtk_crtc-
> >config_updating:
> 
> spin_lock();
> mtk_crtc->config_updating = true;
> spin_unlock();
> ...
> spin_lock();
> mtk_crtc->config_updating = false;
> spin_unlock();
> 

Thanks for the reviews.

I think that's more solid to protect the updating config of cmd buffer.

I will also add spin_lock for the whole statement in
mtk_drm_finish_page_flip() because config_updating flag is covered the
pending_need_vblank flag.

Regards,
Jason-JH.Lin

> Regards,
> Chun-Kuang.
> 
> 
> >
> > -       if (mtk_crtc->pending_planes) {
> > -               for (i = 0; i < mtk_crtc->layer_nr; i++) {
> > -                       struct drm_plane *plane = &mtk_crtc-
> >planes[i];
> > -                       struct mtk_plane_state *plane_state;
> > +               if (mtk_crtc->pending_planes) {
> > +                       for (i = 0; i < mtk_crtc->layer_nr; i++) {
> > +                               struct drm_plane *plane =
> &mtk_crtc->planes[i];
> > +                               struct mtk_plane_state
> *plane_state;
> >
> > -                       plane_state = to_mtk_plane_state(plane-
> >state);
> > +                               plane_state =
> to_mtk_plane_state(plane->state);
> >
> > -                       plane_state->pending.config = false;
> > +                               plane_state->pending.config =
> false;
> > +                       }
> > +                       mtk_crtc->pending_planes = false;
> >                 }
> > -               mtk_crtc->pending_planes = false;
> > -       }
> >
> > -       if (mtk_crtc->pending_async_planes) {
> > -               for (i = 0; i < mtk_crtc->layer_nr; i++) {
> > -                       struct drm_plane *plane = &mtk_crtc-
> >planes[i];
> > -                       struct mtk_plane_state *plane_state;
> > +               if (mtk_crtc->pending_async_planes) {
> > +                       for (i = 0; i < mtk_crtc->layer_nr; i++) {
> > +                               struct drm_plane *plane =
> &mtk_crtc->planes[i];
> > +                               struct mtk_plane_state
> *plane_state;
> >
> > -                       plane_state = to_mtk_plane_state(plane-
> >state);
> > +                               plane_state =
> to_mtk_plane_state(plane->state);
> >
> > -                       plane_state->pending.async_config = false;
> > +                               plane_state->pending.async_config =
> false;
> > +                       }
> > +                       mtk_crtc->pending_async_planes = false;
> >                 }
> > -               mtk_crtc->pending_async_planes = false;
> >         }
> >
> >         mtk_crtc->cmdq_vblank_cnt = 0;
> > --
> > 2.18.0
> >

      reply	other threads:[~2024-08-19 10:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03 10:33 Jason-JH.Lin
2024-07-04  8:39 ` AngeloGioacchino Del Regno
2024-08-16  4:03 ` Chun-Kuang Hu
2024-08-19 10:06   ` 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=4c0867e2a53b70638504438e12fb55651fe4f0d1.camel@mediatek.com \
    --to=jason-jh.lin@mediatek.com \
    --cc=Nancy.Lin@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=Singo.Chang@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jkardatzke@google.com \
    --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®