devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] R-Car DU: Convert LVDS code to bridge driver
@ 2018-01-12  0:58 Laurent Pinchart
  2018-01-12  0:58 ` [PATCH 01/10] dt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings Laurent Pinchart
                   ` (4 more replies)
  0 siblings, 5 replies; 36+ messages in thread
From: Laurent Pinchart @ 2018-01-12  0:58 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-renesas-soc, Sergei Shtylyov, devicetree

Hello,

This patch series addresses a design mistake that dates back from the initial
DU support. Support for the LVDS encoders, which are IP cores separate from
the DU, was bundled in the DU driver. Worse, both the DU and LVDS were
described through a single DT node.

To fix the, patches 01/10 and 02/10 define new DT bindings for the LVDS
encoders, and deprecate their description inside the DU bindings. To retain
backward compatibility with existing DT, patch 03/10 then patches the device
tree at runtime to convert the legacy bindings to the new ones.

With the DT side addressed, patch 04/10 then converts the LVDS support code to
a separate bridge driver. After a small fix to the Porter board device tree in
patch 05/10, patches 06/10 to 10/10 then update all the device tree sources to
the new LVDS encoders bindings.

I decided to go for live DT patching in patch 03/10 because implementing
support for both the legacy and new bindings in the driver would have been
very intrusive, and prevented further cleanups. I'm in a way both proud and 
ashamed of that patch that I would call a neat and dirty hack. It was fun to
write perhaps in a similar way that one would enjoy researching and developing
proof-of-concepts for security holes: they're good and bad at the same time.

Anyway, with this philosophical considerations aside, there were a few
shortcomings in the OF API that I worked around with local code in the driver.
If anyone is interested in performing similar live DT patching I think we
could move some of the code to the OF core. For instance I was surprised
to not find a device node lookup by path function that would start at a
given node instead of the root of the live device tree, and had to write
rcar_du_of_find_node_by_path(). Utility functions to add or modify properties
or to rename nodes could similarly be added.

Laurent Pinchart (10):
  dt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings
  dt-bindings: display: renesas: Deprecate LVDS support in the DU
    bindings
  drm: rcar-du: Fix legacy DT to create LVDS encoder nodes
  drm: rcar-du: Convert LVDS encoder code to bridge driver
  ARM: dts: porter: Fix HDMI output routing
  ARM: dts: r8a7790: Convert to new LVDS DT bindings
  ARM: dts: r8a7791: Convert to new LVDS DT bindings
  ARM: dts: r8a7793: Convert to new LVDS DT bindings
  arm64: dts: renesas: r8a7795: Convert to new LVDS DT bindings
  arm64: dts: renesas: r8a7796: Convert to new LVDS DT bindings

 .../bindings/display/bridge/renesas,lvds.txt       |  54 ++
 .../devicetree/bindings/display/renesas,du.txt     |  26 +-
 MAINTAINERS                                        |   1 +
 arch/arm/boot/dts/r8a7790-lager.dts                |  22 +-
 arch/arm/boot/dts/r8a7790.dtsi                     |  61 ++-
 arch/arm/boot/dts/r8a7791-koelsch.dts              |  10 +-
 arch/arm/boot/dts/r8a7791-porter.dts               |  18 +-
 arch/arm/boot/dts/r8a7791.dtsi                     |  35 +-
 arch/arm/boot/dts/r8a7793-gose.dts                 |  10 +-
 arch/arm/boot/dts/r8a7793.dtsi                     |  35 +-
 .../boot/dts/renesas/r8a7795-es1-salvator-x.dts    |   3 +-
 arch/arm64/boot/dts/renesas/r8a7795-h3ulcb.dts     |   3 +-
 arch/arm64/boot/dts/renesas/r8a7795-salvator-x.dts |   3 +-
 .../arm64/boot/dts/renesas/r8a7795-salvator-xs.dts |   3 +-
 arch/arm64/boot/dts/renesas/r8a7795.dtsi           |  35 +-
 arch/arm64/boot/dts/renesas/r8a7796-m3ulcb.dts     |   3 +-
 arch/arm64/boot/dts/renesas/r8a7796-salvator-x.dts |   3 +-
 arch/arm64/boot/dts/renesas/r8a7796.dtsi           |  35 +-
 drivers/gpu/drm/rcar-du/Kconfig                    |   5 +-
 drivers/gpu/drm/rcar-du/Makefile                   |   6 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c              |  21 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h              |   5 -
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c          | 175 +------
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h          |  12 -
 drivers/gpu/drm/rcar-du/rcar_du_kms.c              |  14 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c          |  93 ----
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h          |  24 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c          | 270 ----------
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h          |  64 ---
 drivers/gpu/drm/rcar-du/rcar_du_of.c               | 440 ++++++++++++++++
 drivers/gpu/drm/rcar-du/rcar_du_of.h               |  16 +
 drivers/gpu/drm/rcar-du/rcar_du_of_lvds.dts        |  82 +++
 drivers/gpu/drm/rcar-du/rcar_lvds.c                | 554 +++++++++++++++++++++
 33 files changed, 1420 insertions(+), 721 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
 delete mode 100644 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
 delete mode 100644 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h
 delete mode 100644 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.c
 delete mode 100644 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_of.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_of.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_of_lvds.dts
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_lvds.c

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2018-01-19 21:24 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12  0:58 [PATCH 00/10] R-Car DU: Convert LVDS code to bridge driver Laurent Pinchart
2018-01-12  0:58 ` [PATCH 01/10] dt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings Laurent Pinchart
2018-01-12  9:45   ` Geert Uytterhoeven
     [not found]     ` <CAMuHMdWMgst-1evod+0hZujU2xPtO3UmO9c2CPPrTg=gpHpTbw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-12 13:36       ` Laurent Pinchart
2018-01-12 10:13   ` Geert Uytterhoeven
2018-01-12 13:29     ` Laurent Pinchart
2018-01-15  6:55       ` Simon Horman
     [not found]         ` <20180115065528.cfelrll6dm6ggf4e-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>
2018-01-15  6:59           ` Laurent Pinchart
2018-01-15  7:57             ` Simon Horman
2018-01-15  8:05             ` Geert Uytterhoeven
2018-01-15  8:26               ` Laurent Pinchart
     [not found]   ` <20180112005858.26472-2-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2018-01-12 12:59     ` Biju Das
2018-01-12 13:26       ` Laurent Pinchart
2018-01-12 14:00         ` Fabrizio Castro
2018-01-12 14:25           ` Laurent Pinchart
2018-01-12 15:13   ` Sergei Shtylyov
     [not found]     ` <81a9462b-6aaa-52c7-f741-e504c14838e9-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2018-01-12 20:34       ` Laurent Pinchart
2018-01-12  0:58 ` [PATCH 02/10] dt-bindings: display: renesas: Deprecate LVDS support in the DU bindings Laurent Pinchart
2018-01-12  9:49   ` Geert Uytterhoeven
     [not found]     ` <CAMuHMdXYJmh8ssSRt8u75fTv5gyrpcoPKAuCT=BaF1Eu27CaiQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-12 10:44       ` Laurent Pinchart
2018-01-19 21:23         ` Rob Herring
     [not found]   ` <20180112005858.26472-3-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2018-01-12  9:54     ` Vladimir Zapolskiy
2018-01-12 10:43       ` Laurent Pinchart
2018-01-12 14:52         ` Sergei Shtylyov
2018-01-12 15:14   ` Sergei Shtylyov
2018-01-12 16:46     ` Laurent Pinchart
2018-01-19 21:24   ` Rob Herring
2018-01-12  0:58 ` [PATCH 03/10] drm: rcar-du: Fix legacy DT to create LVDS encoder nodes Laurent Pinchart
     [not found]   ` <20180112005858.26472-4-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2018-01-12 10:09     ` Geert Uytterhoeven
     [not found]       ` <CAMuHMdW5wDj5gyTnh+Xa3J10b_6For0MdhcTFgdU_+sgx=BYmA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-12 13:53         ` Laurent Pinchart
2018-01-12  9:47 ` [PATCH 00/10] R-Car DU: Convert LVDS code to bridge driver Geert Uytterhoeven
2018-01-12 13:48   ` Laurent Pinchart
2018-01-15  6:57     ` Simon Horman
2018-01-15  7:00       ` Laurent Pinchart
2018-01-15  7:58         ` Simon Horman
     [not found] ` <20180112005858.26472-1-laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
2018-01-15  6:59   ` Simon Horman

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