lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4c0867e2a53b70638504438e12fb55651fe4f0d1.camel@mediatek.com>
Date: Mon, 19 Aug 2024 10:06:38 +0000
From: Jason-JH Lin (林睿祥) <Jason-JH.Lin@...iatek.com>
To: "chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	Singo Chang (張興國) <Singo.Chang@...iatek.com>,
	Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
	"jkardatzke@...gle.com" <jkardatzke@...gle.com>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
	Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>,
	"angelogioacchino.delregno@...labora.com"
	<angelogioacchino.delregno@...labora.com>
Subject: Re: [PATCH] drm/mediatek: Fix missing configuration flags in
 mtk_crtc_ddp_config()

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
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ