From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Jacopo Mondi <jacopo+renesas@jmondi.org>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
DRI Development <dri-devel@lists.freedesktop.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Simon Horman <horms@verge.net.au>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Chris Paterson <Chris.Paterson2@renesas.com>,
Biju Das <biju.das@bp.renesas.com>
Subject: Re: [PATCH/RFC 05/12] drm: rcar-du: lvds: Add data swap support
Date: Fri, 2 Aug 2019 11:01:30 +0200 [thread overview]
Message-ID: <CAMuHMdWw5SyP=jfwTpA=+qheTh1ckhiP_etn1J4PrRVdL4R1Pg@mail.gmail.com> (raw)
In-Reply-To: <20190802080613.GF5008@pendragon.ideasonboard.com>
Hi Laurent,
On Fri, Aug 2, 2019 at 10:06 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.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@bp.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@linux-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
next prev parent reply other threads:[~2019-08-02 9:01 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-02 7:33 [PATCH/RFC 00/12] Add dual-LVDS panel support to EK874 Fabrizio Castro
2019-08-02 7:33 ` [PATCH/RFC 01/12] dt-bindings: display: renesas: lvds: RZ/G2E needs renesas,companion too Fabrizio Castro
2019-08-02 7:48 ` Laurent Pinchart
2019-08-02 7:33 ` [PATCH/RFC 02/12] dt-bindings: display: renesas: lvds: Document renesas,swap-data Fabrizio Castro
2019-08-02 7:44 ` Laurent Pinchart
2019-08-05 8:59 ` Fabrizio Castro
2019-08-05 9:35 ` Laurent Pinchart
2019-08-05 10:07 ` Fabrizio Castro
2019-08-02 7:34 ` [PATCH/RFC 03/12] dt-bindings: panel: lvds: Add dual-link LVDS display support Fabrizio Castro
2019-08-02 8:00 ` Laurent Pinchart
2019-08-05 9:02 ` Fabrizio Castro
2019-08-02 7:34 ` [PATCH/RFC 04/12] dt-bindings: display: Add bindings for Advantech IDK-2121WR Fabrizio Castro
2019-08-02 8:03 ` Laurent Pinchart
2019-08-05 9:04 ` Fabrizio Castro
2019-08-02 7:34 ` [PATCH/RFC 05/12] drm: rcar-du: lvds: Add data swap support Fabrizio Castro
2019-08-02 8:06 ` Laurent Pinchart
2019-08-02 9:01 ` Geert Uytterhoeven [this message]
2019-08-05 9:32 ` Fabrizio Castro
2019-08-05 10:17 ` Laurent Pinchart
2019-08-02 7:34 ` [PATCH/RFC 06/12] drm: rcar-du: lvds: Do not look at ports for identifying bridges Fabrizio Castro
2019-08-02 8:08 ` Laurent Pinchart
2019-08-05 9:06 ` Fabrizio Castro
2019-08-02 7:34 ` [PATCH/RFC 07/12] drm: rcar-du: lvds: Add support for dual link panels Fabrizio Castro
2019-08-02 8:20 ` Laurent Pinchart
2019-08-05 9:12 ` Fabrizio Castro
2019-08-05 9:48 ` Laurent Pinchart
2019-08-05 10:07 ` Fabrizio Castro
2019-08-02 7:34 ` [PATCH/RFC 08/12] drm: rcar-du: lvds: Fix bridge_to_rcar_lvds Fabrizio Castro
2019-08-02 8:22 ` Laurent Pinchart
2019-08-05 9:13 ` Fabrizio Castro
2019-08-02 7:34 ` [PATCH/RFC 09/12] drm: rcar-du: lvds: Fix companion's mode Fabrizio Castro
2019-08-02 8:26 ` Laurent Pinchart
2019-08-05 9:15 ` Fabrizio Castro
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='CAMuHMdWw5SyP=jfwTpA=+qheTh1ckhiP_etn1J4PrRVdL4R1Pg@mail.gmail.com' \
--to=geert@linux-m68k.org \
--cc=Chris.Paterson2@renesas.com \
--cc=airlied@linux.ie \
--cc=biju.das@bp.renesas.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=fabrizio.castro@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=horms@verge.net.au \
--cc=jacopo+renesas@jmondi.org \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).