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: <20200902175952.gf6siofkw7vgjkj3@gilmour.lan>
Date:   Wed, 2 Sep 2020 19:59:52 +0200
From:   Maxime Ripard <maxime@...no.tech>
To:     Dave Stevenson <dave.stevenson@...pberrypi.com>
Cc:     Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
        Eric Anholt <eric@...olt.net>,
        DRI Development <dri-devel@...ts.freedesktop.org>,
        linux-rpi-kernel@...ts.infradead.org,
        bcm-kernel-feedback-list@...adcom.com,
        linux-arm-kernel@...ts.infradead.org,
        LKML <linux-kernel@...r.kernel.org>,
        Tim Gover <tim.gover@...pberrypi.com>,
        Phil Elwell <phil@...pberrypi.com>
Subject: Re: [PATCH v4 13/78] drm/vc4: kms: Convert to for_each_new_crtc_state

Hi!

On Wed, Jul 29, 2020 at 04:02:06PM +0100, Dave Stevenson wrote:
> Hi Maxime
> 
> On Wed, 8 Jul 2020 at 18:42, Maxime Ripard <maxime@...no.tech> wrote:
> >
> > The vc4 atomic commit loop has an handrolled loop that is basically
> > identical to for_each_new_crtc_state, let's convert it to that helper.
> >
> > Signed-off-by: Maxime Ripard <maxime@...no.tech>
> > ---
> >  drivers/gpu/drm/vc4/vc4_kms.c |  9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
> > index 210cc2408087..717673b18132 100644
> > --- a/drivers/gpu/drm/vc4/vc4_kms.c
> > +++ b/drivers/gpu/drm/vc4/vc4_kms.c
> > @@ -152,14 +152,13 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state)
> >         struct drm_device *dev = state->dev;
> >         struct vc4_dev *vc4 = to_vc4_dev(dev);
> >         struct vc4_hvs *hvs = vc4->hvs;
> > -       struct vc4_crtc *vc4_crtc;
> > +       struct drm_crtc_state *new_crtc_state;
> > +       struct drm_crtc *crtc;
> >         int i;
> >
> > -       for (i = 0; i < dev->mode_config.num_crtc; i++) {
> > -               if (!state->crtcs[i].ptr || !state->crtcs[i].commit)
> > -                       continue;
> > +       for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
> > +               struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
> 
> for_each_new_crtc_in_state doesn't check !state->crtcs[i].commit as
> the hand rolled loop did. Sorry, this is my lack of knowledge, but
> does that actually make any real difference?
> 
> I see nothing wrong in calling vc4_hvs_mask_underrun multiple times
> anyway, so it's most likely going to be harmless anyway, but wanted to
> query it.

Sorry for not getting back to this earlier.

I don't really know :)

It looks like the commit pointer is always going to be !NULL in our case:
https://elixir.bootlin.com/linux/latest/source/include/drm/drm_crtc.h#L385

The only case where it seems to be checked is when using
for_each_old_crtc_in_state, and when the commit pointer is being
accessed, and we're in neither of those cases.

Since I don't really know though, I guess we can remain on the safe side
and keep it for now.

Maxime

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ