Skip to contentSkip to conversation

Add Display support for SMARC RZ/{G2L,G2LC,V2L}

PATCH In review Biju Das 3 participants 20 messages Jun 14, 2024 – Jun 18, 2024

Subsystems (7)
lore
Share & tools
lore

Biju Das

author maintainer
#0 lore raw

cover Add Display support for SMARC RZ/{G2L,G2LC,V2L}

This patch series aims to add Display support for SMARC RZ/{G2L,G2LC,V2L} EVK platforms.

All the patches are cherry-picked from the mainline.

Patch 1 mainline commit does not include some files present in 5.10 tree, so manually moved across.

Adapted header files/KConfig changes for 5.10 kernel in patch9 (0009-drm-renesas-Add-RZ-G2L-DU-Support.patch) similar to rcar_du abd shmobile drm drivers.

Biju Das (9):
drm: Place Renesas drivers in a separate dir
dt-bindings: display: Document Renesas RZ/G2L DU bindings
dt-bindings: display: renesas,rzg2l-du: Document RZ/V2L DU bindings
drm: renesas: Add RZ/G2L DU Support
arm64: dts: renesas: r9a07g044: Add DU node
arm64: dts: renesas: r9a07g054: Add DU node
Revert "arm64: dts: renesas: Drop ADV7535 IRQ"
arm64: dts: renesas: rzg2l-smarc: Enable DU and link with DSI
arm64: defconfig: Enable Renesas RZ/G2L display unit DRM driver

Daniel Vetter (1):
drm: Allow const struct drm_driver

Maxime Ripard (1):
drm/crtc: Introduce drmm_crtc_init_with_planes

Philipp Zabel (3):
drm: add drmm_encoder_alloc()
drm/plane: add drmm_universal_plane_alloc()
drm/crtc: add drmm_crtc_alloc_with_planes()

 .../bindings/display/renesas,rzg2l-du.yaml    | 126 ++++++
 MAINTAINERS                                   |   1 +
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  46 ++
 arch/arm64/boot/dts/renesas/r9a07g054.dtsi    |  47 ++
 arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi  |  16 +-
 arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi |  16 +-
 arch/arm64/configs/defconfig                  |   1 +
 drivers/gpu/drm/Kconfig                       |   4 +-
 drivers/gpu/drm/Makefile                      |   3 +-
 drivers/gpu/drm/drm_crtc.c                    | 198 ++++++--
 drivers/gpu/drm/drm_drv.c                     |  17 +-
 drivers/gpu/drm/drm_encoder.c                 | 109 ++++-
 drivers/gpu/drm/drm_plane.c                   | 134 ++++--
 drivers/gpu/drm/renesas/Kconfig               |   5 +
 drivers/gpu/drm/renesas/Makefile              |   5 +
 drivers/gpu/drm/{ => renesas}/rcar-du/Kconfig |   0
 .../gpu/drm/{ => renesas}/rcar-du/Makefile    |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_cmm.c  |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_cmm.h  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_crtc.c  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_crtc.h  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_drv.c   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_drv.h   |   0
 .../{ => renesas}/rcar-du/rcar_du_encoder.c   |   0
 .../{ => renesas}/rcar-du/rcar_du_encoder.h   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_group.c |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_group.h |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_kms.c   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_kms.h   |   0
 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.c  | 323 +++++++++++++
 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.h  |  20 +
 .../rcar-du/rcar_du_of_lvds_r8a7790.dts       |  69 +++
 .../rcar-du/rcar_du_of_lvds_r8a7791.dts       |  43 ++
 .../rcar-du/rcar_du_of_lvds_r8a7793.dts       |  43 ++
 .../rcar-du/rcar_du_of_lvds_r8a7795.dts       |  43 ++
 .../rcar-du/rcar_du_of_lvds_r8a7796.dts       |  43 ++
 .../drm/{ => renesas}/rcar-du/rcar_du_plane.c |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_plane.h |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_regs.h  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_vsp.c   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_vsp.h   |   0
 .../{ => renesas}/rcar-du/rcar_du_writeback.c |   0
 .../{ => renesas}/rcar-du/rcar_du_writeback.h |   0
 .../drm/{ => renesas}/rcar-du/rcar_dw_hdmi.c  |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_lvds.c |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_lvds.h |   0
 .../{ => renesas}/rcar-du/rcar_lvds_regs.h    |   0
 .../{ => renesas}/rcar-du/rzg2l_mipi_dsi.c    |   0
 .../rcar-du/rzg2l_mipi_dsi_regs.h             |   0
 drivers/gpu/drm/renesas/rz-du/Kconfig         |  13 +
 drivers/gpu/drm/renesas/rz-du/Makefile        |   8 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 423 ++++++++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h |  89 ++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 175 ++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  78 ++++
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  72 +++
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.h  |  32 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  | 372 +++++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h  |  43 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  | 344 ++++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  |  82 ++++
 .../gpu/drm/{ => renesas}/shmobile/Kconfig    |   0
 .../gpu/drm/{ => renesas}/shmobile/Makefile   |   0
 .../shmobile/shmob_drm_backlight.c            |   0
 .../shmobile/shmob_drm_backlight.h            |   0
 .../{ => renesas}/shmobile/shmob_drm_crtc.c   |   0
 .../{ => renesas}/shmobile/shmob_drm_crtc.h   |   0
 .../{ => renesas}/shmobile/shmob_drm_drv.c    |   0
 .../{ => renesas}/shmobile/shmob_drm_drv.h    |   0
 .../{ => renesas}/shmobile/shmob_drm_kms.c    |   0
 .../{ => renesas}/shmobile/shmob_drm_kms.h    |   0
 .../{ => renesas}/shmobile/shmob_drm_plane.c  |   0
 .../{ => renesas}/shmobile/shmob_drm_plane.h  |   0
 .../{ => renesas}/shmobile/shmob_drm_regs.h   |   0
 include/drm/drm_crtc.h                        |  42 ++
 include/drm/drm_device.h                      |   4 +
 include/drm/drm_drv.h                         |   5 +-
 include/drm/drm_encoder.h                     |  30 ++
 include/drm/drm_plane.h                       |  42 ++
 79 files changed, 3053 insertions(+), 113 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
 create mode 100644 drivers/gpu/drm/renesas/Kconfig
 create mode 100644 drivers/gpu/drm/renesas/Makefile
 rename drivers/gpu/drm/{ => renesas}/rcar-du/Kconfig (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/Makefile (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_cmm.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_cmm.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_crtc.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_crtc.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_drv.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_drv.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_encoder.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_encoder.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_group.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_group.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_kms.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_kms.h (100%)
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.c
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.h
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7790.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7791.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7793.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7795.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7796.dts
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_plane.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_plane.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_regs.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_vsp.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_vsp.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_writeback.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_writeback.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_dw_hdmi.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_lvds.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_lvds.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_lvds_regs.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rzg2l_mipi_dsi.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rzg2l_mipi_dsi_regs.h (100%)
 create mode 100644 drivers/gpu/drm/renesas/rz-du/Kconfig
 create mode 100644 drivers/gpu/drm/renesas/rz-du/Makefile
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
 rename drivers/gpu/drm/{ => renesas}/shmobile/Kconfig (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/Makefile (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_backlight.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_backlight.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_crtc.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_crtc.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_drv.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_drv.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_kms.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_kms.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_plane.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_plane.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_regs.h (100%)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/14 drm: Place Renesas drivers in a separate dir

commit 11696c5e89245a1d360f75be3dfc4960b25a265a upstream.

Create vendor specific renesas directory and move renesas drivers to that directory.

[ Biju: Dropped {rcar_mipi_dsi.c, rcar_mipi_dsi.h, rcar_mipi_dsi_regs.h}
as support not available in 5.10
Manually moved the 5.10 files rcar_du_of.{c,h} and rcar_du_of_lvds_r8a779{0,1,3,5,6}.dts to drivers/gpu/drm/renesas/ directory ]

---
 MAINTAINERS                                   |   1 +
 drivers/gpu/drm/Kconfig                       |   4 +-
 drivers/gpu/drm/Makefile                      |   3 +-
 drivers/gpu/drm/renesas/Kconfig               |   4 +
 drivers/gpu/drm/renesas/Makefile              |   4 +
 drivers/gpu/drm/{ => renesas}/rcar-du/Kconfig |   0
 .../gpu/drm/{ => renesas}/rcar-du/Makefile    |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_cmm.c  |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_cmm.h  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_crtc.c  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_crtc.h  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_drv.c   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_drv.h   |   0
 .../{ => renesas}/rcar-du/rcar_du_encoder.c   |   0
 .../{ => renesas}/rcar-du/rcar_du_encoder.h   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_group.c |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_group.h |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_kms.c   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_kms.h   |   0
 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.c  | 323 ++++++++++++++++++
 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.h  |  20 ++
 .../rcar-du/rcar_du_of_lvds_r8a7790.dts       |  69 ++++
 .../rcar-du/rcar_du_of_lvds_r8a7791.dts       |  43 +++
 .../rcar-du/rcar_du_of_lvds_r8a7793.dts       |  43 +++
 .../rcar-du/rcar_du_of_lvds_r8a7795.dts       |  43 +++
 .../rcar-du/rcar_du_of_lvds_r8a7796.dts       |  43 +++
 .../drm/{ => renesas}/rcar-du/rcar_du_plane.c |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_plane.h |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_regs.h  |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_vsp.c   |   0
 .../drm/{ => renesas}/rcar-du/rcar_du_vsp.h   |   0
 .../{ => renesas}/rcar-du/rcar_du_writeback.c |   0
 .../{ => renesas}/rcar-du/rcar_du_writeback.h |   0
 .../drm/{ => renesas}/rcar-du/rcar_dw_hdmi.c  |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_lvds.c |   0
 .../gpu/drm/{ => renesas}/rcar-du/rcar_lvds.h |   0
 .../{ => renesas}/rcar-du/rcar_lvds_regs.h    |   0
 .../{ => renesas}/rcar-du/rzg2l_mipi_dsi.c    |   0
 .../rcar-du/rzg2l_mipi_dsi_regs.h             |   0
 .../gpu/drm/{ => renesas}/shmobile/Kconfig    |   0
 .../gpu/drm/{ => renesas}/shmobile/Makefile   |   0
 .../shmobile/shmob_drm_backlight.c            |   0
 .../shmobile/shmob_drm_backlight.h            |   0
 .../{ => renesas}/shmobile/shmob_drm_crtc.c   |   0
 .../{ => renesas}/shmobile/shmob_drm_crtc.h   |   0
 .../{ => renesas}/shmobile/shmob_drm_drv.c    |   0
 .../{ => renesas}/shmobile/shmob_drm_drv.h    |   0
 .../{ => renesas}/shmobile/shmob_drm_kms.c    |   0
 .../{ => renesas}/shmobile/shmob_drm_kms.h    |   0
 .../{ => renesas}/shmobile/shmob_drm_plane.c  |   0
 .../{ => renesas}/shmobile/shmob_drm_plane.h  |   0
 .../{ => renesas}/shmobile/shmob_drm_regs.h   |   0
 52 files changed, 595 insertions(+), 5 deletions(-)
 create mode 100644 drivers/gpu/drm/renesas/Kconfig
 create mode 100644 drivers/gpu/drm/renesas/Makefile
 rename drivers/gpu/drm/{ => renesas}/rcar-du/Kconfig (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/Makefile (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_cmm.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_cmm.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_crtc.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_crtc.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_drv.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_drv.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_encoder.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_encoder.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_group.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_group.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_kms.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_kms.h (100%)
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.c
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of.h
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7790.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7791.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7793.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7795.dts
 create mode 100644 drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7796.dts
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_plane.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_plane.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_regs.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_vsp.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_vsp.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_writeback.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_du_writeback.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_dw_hdmi.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_lvds.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_lvds.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rcar_lvds_regs.h (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rzg2l_mipi_dsi.c (100%)
 rename drivers/gpu/drm/{ => renesas}/rcar-du/rzg2l_mipi_dsi_regs.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/Kconfig (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/Makefile (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_backlight.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_backlight.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_crtc.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_crtc.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_drv.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_drv.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_kms.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_kms.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_plane.c (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_plane.h (100%)
 rename drivers/gpu/drm/{ => renesas}/shmobile/shmob_drm_regs.h (100%)
MAINTAINERS +1 -0
index 8f2e94c0ec19..ab7997f96fed 100644
@@ -5893,6 +5893,7 @@ F:	Documentation/devicetree/bindings/display/bridge/renesas,lvds.yaml
 F:	Documentation/devicetree/bindings/display/renesas,du.txt
 F:	drivers/gpu/drm/rcar-du/
 F:	drivers/gpu/drm/shmobile/
+F:	drivers/gpu/drm/renesas/
 F:	include/linux/platform_data/shmob_drm.h
 
 DRM DRIVERS FOR ROCKCHIP
drivers/gpu/drm/Kconfig +1 -3
index 4e9b3a95fa7c..f9709a2dd1f0 100644
@@ -319,9 +319,7 @@ source "drivers/gpu/drm/armada/Kconfig"
 
 source "drivers/gpu/drm/atmel-hlcdc/Kconfig"
 
-source "drivers/gpu/drm/rcar-du/Kconfig"
-
-source "drivers/gpu/drm/shmobile/Kconfig"
+source "drivers/gpu/drm/renesas/Kconfig"
 
 source "drivers/gpu/drm/sun4i/Kconfig"
 
drivers/gpu/drm/Makefile +1 -2
index 81569009f884..cd8b2d372b5e 100644
@@ -88,8 +88,7 @@ obj-$(CONFIG_DRM_UDL) += udl/
 obj-$(CONFIG_DRM_AST) += ast/
 obj-$(CONFIG_DRM_ARMADA) += armada/
 obj-$(CONFIG_DRM_ATMEL_HLCDC)	+= atmel-hlcdc/
-obj-y			+= rcar-du/
-obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/
+obj-y			+= renesas/
 obj-y			+= omapdrm/
 obj-$(CONFIG_DRM_SUN4I) += sun4i/
 obj-y			+= tilcdc/
drivers/gpu/drm/renesas/Kconfig new file +4 -0
new file mode 100644
index 000000000000..3777dad17f81
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+source "drivers/gpu/drm/renesas/rcar-du/Kconfig"
+source "drivers/gpu/drm/renesas/shmobile/Kconfig"
drivers/gpu/drm/renesas/Makefile new file +4 -0
new file mode 100644
index 000000000000..ec0e89e7a592
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-y += rcar-du/
+obj-$(CONFIG_DRM_SHMOBILE) += shmobile/
drivers/gpu/drm/renesas/rcar-du/Kconfig renamed from drivers/gpu/drm/rcar-du/Kconfig +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/Kconfig
rename to drivers/gpu/drm/renesas/rcar-du/Kconfig
drivers/gpu/drm/renesas/rcar-du/Makefile renamed from drivers/gpu/drm/rcar-du/Makefile +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/Makefile
rename to drivers/gpu/drm/renesas/rcar-du/Makefile
drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c renamed from drivers/gpu/drm/rcar-du/rcar_cmm.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_cmm.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_cmm.c
drivers/gpu/drm/renesas/rcar-du/rcar_cmm.h renamed from drivers/gpu/drm/rcar-du/rcar_cmm.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_cmm.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_cmm.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c renamed from drivers/gpu/drm/rcar-du/rcar_du_crtc.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_crtc.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.h renamed from drivers/gpu/drm/rcar-du/rcar_du_crtc.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_crtc.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c renamed from drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_drv.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.h renamed from drivers/gpu/drm/rcar-du/rcar_du_drv.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_drv.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_drv.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c renamed from drivers/gpu/drm/rcar-du/rcar_du_encoder.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_encoder.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.h renamed from drivers/gpu/drm/rcar-du/rcar_du_encoder.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_encoder.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c renamed from drivers/gpu/drm/rcar-du/rcar_du_group.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_group.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_group.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h renamed from drivers/gpu/drm/rcar-du/rcar_du_group.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_group.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_group.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c renamed from drivers/gpu/drm/rcar-du/rcar_du_kms.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_kms.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.h renamed from drivers/gpu/drm/rcar-du/rcar_du_kms.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_kms.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_of.c new file +323 -0

323 lines not on this page · raw message

drivers/gpu/drm/renesas/rcar-du/rcar_du_of.h new file +20 -0
new file mode 100644
index 000000000000..8dd3fbe96650
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * rcar_du_of.h - Legacy DT bindings compatibility
+ *
+ * Copyright (C) 2018 Laurent Pinchart <[email protected]>
+ */
+#ifndef __RCAR_DU_OF_H__
+#define __RCAR_DU_OF_H__
+
+#include <linux/init.h>
+
+struct of_device_id;
+
+#if IS_ENABLED(CONFIG_DRM_RCAR_LVDS)
+void __init rcar_du_of_init(const struct of_device_id *of_ids);
+#else
+static inline void rcar_du_of_init(const struct of_device_id *of_ids) { }
+#endif /* CONFIG_DRM_RCAR_LVDS */
+
+#endif /* __RCAR_DU_OF_H__ */
drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7790.dts new file +69 -0

69 lines not on this page · raw message

drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7791.dts new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7793.dts new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7795.dts new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/renesas/rcar-du/rcar_du_of_lvds_r8a7796.dts new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c renamed from drivers/gpu/drm/rcar-du/rcar_du_plane.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_plane.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.h renamed from drivers/gpu/drm/rcar-du/rcar_du_plane.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_plane.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_plane.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_regs.h renamed from drivers/gpu/drm/rcar-du/rcar_du_regs.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_regs.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_regs.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c renamed from drivers/gpu/drm/rcar-du/rcar_du_vsp.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_vsp.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.h renamed from drivers/gpu/drm/rcar-du/rcar_du_vsp.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_vsp.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.h
drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c renamed from drivers/gpu/drm/rcar-du/rcar_du_writeback.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_writeback.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.c
drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.h renamed from drivers/gpu/drm/rcar-du/rcar_du_writeback.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_du_writeback.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_du_writeback.h
drivers/gpu/drm/renesas/rcar-du/rcar_dw_hdmi.c renamed from drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_dw_hdmi.c
drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c renamed from drivers/gpu/drm/rcar-du/rcar_lvds.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_lvds.c
rename to drivers/gpu/drm/renesas/rcar-du/rcar_lvds.c
drivers/gpu/drm/renesas/rcar-du/rcar_lvds.h renamed from drivers/gpu/drm/rcar-du/rcar_lvds.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_lvds.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_lvds.h
drivers/gpu/drm/renesas/rcar-du/rcar_lvds_regs.h renamed from drivers/gpu/drm/rcar-du/rcar_lvds_regs.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rcar_lvds_regs.h
rename to drivers/gpu/drm/renesas/rcar-du/rcar_lvds_regs.h
drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c renamed from drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi.c
rename to drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi.c
drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi_regs.h renamed from drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi_regs.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/rcar-du/rzg2l_mipi_dsi_regs.h
rename to drivers/gpu/drm/renesas/rcar-du/rzg2l_mipi_dsi_regs.h
drivers/gpu/drm/renesas/shmobile/Kconfig renamed from drivers/gpu/drm/shmobile/Kconfig +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/Kconfig
rename to drivers/gpu/drm/renesas/shmobile/Kconfig
drivers/gpu/drm/renesas/shmobile/Makefile renamed from drivers/gpu/drm/shmobile/Makefile +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/Makefile
rename to drivers/gpu/drm/renesas/shmobile/Makefile
drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.c renamed from drivers/gpu/drm/shmobile/shmob_drm_backlight.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_backlight.c
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.c
drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.h renamed from drivers/gpu/drm/shmobile/shmob_drm_backlight.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_backlight.h
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_backlight.h
drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c renamed from drivers/gpu/drm/shmobile/shmob_drm_crtc.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_crtc.c
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c
drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h renamed from drivers/gpu/drm/shmobile/shmob_drm_crtc.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_crtc.h
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.h
drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c renamed from drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_drv.c
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.c
drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.h renamed from drivers/gpu/drm/shmobile/shmob_drm_drv.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_drv.h
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_drv.h
drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c renamed from drivers/gpu/drm/shmobile/shmob_drm_kms.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_kms.c
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.c
drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.h renamed from drivers/gpu/drm/shmobile/shmob_drm_kms.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_kms.h
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_kms.h
drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c renamed from drivers/gpu/drm/shmobile/shmob_drm_plane.c +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_plane.c
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.c
drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.h renamed from drivers/gpu/drm/shmobile/shmob_drm_plane.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_plane.h
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_plane.h
drivers/gpu/drm/renesas/shmobile/shmob_drm_regs.h renamed from drivers/gpu/drm/shmobile/shmob_drm_regs.h +0 -0
similarity index 100%
rename from drivers/gpu/drm/shmobile/shmob_drm_regs.h
rename to drivers/gpu/drm/renesas/shmobile/shmob_drm_regs.h
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 2/14 drm: Allow const struct drm_driver

In reply to Biju Das

From: Daniel Vetter <[email protected]>

commit 8f5c7aa078cf6f81ef5afc3f0516b4049decb4eb upstream.

It's nice if a big function/ioctl table like this is const. Only downside here is that we need a few more #ifdef to paper over the differences when CONFIG_DRM_LEGACY is enabled. Maybe provides more motivation to sunset that horror show :-)

v2:
- Fix super important checkpatch warning (Sam)
- Update the kerneldoc example too (Sam)

---
 drivers/gpu/drm/drm_drv.c | 17 +++++++++++------
 include/drm/drm_device.h  |  4 ++++
 include/drm/drm_drv.h     |  5 +++--
 3 files changed, 18 insertions(+), 8 deletions(-)
drivers/gpu/drm/drm_drv.c +11 -6
index 10831d8d7148..b1313d8d96c9 100644
@@ -284,7 +284,7 @@ void drm_minor_release(struct drm_minor *minor)
  *		struct clk *pclk;
  *	};
  *
- *	static struct drm_driver driver_drm_driver = {
+ *	static const struct drm_driver driver_drm_driver = {
  *		[...]
  *	};
  *
@@ -574,7 +574,7 @@ static void drm_dev_init_release(struct drm_device *dev, void *res)
 }
 
 static int drm_dev_init(struct drm_device *dev,
-			struct drm_driver *driver,
+			const struct drm_driver *driver,
 			struct device *parent)
 {
 	struct inode *inode;
@@ -590,7 +590,11 @@ static int drm_dev_init(struct drm_device *dev,
 
 	kref_init(&dev->ref);
 	dev->dev = get_device(parent);
+#ifdef CONFIG_DRM_LEGACY
+	dev->driver = (struct drm_driver *)driver;
+#else
 	dev->driver = driver;
+#endif
 
 	INIT_LIST_HEAD(&dev->managed.resources);
 	spin_lock_init(&dev->managed.lock);
@@ -666,7 +670,7 @@ static void devm_drm_dev_init_release(void *data)
 
 static int devm_drm_dev_init(struct device *parent,
 			     struct drm_device *dev,
-			     struct drm_driver *driver)
+			     const struct drm_driver *driver)
 {
 	int ret;
 
@@ -681,7 +685,8 @@ static int devm_drm_dev_init(struct device *parent,
 	return ret;
 }
 
-void *__devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
+void *__devm_drm_dev_alloc(struct device *parent,
+			   const struct drm_driver *driver,
 			   size_t size, size_t offset)
 {
 	void *container;
@@ -716,7 +721,7 @@ EXPORT_SYMBOL(__devm_drm_dev_alloc);
  * RETURNS:
  * Pointer to new DRM device, or ERR_PTR on failure.
  */
-struct drm_device *drm_dev_alloc(struct drm_driver *driver,
+struct drm_device *drm_dev_alloc(const struct drm_driver *driver,
 				 struct device *parent)
 {
 	struct drm_device *dev;
@@ -861,7 +866,7 @@ static void remove_compat_control_link(struct drm_device *dev)
  */
 int drm_dev_register(struct drm_device *dev, unsigned long flags)
 {
-	struct drm_driver *driver = dev->driver;
+	const struct drm_driver *driver = dev->driver;
 	int ret;
 
 	if (!driver->load)
include/drm/drm_device.h +4 -0
index f4f68e7a9149..2c361964aee7 100644
@@ -83,7 +83,11 @@ struct drm_device {
 	} managed;
 
 	/** @driver: DRM driver managing the device */
+#ifdef CONFIG_DRM_LEGACY
 	struct drm_driver *driver;
+#else
+	const struct drm_driver *driver;
+#endif
 
 	/**
 	 * @dev_private:
include/drm/drm_drv.h +3 -2
index e57d0440f00f..8324b65b4dae 100644
@@ -588,7 +588,8 @@ struct drm_driver {
 	int dev_priv_size;
 };
 
-void *__devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
+void *__devm_drm_dev_alloc(struct device *parent,
+			   const struct drm_driver *driver,
 			   size_t size, size_t offset);
 
 /**
@@ -621,7 +622,7 @@ void *__devm_drm_dev_alloc(struct device *parent, struct drm_driver *driver,
 	((type *) __devm_drm_dev_alloc(parent, driver, sizeof(type), \
 				       offsetof(type, member)))
 
-struct drm_device *drm_dev_alloc(struct drm_driver *driver,
+struct drm_device *drm_dev_alloc(const struct drm_driver *driver,
 				 struct device *parent);
 int drm_dev_register(struct drm_device *dev, unsigned long flags);
 void drm_dev_unregister(struct drm_device *dev);
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH 3/14 drm: add drmm_encoder_alloc()

In reply to Biju Das

From: Philipp Zabel <[email protected]>

commit ca5092d04d86986c03b6e0042e2f1cd119c50f5d upstream.

Add an alternative to drm_encoder_init() that allocates and initializes an encoder and registers drm_encoder_cleanup() with drmm_add_action_or_reset().

---
 drivers/gpu/drm/drm_encoder.c | 109 +++++++++++++++++++++++++++-------
 include/drm/drm_encoder.h     |  30 ++++++++++
 2 files changed, 116 insertions(+), 23 deletions(-)
drivers/gpu/drm/drm_encoder.c +86 -23
index e555281f43d4..24ac9a2350ea 100644
@@ -26,6 +26,7 @@
 #include <drm/drm_device.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_encoder.h>
+#include <drm/drm_managed.h>
 
 #include "drm_crtc_internal.h"
 
@@ -91,25 +92,11 @@ void drm_encoder_unregister_all(struct drm_device *dev)
 	}
 }
 
-/**
- * drm_encoder_init - Init a preallocated encoder
- * @dev: drm device
- * @encoder: the encoder to init
- * @funcs: callbacks for this encoder
- * @encoder_type: user visible type of the encoder
- * @name: printf style format string for the encoder name, or NULL for default name
- *
- * Initialises a preallocated encoder. Encoder should be subclassed as part of
- * driver encoder objects. At driver unload time drm_encoder_cleanup() should be
- * called from the driver's &drm_encoder_funcs.destroy hook.
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_encoder_init(struct drm_device *dev,
-		     struct drm_encoder *encoder,
-		     const struct drm_encoder_funcs *funcs,
-		     int encoder_type, const char *name, ...)
+__printf(5, 0)
+static int __drm_encoder_init(struct drm_device *dev,
+			      struct drm_encoder *encoder,
+			      const struct drm_encoder_funcs *funcs,
+			      int encoder_type, const char *name, va_list ap)
 {
 	int ret;
 
@@ -125,11 +112,7 @@ int drm_encoder_init(struct drm_device *dev,
 	encoder->encoder_type = encoder_type;
 	encoder->funcs = funcs;
 	if (name) {
-		va_list ap;
-
-		va_start(ap, name);
 		encoder->name = kvasprintf(GFP_KERNEL, name, ap);
-		va_end(ap);
 	} else {
 		encoder->name = kasprintf(GFP_KERNEL, "%s-%d",
 					  drm_encoder_enum_list[encoder_type].name,
@@ -150,6 +133,44 @@ int drm_encoder_init(struct drm_device *dev,
 
 	return ret;
 }
+
+/**
+ * drm_encoder_init - Init a preallocated encoder
+ * @dev: drm device
+ * @encoder: the encoder to init
+ * @funcs: callbacks for this encoder
+ * @encoder_type: user visible type of the encoder
+ * @name: printf style format string for the encoder name, or NULL for default name
+ *
+ * Initializes a preallocated encoder. Encoder should be subclassed as part of
+ * driver encoder objects. At driver unload time the driver's
+ * &drm_encoder_funcs.destroy hook should call drm_encoder_cleanup() and kfree()
+ * the encoder structure. The encoder structure should not be allocated with
+ * devm_kzalloc().
+ *
+ * Note: consider using drmm_encoder_alloc() instead of drm_encoder_init() to
+ * let the DRM managed resource infrastructure take care of cleanup and
+ * deallocation.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drm_encoder_init(struct drm_device *dev,
+		     struct drm_encoder *encoder,
+		     const struct drm_encoder_funcs *funcs,
+		     int encoder_type, const char *name, ...)
+{
+	va_list ap;
+	int ret;
+
+	WARN_ON(!funcs->destroy);
+
+	va_start(ap, name);
+	ret = __drm_encoder_init(dev, encoder, funcs, encoder_type, name, ap);
+	va_end(ap);
+
+	return ret;
+}
 EXPORT_SYMBOL(drm_encoder_init);
 
 /**
@@ -181,6 +202,48 @@ void drm_encoder_cleanup(struct drm_encoder *encoder)
 }
 EXPORT_SYMBOL(drm_encoder_cleanup);
 
+static void drmm_encoder_alloc_release(struct drm_device *dev, void *ptr)
+{
+	struct drm_encoder *encoder = ptr;
+
+	if (WARN_ON(!encoder->dev))
+		return;
+
+	drm_encoder_cleanup(encoder);
+}
+
+void *__drmm_encoder_alloc(struct drm_device *dev, size_t size, size_t offset,
+			   const struct drm_encoder_funcs *funcs,
+			   int encoder_type, const char *name, ...)
+{
+	void *container;
+	struct drm_encoder *encoder;
+	va_list ap;
+	int ret;
+
+	if (WARN_ON(funcs && funcs->destroy))
+		return ERR_PTR(-EINVAL);
+
+	container = drmm_kzalloc(dev, size, GFP_KERNEL);
+	if (!container)
+		return ERR_PTR(-EINVAL);
+
+	encoder = container + offset;
+
+	va_start(ap, name);
+	ret = __drm_encoder_init(dev, encoder, funcs, encoder_type, name, ap);
+	va_end(ap);
+	if (ret)
+		return ERR_PTR(ret);
+
+	ret = drmm_add_action_or_reset(dev, drmm_encoder_alloc_release, encoder);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return container;
+}
+EXPORT_SYMBOL(__drmm_encoder_alloc);
+
 static struct drm_crtc *drm_encoder_get_crtc(struct drm_encoder *encoder)
 {
 	struct drm_connector *connector;
include/drm/drm_encoder.h +30 -0
index a60f5f1555ac..8e1316caba28 100644
@@ -195,6 +195,36 @@ int drm_encoder_init(struct drm_device *dev,
 		     const struct drm_encoder_funcs *funcs,
 		     int encoder_type, const char *name, ...);
 
+__printf(6, 7)
+void *__drmm_encoder_alloc(struct drm_device *dev,
+			   size_t size, size_t offset,
+			   const struct drm_encoder_funcs *funcs,
+			   int encoder_type,
+			   const char *name, ...);
+
+/**
+ * drmm_encoder_alloc - Allocate and initialize an encoder
+ * @dev: drm device
+ * @type: the type of the struct which contains struct &drm_encoder
+ * @member: the name of the &drm_encoder within @type
+ * @funcs: callbacks for this encoder (optional)
+ * @encoder_type: user visible type of the encoder
+ * @name: printf style format string for the encoder name, or NULL for default name
+ *
+ * Allocates and initializes an encoder. Encoder should be subclassed as part of
+ * driver encoder objects. Cleanup is automatically handled through registering
+ * drm_encoder_cleanup() with drmm_add_action().
+ *
+ * The @drm_encoder_funcs.destroy hook must be NULL.
+ *
+ * Returns:
+ * Pointer to new encoder, or ERR_PTR on failure.
+ */
+#define drmm_encoder_alloc(dev, type, member, funcs, encoder_type, name, ...) \
+	((type *)__drmm_encoder_alloc(dev, sizeof(type), \
+				      offsetof(type, member), funcs, \
+				      encoder_type, name, ##__VA_ARGS__))
+
 /**
  * drm_encoder_index - find the index of a registered encoder
  * @encoder: encoder to find index for
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH 4/14 drm/plane: add drmm_universal_plane_alloc()

In reply to Biju Das

From: Philipp Zabel <[email protected]>

commit 0a1b813f06f1009d1d44d48888e92e3a59ea0be3 upstream.

Add an alternative to drm_universal_plane_init() that allocates and initializes a plane and registers drm_plane_cleanup() with drmm_add_action_or_reset().

---
 drivers/gpu/drm/drm_plane.c | 134 ++++++++++++++++++++++++++++--------
 include/drm/drm_plane.h     |  42 +++++++++++
 2 files changed, 147 insertions(+), 29 deletions(-)
drivers/gpu/drm/drm_plane.c +105 -29
index 79249568bdec..27456ba2443c 100644
@@ -30,6 +30,7 @@
 #include <drm/drm_file.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_fourcc.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_vblank.h>
 
 #include "drm_crtc_internal.h"
@@ -152,31 +153,16 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane
 	return 0;
 }
 
-/**
- * drm_universal_plane_init - Initialize a new universal plane object
- * @dev: DRM device
- * @plane: plane object to init
- * @possible_crtcs: bitmask of possible CRTCs
- * @funcs: callbacks for the new plane
- * @formats: array of supported formats (DRM_FORMAT\_\*)
- * @format_count: number of elements in @formats
- * @format_modifiers: array of struct drm_format modifiers terminated by
- *                    DRM_FORMAT_MOD_INVALID
- * @type: type of plane (overlay, primary, cursor)
- * @name: printf style format string for the plane name, or NULL for default name
- *
- * Initializes a plane object of type @type.
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
-			     uint32_t possible_crtcs,
-			     const struct drm_plane_funcs *funcs,
-			     const uint32_t *formats, unsigned int format_count,
-			     const uint64_t *format_modifiers,
-			     enum drm_plane_type type,
-			     const char *name, ...)
+__printf(9, 0)
+static int __drm_universal_plane_init(struct drm_device *dev,
+				      struct drm_plane *plane,
+				      uint32_t possible_crtcs,
+				      const struct drm_plane_funcs *funcs,
+				      const uint32_t *formats,
+				      unsigned int format_count,
+				      const uint64_t *format_modifiers,
+				      enum drm_plane_type type,
+				      const char *name, va_list ap)
 {
 	struct drm_mode_config *config = &dev->mode_config;
 	unsigned int format_modifier_count = 0;
@@ -237,11 +223,7 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
 	}
 
 	if (name) {
-		va_list ap;
-
-		va_start(ap, name);
 		plane->name = kvasprintf(GFP_KERNEL, name, ap);
-		va_end(ap);
 	} else {
 		plane->name = kasprintf(GFP_KERNEL, "plane-%d",
 					drm_num_planes(dev));
@@ -286,8 +268,102 @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
 
 	return 0;
 }
+
+/**
+ * drm_universal_plane_init - Initialize a new universal plane object
+ * @dev: DRM device
+ * @plane: plane object to init
+ * @possible_crtcs: bitmask of possible CRTCs
+ * @funcs: callbacks for the new plane
+ * @formats: array of supported formats (DRM_FORMAT\_\*)
+ * @format_count: number of elements in @formats
+ * @format_modifiers: array of struct drm_format modifiers terminated by
+ *                    DRM_FORMAT_MOD_INVALID
+ * @type: type of plane (overlay, primary, cursor)
+ * @name: printf style format string for the plane name, or NULL for default name
+ *
+ * Initializes a plane object of type @type. The &drm_plane_funcs.destroy hook
+ * should call drm_plane_cleanup() and kfree() the plane structure. The plane
+ * structure should not be allocated with devm_kzalloc().
+ *
+ * Note: consider using drmm_universal_plane_alloc() instead of
+ * drm_universal_plane_init() to let the DRM managed resource infrastructure
+ * take care of cleanup and deallocation.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane,
+			     uint32_t possible_crtcs,
+			     const struct drm_plane_funcs *funcs,
+			     const uint32_t *formats, unsigned int format_count,
+			     const uint64_t *format_modifiers,
+			     enum drm_plane_type type,
+			     const char *name, ...)
+{
+	va_list ap;
+	int ret;
+
+	WARN_ON(!funcs->destroy);
+
+	va_start(ap, name);
+	ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs,
+					 formats, format_count, format_modifiers,
+					 type, name, ap);
+	va_end(ap);
+	return ret;
+}
 EXPORT_SYMBOL(drm_universal_plane_init);
 
+static void drmm_universal_plane_alloc_release(struct drm_device *dev, void *ptr)
+{
+	struct drm_plane *plane = ptr;
+
+	if (WARN_ON(!plane->dev))
+		return;
+
+	drm_plane_cleanup(plane);
+}
+
+void *__drmm_universal_plane_alloc(struct drm_device *dev, size_t size,
+				   size_t offset, uint32_t possible_crtcs,
+				   const struct drm_plane_funcs *funcs,
+				   const uint32_t *formats, unsigned int format_count,
+				   const uint64_t *format_modifiers,
+				   enum drm_plane_type type,
+				   const char *name, ...)
+{
+	void *container;
+	struct drm_plane *plane;
+	va_list ap;
+	int ret;
+
+	if (WARN_ON(!funcs || funcs->destroy))
+		return ERR_PTR(-EINVAL);
+
+	container = drmm_kzalloc(dev, size, GFP_KERNEL);
+	if (!container)
+		return ERR_PTR(-ENOMEM);
+
+	plane = container + offset;
+
+	va_start(ap, name);
+	ret = __drm_universal_plane_init(dev, plane, possible_crtcs, funcs,
+					 formats, format_count, format_modifiers,
+					 type, name, ap);
+	va_end(ap);
+	if (ret)
+		return ERR_PTR(ret);
+
+	ret = drmm_add_action_or_reset(dev, drmm_universal_plane_alloc_release,
+				       plane);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return container;
+}
+EXPORT_SYMBOL(__drmm_universal_plane_alloc);
+
 int drm_plane_register_all(struct drm_device *dev)
 {
 	unsigned int num_planes = 0;
include/drm/drm_plane.h +42 -0

48 lines not on this page · raw message

Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH 5/14 drm/crtc: add drmm_crtc_alloc_with_planes()

In reply to Biju Das

From: Philipp Zabel <[email protected]>

commit 9dbb70fd663770418daab07590f4f534eb7a4931 upstream.

Add an alternative to drm_crtc_init_with_planes() that allocates and initializes a crtc and registers drm_crtc_cleanup() with drmm_add_action_or_reset().

---
 drivers/gpu/drm/drm_crtc.c | 125 ++++++++++++++++++++++++++++---------
 include/drm/drm_crtc.h     |  33 ++++++++++
 2 files changed, 130 insertions(+), 28 deletions(-)
drivers/gpu/drm/drm_crtc.c +97 -28
index 4ed3fc28d4da..3d73f69ce044 100644
@@ -38,6 +38,7 @@
 #include <drm/drm_crtc.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_fourcc.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_modeset_lock.h>
 #include <drm/drm_atomic.h>
 #include <drm/drm_auth.h>
@@ -231,30 +232,12 @@ struct dma_fence *drm_crtc_create_fence(struct drm_crtc *crtc)
  * 	Setting MODE_ID to 0 will release reserved resources for the CRTC.
  */
 
-/**
- * drm_crtc_init_with_planes - Initialise a new CRTC object with
- *    specified primary and cursor planes.
- * @dev: DRM device
- * @crtc: CRTC object to init
- * @primary: Primary plane for CRTC
- * @cursor: Cursor plane for CRTC
- * @funcs: callbacks for the new CRTC
- * @name: printf style format string for the CRTC name, or NULL for default name
- *
- * Inits a new object created as base part of a driver crtc object. Drivers
- * should use this function instead of drm_crtc_init(), which is only provided
- * for backwards compatibility with drivers which do not yet support universal
- * planes). For really simple hardware which has only 1 plane look at
- * drm_simple_display_pipe_init() instead.
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
-			      struct drm_plane *primary,
-			      struct drm_plane *cursor,
-			      const struct drm_crtc_funcs *funcs,
-			      const char *name, ...)
+__printf(6, 0)
+static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
+				       struct drm_plane *primary,
+				       struct drm_plane *cursor,
+				       const struct drm_crtc_funcs *funcs,
+				       const char *name, va_list ap)
 {
 	struct drm_mode_config *config = &dev->mode_config;
 	int ret;
@@ -282,11 +265,7 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
 		return ret;
 
 	if (name) {
-		va_list ap;
-
-		va_start(ap, name);
 		crtc->name = kvasprintf(GFP_KERNEL, name, ap);
-		va_end(ap);
 	} else {
 		crtc->name = kasprintf(GFP_KERNEL, "crtc-%d",
 				       drm_num_crtcs(dev));
@@ -330,8 +309,98 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
 
 	return 0;
 }
+
+/**
+ * drm_crtc_init_with_planes - Initialise a new CRTC object with
+ *    specified primary and cursor planes.
+ * @dev: DRM device
+ * @crtc: CRTC object to init
+ * @primary: Primary plane for CRTC
+ * @cursor: Cursor plane for CRTC
+ * @funcs: callbacks for the new CRTC
+ * @name: printf style format string for the CRTC name, or NULL for default name
+ *
+ * Inits a new object created as base part of a driver crtc object. Drivers
+ * should use this function instead of drm_crtc_init(), which is only provided
+ * for backwards compatibility with drivers which do not yet support universal
+ * planes). For really simple hardware which has only 1 plane look at
+ * drm_simple_display_pipe_init() instead.
+ * The &drm_crtc_funcs.destroy hook should call drm_crtc_cleanup() and kfree()
+ * the crtc structure. The crtc structure should not be allocated with
+ * devm_kzalloc().
+ *
+ * Note: consider using drmm_crtc_alloc_with_planes() instead of
+ * drm_crtc_init_with_planes() to let the DRM managed resource infrastructure
+ * take care of cleanup and deallocation.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
+			      struct drm_plane *primary,
+			      struct drm_plane *cursor,
+			      const struct drm_crtc_funcs *funcs,
+			      const char *name, ...)
+{
+	va_list ap;
+	int ret;
+
+	WARN_ON(!funcs->destroy);
+
+	va_start(ap, name);
+	ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+					  name, ap);
+	va_end(ap);
+
+	return ret;
+}
 EXPORT_SYMBOL(drm_crtc_init_with_planes);
 
+static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
+						void *ptr)
+{
+	struct drm_crtc *crtc = ptr;
+
+	drm_crtc_cleanup(crtc);
+}
+
+void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
+				    size_t size, size_t offset,
+				    struct drm_plane *primary,
+				    struct drm_plane *cursor,
+				    const struct drm_crtc_funcs *funcs,
+				    const char *name, ...)
+{
+	void *container;
+	struct drm_crtc *crtc;
+	va_list ap;
+	int ret;
+
+	if (WARN_ON(!funcs || funcs->destroy))
+		return ERR_PTR(-EINVAL);
+
+	container = drmm_kzalloc(dev, size, GFP_KERNEL);
+	if (!container)
+		return ERR_PTR(-ENOMEM);
+
+	crtc = container + offset;
+
+	va_start(ap, name);
+	ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+					  name, ap);
+	va_end(ap);
+	if (ret)
+		return ERR_PTR(ret);
+
+	ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
+				       crtc);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return container;
+}
+EXPORT_SYMBOL(__drmm_crtc_alloc_with_planes);
+
 /**
  * drm_crtc_cleanup - Clean up the core crtc usage
  * @crtc: CRTC to cleanup
include/drm/drm_crtc.h +33 -0
index 59b51a09cae6..b71c0a3d4126 100644
@@ -1210,6 +1210,39 @@ int drm_crtc_init_with_planes(struct drm_device *dev,
 			      const char *name, ...);
 void drm_crtc_cleanup(struct drm_crtc *crtc);
 
+__printf(7, 8)
+void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
+				    size_t size, size_t offset,
+				    struct drm_plane *primary,
+				    struct drm_plane *cursor,
+				    const struct drm_crtc_funcs *funcs,
+				    const char *name, ...);
+
+/**
+ * drm_crtc_alloc_with_planes - Allocate and initialize a new CRTC object with
+ *    specified primary and cursor planes.
+ * @dev: DRM device
+ * @type: the type of the struct which contains struct &drm_crtc
+ * @member: the name of the &drm_crtc within @type.
+ * @primary: Primary plane for CRTC
+ * @cursor: Cursor plane for CRTC
+ * @funcs: callbacks for the new CRTC
+ * @name: printf style format string for the CRTC name, or NULL for default name
+ *
+ * Allocates and initializes a new crtc object. Cleanup is automatically
+ * handled through registering drmm_crtc_cleanup() with drmm_add_action().
+ *
+ * The @drm_crtc_funcs.destroy hook must be NULL.
+ *
+ * Returns:
+ * Pointer to new crtc, or ERR_PTR on failure.
+ */
+#define drmm_crtc_alloc_with_planes(dev, type, member, primary, cursor, funcs, name, ...) \
+	((type *)__drmm_crtc_alloc_with_planes(dev, sizeof(type), \
+					       offsetof(type, member), \
+					       primary, cursor, funcs, \
+					       name, ##__VA_ARGS__))
+
 /**
  * drm_crtc_index - find the index of a registered CRTC
  * @crtc: CRTC to find index for
Signature · 1 line
2.25.1
author maintainer
#6 lore raw

PATCH 6/14 drm/crtc: Introduce drmm_crtc_init_with_planes

In reply to Biju Das

From: Maxime Ripard <[email protected]>

commit 917dd05418148f05d8860b8106da8dcd1d258aaf upstream.

The DRM-managed function to register a CRTC is drmm_crtc_alloc_with_planes(), which will allocate the underlying structure and initialisation the CRTC.

However, we might want to separate the structure creation and the CRTC initialisation, for example if the structure is shared across multiple DRM entities, for example an encoder and a connector.

Let's create an helper to only initialise a CRTC that would be passed as an argument.

---
 drivers/gpu/drm/drm_crtc.c | 97 +++++++++++++++++++++++++++++++++-----
 include/drm/drm_crtc.h     |  9 ++++
 2 files changed, 94 insertions(+), 12 deletions(-)
drivers/gpu/drm/drm_crtc.c +85 -12
index 3d73f69ce044..47d7fb514d01 100644
@@ -329,9 +329,13 @@ static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *
  * the crtc structure. The crtc structure should not be allocated with
  * devm_kzalloc().
  *
- * Note: consider using drmm_crtc_alloc_with_planes() instead of
- * drm_crtc_init_with_planes() to let the DRM managed resource infrastructure
- * take care of cleanup and deallocation.
+ * The @primary and @cursor planes are only relevant for legacy uAPI, see
+ * &drm_crtc.primary and &drm_crtc.cursor.
+ *
+ * Note: consider using drmm_crtc_alloc_with_planes() or
+ * drmm_crtc_init_with_planes() instead of drm_crtc_init_with_planes()
+ * to let the DRM managed resource infrastructure take care of cleanup
+ * and deallocation.
  *
  * Returns:
  * Zero on success, error code on failure.
@@ -356,14 +360,88 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
 }
 EXPORT_SYMBOL(drm_crtc_init_with_planes);
 
-static void drmm_crtc_alloc_with_planes_cleanup(struct drm_device *dev,
-						void *ptr)
+static void drmm_crtc_init_with_planes_cleanup(struct drm_device *dev,
+					       void *ptr)
 {
 	struct drm_crtc *crtc = ptr;
 
 	drm_crtc_cleanup(crtc);
 }
 
+__printf(6, 0)
+static int __drmm_crtc_init_with_planes(struct drm_device *dev,
+					struct drm_crtc *crtc,
+					struct drm_plane *primary,
+					struct drm_plane *cursor,
+					const struct drm_crtc_funcs *funcs,
+					const char *name,
+					va_list args)
+{
+	int ret;
+
+	drm_WARN_ON(dev, funcs && funcs->destroy);
+
+	ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+					  name, args);
+	if (ret)
+		return ret;
+
+	ret = drmm_add_action_or_reset(dev, drmm_crtc_init_with_planes_cleanup,
+				       crtc);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
+/**
+ * drmm_crtc_init_with_planes - Initialise a new CRTC object with
+ *    specified primary and cursor planes.
+ * @dev: DRM device
+ * @crtc: CRTC object to init
+ * @primary: Primary plane for CRTC
+ * @cursor: Cursor plane for CRTC
+ * @funcs: callbacks for the new CRTC
+ * @name: printf style format string for the CRTC name, or NULL for default name
+ *
+ * Inits a new object created as base part of a driver crtc object. Drivers
+ * should use this function instead of drm_crtc_init(), which is only provided
+ * for backwards compatibility with drivers which do not yet support universal
+ * planes). For really simple hardware which has only 1 plane look at
+ * drm_simple_display_pipe_init() instead.
+ *
+ * Cleanup is automatically handled through registering
+ * drmm_crtc_cleanup() with drmm_add_action(). The crtc structure should
+ * be allocated with drmm_kzalloc().
+ *
+ * The @drm_crtc_funcs.destroy hook must be NULL.
+ *
+ * The @primary and @cursor planes are only relevant for legacy uAPI, see
+ * &drm_crtc.primary and &drm_crtc.cursor.
+ *
+ * Returns:
+ * Zero on success, error code on failure.
+ */
+int drmm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
+			       struct drm_plane *primary,
+			       struct drm_plane *cursor,
+			       const struct drm_crtc_funcs *funcs,
+			       const char *name, ...)
+{
+	va_list ap;
+	int ret;
+
+	va_start(ap, name);
+	ret = __drmm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+					   name, ap);
+	va_end(ap);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+EXPORT_SYMBOL(drmm_crtc_init_with_planes);
+
 void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
 				    size_t size, size_t offset,
 				    struct drm_plane *primary,
@@ -386,17 +464,12 @@ void *__drmm_crtc_alloc_with_planes(struct drm_device *dev,
 	crtc = container + offset;
 
 	va_start(ap, name);
-	ret = __drm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
-					  name, ap);
+	ret = __drmm_crtc_init_with_planes(dev, crtc, primary, cursor, funcs,
+					   name, ap);
 	va_end(ap);
 	if (ret)
 		return ERR_PTR(ret);
 
-	ret = drmm_add_action_or_reset(dev, drmm_crtc_alloc_with_planes_cleanup,
-				       crtc);
-	if (ret)
-		return ERR_PTR(ret);
-
 	return container;
 }
 EXPORT_SYMBOL(__drmm_crtc_alloc_with_planes);
include/drm/drm_crtc.h +9 -0
index b71c0a3d4126..15495cf67ac4 100644
@@ -1208,6 +1208,15 @@ int drm_crtc_init_with_planes(struct drm_device *dev,
 			      struct drm_plane *cursor,
 			      const struct drm_crtc_funcs *funcs,
 			      const char *name, ...);
+
+__printf(6, 7)
+int drmm_crtc_init_with_planes(struct drm_device *dev,
+			       struct drm_crtc *crtc,
+			       struct drm_plane *primary,
+			       struct drm_plane *cursor,
+			       const struct drm_crtc_funcs *funcs,
+			       const char *name, ...);
+
 void drm_crtc_cleanup(struct drm_crtc *crtc);
 
 __printf(7, 8)
Signature · 1 line
2.25.1
author maintainer
#7 lore raw

PATCH 7/14 dt-bindings: display: Document Renesas RZ/G2L DU bindings

In reply to Biju Das

commit c1bb7f9f1e151bb50888666108e66ad2848e030d upstream.

The RZ/G2L LCD controller is composed of Frame Compression Processor (FCPVD), Video Signal Processor (VSPD), and Display Unit (DU).

The DU module supports the following hardware features
− Display Parallel Interface (DPI) and MIPI LINK Video Interface − Display timing master
− Generates video timings
− Selecting the polarity of output DCLK, HSYNC, VSYNC, and DE − Supports Progressive
− Input data format (from VSPD): RGB888, RGB666
− Output data format: same as Input data format
− Supporting Full HD (1920 pixels x 1080 lines) for MIPI-DSI Output − Supporting WXGA (1280 pixels x 800 lines) for Parallel Output

This patch documents the DU module found on RZ/G2L LCDC.

---
 .../bindings/display/renesas,rzg2l-du.yaml    | 121 ++++++++++++++++++
 1 file changed, 121 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml new file +121 -0
new file mode 100644
index 000000000000..c0ad194c538d
@@ -0,0 +1,121 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/renesas,rzg2l-du.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/G2L Display Unit (DU)
+
+maintainers:
+  - Biju Das <[email protected]>
+  - Laurent Pinchart <[email protected]>
+
+description: |
+  These DT bindings describe the Display Unit embedded in the Renesas RZ/G2L
+  and RZ/V2L SoCs.
+
+properties:
+  compatible:
+    enum:
+      - renesas,r9a07g044-du # RZ/G2{L,LC}
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: Main clock
+      - description: Register access clock
+      - description: Video clock
+
+  clock-names:
+    items:
+      - const: aclk
+      - const: pclk
+      - const: vclk
+
+  resets:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+    description: |
+      The connections to the DU output video ports are modeled using the OF
+      graph bindings. The number of ports and their assignment are
+      model-dependent. Each port shall have a single endpoint.
+
+    patternProperties:
+      "^port@[0-1]$":
+        $ref: /schemas/graph.yaml#/properties/port
+        unevaluatedProperties: false
+
+    required:
+      - port@0
+
+    unevaluatedProperties: false
+
+  renesas,vsps:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      items:
+        - description: phandle to VSP instance that serves the DU channel
+        - description: Channel index identifying the LIF instance in that VSP
+    description:
+      A list of phandle and channel index tuples to the VSPs that handle the
+      memory interfaces for the DU channels.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - power-domains
+  - ports
+  - renesas,vsps
+
+additionalProperties: false
+
+examples:
+  # RZ/G2L DU
+  - |
+    #include <dt-bindings/clock/r9a07g044-cpg.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    display@10890000 {
+        compatible = "renesas,r9a07g044-du";
+        reg = <0x10890000 0x10000>;
+        interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpg CPG_MOD R9A07G044_LCDC_CLK_A>,
+                 <&cpg CPG_MOD R9A07G044_LCDC_CLK_P>,
+                 <&cpg CPG_MOD R9A07G044_LCDC_CLK_D>;
+        clock-names = "aclk", "pclk", "vclk";
+        resets = <&cpg R9A07G044_LCDC_RESET_N>;
+        power-domains = <&cpg>;
+
+        renesas,vsps = <&vspd0 0>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                endpoint {
+                    remote-endpoint = <&dsi0_in>;
+                };
+            };
+            port@1 {
+                reg = <1>;
+            };
+        };
+    };
+
+...
Signature · 1 line
2.25.1
#8 lore raw

Re: [PATCH 5.10.y-cip 07/14] dt-bindings: display: Document Renesas RZ/G2L DU bindings

Hi!

Quoted 5 lines

commit c1bb7f9f1e151bb50888666108e66ad2848e030d upstream.

The RZ/G2L LCD controller is composed of Frame Compression Processor (FCPVD), Video Signal Processor (VSPD), and Display Unit (DU).

Quoted 10 lines

The DU module supports the following hardware features
− Display Parallel Interface (DPI) and MIPI LINK Video Interface − Display timing master
− Generates video timings
− Selecting the polarity of output DCLK, HSYNC, VSYNC, and DE − Supports Progressive
− Input data format (from VSPD): RGB888, RGB666
− Output data format: same as Input data format
− Supporting Full HD (1920 pixels x 1080 lines) for MIPI-DSI Output − Supporting WXGA (1280 pixels x 800 lines) for Parallel Output

This is somehow interesting information, but will likely get lost in the changelogs. I'd not mind it going to comment somewhere, along with possible pointer to pdf with datasheet.

Best regards,
Pavel

Signature · 2 lines
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
author maintainer
#9 lore raw

PATCH 8/14 dt-bindings: display: renesas,rzg2l-du: Document RZ/V2L DU bindings

In reply to Biju Das

commit ac23216bb1f5caa5ae6f3ac70aa7f78a5b50f88d upstream.

Document DU found in RZ/V2L SoC. The DU block is identical to RZ/G2L SoC and therefore use RZ/G2L fallback to avoid any driver changes.

---
 .../devicetree/bindings/display/renesas,rzg2l-du.yaml    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml +7 -2
index c0ad194c538d..08e5b9478051 100644
@@ -16,8 +16,13 @@ description: |
 
 properties:
   compatible:
-    enum:
-      - renesas,r9a07g044-du # RZ/G2{L,LC}
+    oneOf:
+      - enum:
+          - renesas,r9a07g044-du # RZ/G2{L,LC}
+      - items:
+          - enum:
+              - renesas,r9a07g054-du    # RZ/V2L
+          - const: renesas,r9a07g044-du # RZ/G2L fallback
 
   reg:
     maxItems: 1
Signature · 1 line
2.25.1
author maintainer
#10 lore raw

PATCH 9/14 drm: renesas: Add RZ/G2L DU Support

In reply to Biju Das

commit 768e9e61b3b99191d8fe1aead6e71f551738b5c4 upstream.

The LCD controller is composed of Frame Compression Processor (FCPVD), Video Signal Processor (VSPD), and Display Unit (DU).

It has DPI/DSI interfaces and supports a maximum resolution of 1080p along with 2 RPFs to support the blending of two picture layers and raster operations (ROPs).

The DU module is connected to VSPD. Add RZ/G2L DU support for RZ/G2L alike SoCs.

[Biju: Squashed the commit a3baaca4a876 ("drm: renesas: rz-du: Fix redefinition

    errors related to rzg2l_du_vsp_*()" to fix the build error.
    Replaced 'depends on'->'select' VIDEO_RENESAS_VSP1 config option to avoid
    circular dependency
    Dropped selecting DRM_GEM_DMA_HELPER and instead selected DRM_KMS_CMA_HELPER and
    DRM_GEM_CMA_HELPER.
    Replaced of.h->of_device.h, drm_fbdev_generic.h->drm_fb_helper.h,
    drm/drm_gem_dma_helper.h-><drm/drm_fb_cma_helper.h> & <drm/drm_gem_cma_helper.h>,
    drm_atomic_state->drm_{plane,crtc}_state, container_of.h->kernel.h,
    DEFINE_DRM_GEM_DMA_FOPS->DEFINE_DRM_GEM_CMA_FOPS,
    .dumb_create()->DRM_GEM_CMA_DRIVER_OPS_WITH_DUMB_CREATE,
    void rzg2l_du_remove()->int rzg2l_du_remove(),
    remove_new()->remove(),
    drm_gem_dma_dumb_create_internal()->drm_gem_cma_dumb_create_internal(),
    drm_gem_dma_object->drm_gem_cma_object and
    DRM_PLANE_NO_SCALING->DRM_PLANE_HELPER_NO_SCALING
    to fix build error with 5.10.y kernel ]
---
 drivers/gpu/drm/renesas/Kconfig               |   1 +
 drivers/gpu/drm/renesas/Makefile              |   1 +
 drivers/gpu/drm/renesas/rz-du/Kconfig         |  13 +
 drivers/gpu/drm/renesas/rz-du/Makefile        |   8 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 423 ++++++++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h |  89 ++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 175 ++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  78 ++++
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  72 +++
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.h  |  32 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  | 372 +++++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h  |  43 ++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  | 344 ++++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  |  82 ++++
 14 files changed, 1733 insertions(+)
 create mode 100644 drivers/gpu/drm/renesas/rz-du/Kconfig
 create mode 100644 drivers/gpu/drm/renesas/rz-du/Makefile
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
 create mode 100644 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
drivers/gpu/drm/renesas/Kconfig +1 -0
index 3777dad17f81..21862a8ef710 100644
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 source "drivers/gpu/drm/renesas/rcar-du/Kconfig"
+source "drivers/gpu/drm/renesas/rz-du/Kconfig"
 source "drivers/gpu/drm/renesas/shmobile/Kconfig"
drivers/gpu/drm/renesas/Makefile +1 -0
index ec0e89e7a592..b8d8bc53967f 100644
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
 obj-y += rcar-du/
+obj-y += rz-du/
 obj-$(CONFIG_DRM_SHMOBILE) += shmobile/
drivers/gpu/drm/renesas/rz-du/Kconfig new file +13 -0
new file mode 100644
index 000000000000..156ff3bcc554
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0
+config DRM_RZG2L_DU
+	tristate "DRM Support for RZ/G2L Display Unit"
+	depends on ARCH_RZG2L || COMPILE_TEST
+	depends on DRM && OF
+	select VIDEO_RENESAS_VSP1
+	select DRM_KMS_HELPER
+	select DRM_KMS_CMA_HELPER
+	select DRM_GEM_CMA_HELPER
+	select VIDEOMODE_HELPERS
+	help
+	  Choose this option if you have an RZ/G2L alike chipset.
+	  If M is selected the module will be called rzg2l-du-drm.
drivers/gpu/drm/renesas/rz-du/Makefile new file +8 -0
new file mode 100644
index 000000000000..663b82a2577f
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
+rzg2l-du-drm-y := rzg2l_du_crtc.o \
+		  rzg2l_du_drv.o \
+		  rzg2l_du_encoder.o \
+		  rzg2l_du_kms.o \
+
+rzg2l-du-drm-$(CONFIG_VIDEO_RENESAS_VSP1)	+= rzg2l_du_vsp.o
+obj-$(CONFIG_DRM_RZG2L_DU)		+= rzg2l-du-drm.o
drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c new file +423 -0

423 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.h new file +89 -0

89 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c new file +175 -0

175 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h new file +78 -0

78 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c new file +72 -0

72 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h new file +32 -0
new file mode 100644
index 000000000000..a2d38288456a
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * RZ/G2L Display Unit Encoder
+ *
+ * Copyright (C) 2023 Renesas Electronics Corporation
+ *
+ * Based on rcar_du_encoder.h
+ */
+
+#ifndef __RZG2L_DU_ENCODER_H__
+#define __RZG2L_DU_ENCODER_H__
+
+#include <drm/drm_encoder.h>
+#include <linux/kernel.h>
+
+struct rzg2l_du_device;
+
+struct rzg2l_du_encoder {
+	struct drm_encoder base;
+	enum rzg2l_du_output output;
+};
+
+static inline struct rzg2l_du_encoder *to_rzg2l_encoder(struct drm_encoder *e)
+{
+	return container_of(e, struct rzg2l_du_encoder, base);
+}
+
+int rzg2l_du_encoder_init(struct rzg2l_du_device *rcdu,
+			  enum rzg2l_du_output output,
+			  struct device_node *enc_node);
+
+#endif /* __RZG2L_DU_ENCODER_H__ */
drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c new file +372 -0

372 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h new file +43 -0

43 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c new file +344 -0

344 lines not on this page · raw message

drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h new file +82 -0

82 lines not on this page · raw message

Signature · 1 line
2.25.1
#11 lore raw

Re: [PATCH 5.10.y-cip 09/14] drm: renesas: Add RZ/G2L DU Support

Hi!

Quoted 18 lines

commit 768e9e61b3b99191d8fe1aead6e71f551738b5c4 upstream.

The LCD controller is composed of Frame Compression Processor (FCPVD), Video Signal Processor (VSPD), and Display Unit (DU).

It has DPI/DSI interfaces and supports a maximum resolution of 1080p along with 2 RPFs to support the blending of two picture layers and raster operations (ROPs).

The DU module is connected to VSPD. Add RZ/G2L DU support for RZ/G2L alike SoCs.

drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c new file +5 -0
+static void rzg2l_du_crtc_reset(struct drm_crtc *crtc)
+{
+	struct rzg2l_du_crtc_state *state;
+
+	if (crtc->state) {

drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c line 345

Quoted 10 lines
drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c new file +10 -0
+		rzg2l_du_crtc_atomic_destroy_state(crtc, crtc->state);
+		crtc->state = NULL;
+	}
+
+	state = kzalloc(sizeof(*state), GFP_KERNEL);
+	if (!state)
+		return;
+
+	__drm_atomic_helper_crtc_reset(crtc, &state->state);
+}

I'd not mind some kind of error print / error handling here. They asked for reset, and nothing happened due to out-of-memory.

Quoted 5 lines
drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c new file +5 -0
+static void rzg2l_du_vsp_plane_reset(struct drm_plane *plane)
+{
+	struct rzg2l_du_vsp_plane_state *state;
+
+	if (plane->state) {

drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c line 280

Quoted 10 lines
drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c new file +10 -0
+		rzg2l_du_vsp_plane_atomic_destroy_state(plane, plane->state);
+		plane->state = NULL;
+	}
+
+	state = kzalloc(sizeof(*state), GFP_KERNEL);
+	if (!state)
+		return;
+
+	__drm_atomic_helper_plane_reset(plane, &state->state);
+}

Same here.

But these are really details and should not block merge.

Best regards,
Pavel

Signature · 2 lines
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
author maintainer
#12 lore raw

PATCH 10/14 arm64: dts: renesas: r9a07g044: Add DU node

In reply to Biju Das

commit 4b15a38590f66da7e238a919242b69a235a261ec upstream.

Add DU node to RZ/G2L SoC DTSI.

---
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)
arch/arm64/boot/dts/renesas/r9a07g044.dtsi +27 -0
index 1ec12470c171..6049e4f754fa 100644
@@ -740,6 +740,33 @@ fcpvd: fcp@10880000 {
 			resets = <&cpg R9A07G044_LCDC_RESET_N>;
 		};
 
+		du: display@10890000 {
+			compatible = "renesas,r9a07g044-du";
+			reg = <0 0x10890000 0 0x10000>;
+			interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A07G044_LCDC_CLK_A>,
+				 <&cpg CPG_MOD R9A07G044_LCDC_CLK_P>,
+				 <&cpg CPG_MOD R9A07G044_LCDC_CLK_D>;
+			clock-names = "aclk", "pclk", "vclk";
+			power-domains = <&cpg>;
+			resets = <&cpg R9A07G044_LCDC_RESET_N>;
+			renesas,vsps = <&vspd 0>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+				};
+
+				port@1 {
+					reg = <1>;
+				};
+			};
+		};
+
 		cpg: clock-controller@11010000 {
 			compatible = "renesas,r9a07g044-cpg";
 			reg = <0 0x11010000 0 0x10000>;
Signature · 1 line
2.25.1
author maintainer
#13 lore raw

PATCH 11/14 arm64: dts: renesas: r9a07g054: Add DU node

In reply to Biju Das

commit c1a046466f43e06afc438e22ffc8e72faca85bdc upstream.

Add DU node to RZ/V2L SoC DTSI.

---
 arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 28 ++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/renesas/r9a07g054.dtsi +28 -0
index ea1aba78335d..171b4032d58d 100644
@@ -746,6 +746,34 @@ fcpvd: fcp@10880000 {
 			resets = <&cpg R9A07G054_LCDC_RESET_N>;
 		};
 
+		du: display@10890000 {
+			compatible = "renesas,r9a07g054-du",
+				     "renesas,r9a07g044-du";
+			reg = <0 0x10890000 0 0x10000>;
+			interrupts = <GIC_SPI 152 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A07G054_LCDC_CLK_A>,
+				 <&cpg CPG_MOD R9A07G054_LCDC_CLK_P>,
+				 <&cpg CPG_MOD R9A07G054_LCDC_CLK_D>;
+			clock-names = "aclk", "pclk", "vclk";
+			power-domains = <&cpg>;
+			resets = <&cpg R9A07G054_LCDC_RESET_N>;
+			renesas,vsps = <&vspd 0>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+				};
+
+				port@1 {
+					reg = <1>;
+				};
+			};
+		};
+
 		cpg: clock-controller@11010000 {
 			compatible = "renesas,r9a07g054-cpg";
 			reg = <0 0x11010000 0 0x10000>;
Signature · 1 line
2.25.1
author maintainer
#14 lore raw

PATCH 12/14 Revert "arm64: dts: renesas: Drop ADV7535 IRQ"

In reply to Biju Das

This reverts commit fdfe1fbf93bc6fe6ed2708f11c2613bef556fdeb.

Now we have IRQ support available, so reverting the commit will enable the IRQ.

---
 arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi  | 2 ++
 arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi | 2 ++
 2 files changed, 4 insertions(+)
arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi +2 -0
index d705501e162b..37807f1bda4d 100644
@@ -64,6 +64,8 @@ adv7535: hdmi@3d {
 		compatible = "adi,adv7535";
 		reg = <0x3d>;
 
+		interrupt-parent = <&pinctrl>;
+		interrupts = <RZG2L_GPIO(2, 1) IRQ_TYPE_EDGE_FALLING>;
 		clocks = <&osc1>;
 		clock-names = "cec";
 		avdd-supply = <&reg_1p8v>;
arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi +2 -0
index 1412df9a5786..859bc8745e66 100644
@@ -80,6 +80,8 @@ adv7535: hdmi@3d {
 		compatible = "adi,adv7535";
 		reg = <0x3d>;
 
+		interrupt-parent = <&pinctrl>;
+		interrupts = <RZG2L_GPIO(43, 1) IRQ_TYPE_EDGE_FALLING>;
 		clocks = <&osc1>;
 		clock-names = "cec";
 		avdd-supply = <&reg_1p8v>;
Signature · 1 line
2.25.1
author maintainer
#15 lore raw

PATCH 13/14 arm64: dts: renesas: rzg2l-smarc: Enable DU and link with DSI

In reply to Biju Das

commit eaa5907bcc7611c7a07e994a69a905deca34a9b6 upstream.

Enable DU and link with DSI on RZ/{G2L,G2LC,V2L} SMARC EVK.

Move DSI port properties from board dtsi to SoC dtsi and then link with DU and after that enable DU on the board dtsi.

---
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    | 19 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/r9a07g054.dtsi    | 19 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi  | 14 ++++----------
 arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi | 14 ++++----------
 4 files changed, 46 insertions(+), 20 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g044.dtsi +19 -0
index 6049e4f754fa..f05e27a90979 100644
@@ -713,6 +713,22 @@ dsi: dsi@10850000 {
 			reset-names = "rst", "arst", "prst";
 			power-domains = <&cpg>;
 			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					dsi0_in: endpoint {
+						remote-endpoint = <&du_out_dsi>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+				};
+			};
 		};
 
 		vspd: vsp@10870000 {
@@ -759,6 +775,9 @@ ports {
 
 				port@0 {
 					reg = <0>;
+					du_out_dsi: endpoint {
+						remote-endpoint = <&dsi0_in>;
+					};
 				};
 
 				port@1 {
arch/arm64/boot/dts/renesas/r9a07g054.dtsi +19 -0
index 171b4032d58d..994cc88e6e3e 100644
@@ -718,6 +718,22 @@ dsi: dsi@10850000 {
 			reset-names = "rst", "arst", "prst";
 			power-domains = <&cpg>;
 			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					dsi0_in: endpoint {
+						remote-endpoint = <&du_out_dsi>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+				};
+			};
 		};
 
 		vspd: vsp@10870000 {
@@ -766,6 +782,9 @@ ports {
 
 				port@0 {
 					reg = <0>;
+					du_out_dsi: endpoint {
+						remote-endpoint = <&dsi0_in>;
+					};
 				};
 
 				port@1 {
arch/arm64/boot/dts/renesas/rzg2l-smarc.dtsi +4 -10
index 37807f1bda4d..887dffe14910 100644
@@ -40,17 +40,7 @@ &dsi {
 	status = "okay";
 
 	ports {
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		port@0 {
-			reg = <0>;
-			dsi0_in: endpoint {
-			};
-		};
-
 		port@1 {
-			reg = <1>;
 			dsi0_out: endpoint {
 				data-lanes = <1 2 3 4>;
 				remote-endpoint = <&adv7535_in>;
@@ -59,6 +49,10 @@ dsi0_out: endpoint {
 	};
 };
 
+&du {
+	status = "okay";
+};
+
 &i2c1 {
 	adv7535: hdmi@3d {
 		compatible = "adi,adv7535";
arch/arm64/boot/dts/renesas/rzg2lc-smarc.dtsi +4 -10
index 859bc8745e66..f21508640b6e 100644
@@ -56,17 +56,7 @@ &dsi {
 	status = "okay";
 
 	ports {
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		port@0 {
-			reg = <0>;
-			dsi0_in: endpoint {
-			};
-		};
-
 		port@1 {
-			reg = <1>;
 			dsi0_out: endpoint {
 				data-lanes = <1 2 3 4>;
 				remote-endpoint = <&adv7535_in>;
@@ -75,6 +65,10 @@ dsi0_out: endpoint {
 	};
 };
 
+&du {
+	status = "okay";
+};
+
 &i2c1 {
 	adv7535: hdmi@3d {
 		compatible = "adi,adv7535";
Signature · 1 line
2.25.1
author maintainer
#16 lore raw

PATCH 14/14 arm64: defconfig: Enable Renesas RZ/G2L display unit DRM driver

In reply to Biju Das

commit 8ea517c014ad4956ab7536277dd3f89bfad39069 upstream.

Enable the RZ/G2L display unit DRM drivers used on the RZ/{G2L,G2LC,V2L} SMARC EVK development boards.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index 25228f0a5c7b..a26ae513bb72 100644
@@ -657,6 +657,7 @@ CONFIG_ROCKCHIP_INNO_HDMI=y
 CONFIG_DRM_RCAR_DU=m
 CONFIG_DRM_RCAR_DW_HDMI=m
 CONFIG_DRM_RZG2L_MIPI_DSI=m
+CONFIG_DRM_RZG2L_DU=m
 CONFIG_DRM_SUN4I=m
 CONFIG_DRM_SUN6I_DSI=m
 CONFIG_DRM_SUN8I_DW_HDMI=m
Signature · 1 line
2.25.1
#17 lore raw
In reply to Biju Das

Hi!

Quoted 7 lines

This patch series aims to add Display support for SMARC RZ/{G2L,G2LC,V2L} EVK platforms.

All the patches are cherry-picked from the mainline.

Patch 1 mainline commit does not include some files present in 5.10 tree, so manually moved across.

Thanks for the series. I could not find anything significant in the review and it passes testing. I can apply the series if there are no other comments.

Best regards,
Pavel

Signature · 2 lines
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Reviewed-by on the v1 series
#18 lore raw
In reply to Biju Das

Hi all,

Quoted 37 lines

-----Original Message-----
From: Biju Das <[email protected]>
Sent: Friday, June 14, 2024 7:13 PM
To: [email protected]; iwamatsu nobuhiro(岩松 信洋 ○DITC□ DIT○OST) <[email protected]>; Pavel Machek <[email protected]>
Cc: Biju Das <[email protected]>; Lad Prabhakar <[email protected]>
Subject: [PATCH 5.10.y-cip 00/14] Add Display support for SMARC RZ/{G2L,G2LC,V2L}

This patch series aims to add Display support for SMARC RZ/{G2L,G2LC,V2L} EVK platforms.

All the patches are cherry-picked from the mainline.

Patch 1 mainline commit does not include some files present in 5.10 tree, so manually moved across.

Adapted header files/KConfig changes for 5.10 kernel in patch9 (0009-drm-renesas-Add-RZ-G2L-DU-Support.patch) similar to rcar_du abd shmobile drm drivers.

Biju Das (9):
drm: Place Renesas drivers in a separate dir
dt-bindings: display: Document Renesas RZ/G2L DU bindings
dt-bindings: display: renesas,rzg2l-du: Document RZ/V2L DU bindings
drm: renesas: Add RZ/G2L DU Support
arm64: dts: renesas: r9a07g044: Add DU node
arm64: dts: renesas: r9a07g054: Add DU node
Revert "arm64: dts: renesas: Drop ADV7535 IRQ"
arm64: dts: renesas: rzg2l-smarc: Enable DU and link with DSI
arm64: defconfig: Enable Renesas RZ/G2L display unit DRM driver

Daniel Vetter (1):
drm: Allow const struct drm_driver

Quoted 8 lines

Maxime Ripard (1):
drm/crtc: Introduce drmm_crtc_init_with_planes

Philipp Zabel (3):
drm: add drmm_encoder_alloc()
drm/plane: add drmm_universal_plane_alloc()
drm/crtc: add drmm_crtc_alloc_with_planes()

I reviewed this series, I don’t have any comment. I can apppy this series, if there are no other comments.

Best regards,
Nobuhiro

#19 lore raw

Hi!

Quoted 7 lines
Quoted 4 lines

This patch series aims to add Display support for SMARC RZ/{G2L,G2LC,V2L} EVK platforms.

All the patches are cherry-picked from the mainline.

I reviewed this series, I don’t have any comment. I can apppy this series, if there are no other comments.

Thanks for review, I added your reviewed-by tag and applied the series.

Best regards,
Pavel

Signature · 2 lines
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany