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: <CAJMQK-gpxG_vj-9hOBT-Pw6H9KAOEKJ6r+MJfa0ND_9839rQ9w@mail.gmail.com>
Date:   Mon, 22 Jun 2020 23:32:05 +0800
From:   Hsin-Yi Wang <hsinyi@...omium.org>
To:     Tomasz Figa <tfiga@...omium.org>
Cc:     "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        Chun-Kuang Hu <chunkuang.hu@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Matthias Brugger <matthias.bgg@...il.com>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        lkml <linux-kernel@...r.kernel.org>,
        Yongqiang Niu <yongqiang.niu@...iatek.com>
Subject: Re: [PATCH v2] drm/mediatek: check plane visibility in atomic_update

On Mon, Jun 22, 2020 at 11:20 PM Tomasz Figa <tfiga@...omium.org> wrote:
>
> Hi Hsin-Yi,
>
> On Mon, Jun 22, 2020 at 11:01:09PM +0800, Hsin-Yi Wang wrote:
> > Disable the plane if it's not visible. Otherwise mtk_ovl_layer_config()
> > would proceed with invalid plane and we may see vblank timeout.
> >
> > Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
> > Signed-off-by: Hsin-Yi Wang <hsinyi@...omium.org>
> > Reviewed-by: Chun-Kuang Hu <chunkuang.hu@...nel.org>
> > ---
> > v2: Add fixes tag
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 23 +++++++++++++----------
> >  1 file changed, 13 insertions(+), 10 deletions(-)
> >
>
> Thank you for the patch. Please see my comments inline.
>
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > index c2bd683a87c8..74dc71c7f3b6 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> > @@ -164,6 +164,16 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
> >                                                  true, true);
> >  }
> >
> > +static void mtk_plane_atomic_disable(struct drm_plane *plane,
> > +                                  struct drm_plane_state *old_state)
> > +{
> > +     struct mtk_plane_state *state = to_mtk_plane_state(plane->state);
> > +
> > +     state->pending.enable = false;
> > +     wmb(); /* Make sure the above parameter is set before update */
> > +     state->pending.dirty = true;
> > +}
> > +
> >  static void mtk_plane_atomic_update(struct drm_plane *plane,
> >                                   struct drm_plane_state *old_state)
> >  {
> > @@ -178,6 +188,9 @@ static void mtk_plane_atomic_update(struct drm_plane *plane,
> >       if (!crtc || WARN_ON(!fb))
> >               return;
> >
> > +     if (!plane->state->visible)
> > +             return mtk_plane_atomic_disable(plane, old_state);
>
> nit: Both this function and mtk_plane_atomic_disable() have the void return
> type. Perhaps we should rather move the return, without a value, to a
> separate statement?
Updated in v3, thanks.

>
> Best regards,
> Tomasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ