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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Aug 2019 11:01:30 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     Fabrizio Castro <fabrizio.castro@...renesas.com>,
        Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
        Jacopo Mondi <jacopo+renesas@...ndi.org>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        DRI Development <dri-devel@...ts.freedesktop.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Simon Horman <horms@...ge.net.au>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Chris Paterson <Chris.Paterson2@...esas.com>,
        Biju Das <biju.das@...renesas.com>
Subject: Re: [PATCH/RFC 05/12] drm: rcar-du: lvds: Add data swap support

Hi Laurent,

On Fri, Aug 2, 2019 at 10:06 AM Laurent Pinchart
<laurent.pinchart@...asonboard.com> wrote:
> On Fri, Aug 02, 2019 at 08:34:02AM +0100, Fabrizio Castro wrote:
> > When in vertical stripe mode of operation, there is the option
> > of swapping even data and odd data on the two LVDS interfaces
> > used to drive the video output.
> > Add data swap support by exposing a new DT property named
> > "renesas,swap-data".
> >
> > Signed-off-by: Fabrizio Castro <fabrizio.castro@...renesas.com>

> > --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c

> > @@ -439,12 +440,16 @@ static void rcar_lvds_enable(struct drm_bridge *bridge)
> >       rcar_lvds_write(lvds, LVDCHCR, lvdhcr);
> >
> >       if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK) {
> > -             /*
> > -              * Configure vertical stripe based on the mode of operation of
> > -              * the connected device.
> > -              */
> > -             rcar_lvds_write(lvds, LVDSTRIPE,
> > -                             lvds->dual_link ? LVDSTRIPE_ST_ON : 0);
> > +             u32 lvdstripe = 0;
> > +
> > +             if (lvds->dual_link)
> > +                     /*
> > +                      * Configure vertical stripe based on the mode of
> > +                      * operation of the connected device.
> > +                      */
> > +                     lvdstripe = LVDSTRIPE_ST_ON | (lvds->stripe_swap_data ?
> > +                                                    LVDSTRIPE_ST_SWAP : 0);
>
> Would the following be simpler ?
>
>                 lvdstripe = (lvds->dual_link ? LVDSTRIPE_ST_ON : 0)
>                           | (lvds->stripe_swap_data ? LVDSTRIPE_ST_SWAP : 0);

>From the point of view of "wc -l": yes.
>From the point of view of readability, I'd go for:

    if (lvds->dual_link)
            lvdstripe |= LVDSTRIPE_ST_ON;
    if (lvds->stripe_swap_data)
            lvdstripe |= LVDSTRIPE_ST_SWAP;

> > +             rcar_lvds_write(lvds, LVDSTRIPE, lvdstripe);
> >       }
> >
> >       /*
> > @@ -770,8 +775,12 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ