mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support
@ 2026-11-13 12:19 Tommaso Merciai
  2026-11-13 12:19 ` [PATCH v10 01/12] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
                   ` (11 more replies)
  0 siblings, 12 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:19 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Dear All,

This patch series adds DU/DRM support for the 2 Display Units (DUs) interface
found on the Renesas RZ/G3E SoC.

RZ/G3E SoC has 2 LCD controller (LCDC0 and LCDC1), both are composed
of Frame Compression Processor (FCPVD), Video Signal Processor (VSPD),
and Display Unit (DU).

LCDC0 is connected to LVDS (single or dual channel) and DSI.
LCDC1 is connected to LVDS (single ch), DSI, and GPIO (Parallel I/F).

RZ/G3E has two DU instances, described as separate DT nodes. To expose
them as a single DRM device (one CRTC per DU, as R-Car DU does), the
driver uses the component framework without a virtual master node.

The first available DU instance is the master and creates the DRM
device, the others bind to it as components. If only one DU instance
is available, it creates the DRM device directly at probe time, as on
single-DU SoCs, which are unaffected.

This avoids adding a virtual master node "display-subsystem" node to the DT.

Series apply on top of [1].

[1] https://lore.kernel.org/all/20261112-b4-tm-pm-du-v1-1-507474331137@bp.renesas.com/

Kind regards,
Tommaso

v9->v10:
 - Rebased on top of next-20261112 + [1].
 - Dropped the "renesas,r9a09g047-display-subsystem" virtual node and its
   bindings. The first available DU instance now acts as component master
   and creates the DRM device.
 - PATCH 01/12: Collected KKozlowski tag.
 - PATCH 03/12: Rebased on top of [1]. Kept rzg2l_du_device as platform
   drvdata.
 - PATCH 05/12: Dropped rzg2l_du_modeset_init(), call the helpers from probe.
 - PATCH 08/12, 09/12, 10/12: New patches.
 - PATCH 11/12: Dropped rzg2l_du_subsystem.c and the separate DU instance
   platform driver. Reworked commit body.
 - PATCH 12/12: Removed display-subsystem node and du*_ports labels.
 - Improved cover letter.

v8->v9:
 - Rebased on top of next-20261022
 - PATCH 1/10: Step back to v5 -> 2 du model du0 and du1. + added refusal of
   port3 for others SoCs and adjusted order and ports description.
   v5: https://lore.kernel.org/all/ca022fdbba5236c36e0cb3095db4c31e8e0cb1b8.1770996493.git.tommaso.merciai.xr@bp.renesas.com/
 - PATCH 3/10: Dropped the vsp_pipe bounds check in rzg2l_du_crtc_create() and the
   now unused num_planes field, aligning with rcar_du_crtc_create().
 - PATCH 9/10: Added newly architetture support creating an ad hoc component
   driver for RZ/G3E display subsystem that embed the 2 du instances
   into single drm device.
 - PATCH 10/10: Split du into du0 and du1 node and added newly
   display_subsystem node.
 - Improved cover letter.

v7->v8:
 - Rebased on top of next-20260827 + [1].
 - Improved cover letter.
 - Modelled using ports/port instead of port/ep.
 - PATCH 01/9: Add RZ/G3E support on top of [1] using R-Car like architecture,
   improved commit msg and commit body.
 - PATCH 08/9: Use R-Car like architecture for RZ/G3E and added
   mode_clock_min, mode_clock_max for parallel output, improved commit msg
   and commit body.

v6->v7:
 - Rebased on top of next-20260605
 - Splitted the original series into smaller chunks for easy review and easy
   merging. The original series is available here:
   http://lore.kernel.org/all/cover.1775636898.git.tommaso.merciai.xr@bp.renesas.com/
 - PATCH 01/13: Collected LPinchart tag. Removed wrong fixes tag.
 - PATCH 02/13: Rebased on top of [1]. Use single DRM device aggregating
   both DU instances (1 DU dt node), modelling single port for each DU0,
   DU1 and multiple endpoints for outputs.
 - PATCH 12/13: Removed feature flag usage, rebased on top of T2H/N2H LCDC series [1]
   Reworked commit body as now outputs routing is based on endpoint id
   instead of port number. Fixed rzg2l_du_r9a09g047_info instead of
   rzg2l_du_r9a09g047_du_info.
   Added bump of RZG2L_DU_MAX_CRTCS and RZG2L_DU_MAX_VSPS to 2.

v5->v6:
 - Rebased on top of next-20260406
 - PATCH 1: Fixed rzv2h_cpg_plldsi_smux_clk_register() removed u8 width, mask
   variables and replaced with direct use of smux.width and clk_div_mask(smux.width).
 - PATCH 9: New patch.
 - PATCH 10: Extend patternProperties from "^port@[0-1]$" to "^port@[0-3]$" and
   explicitly disable port@2 and port@3 for existing SoCs that do not expose
   them. Reworked ports numbering + improved/fixed ports descriptions in the
   bindings documentation. Improved commit body.
 - PATCH 15: Aligned ports numbering with the bindings changes.
 - PATCH 20: Update ports numbering accordingly to the latest DT bindings.

v4->v5:
 - Rebased on top of next-20260211
 - PATCH 9: Dropped renesas,id property.
 - PATCH 10: Collected tag.
 - PATCH 14: Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK
             Added features field documentation.
 - PATCH 19: Rename du0_out_dsi0 into du0_out_dsi.
             Rename du1_out_dsi0 into du1_out_dsi.
             Drop renesas,id entry from DU nodes.
 - PATCH 20: Use DU0 -> DSI instead of DU1 -> DSI.

v3->v4:
 - Rebased on top of next-20260130
 - PATCH 1: Fixed build error: https://lore.kernel.org/oe-kbuild-all/202601311423.gWtJuxiU-lkp@intel.com/

v2->v3:
 - PATCH 1: Added missing defines for duty num/den.

v1->v2:
 - Rebased on top of next-20260129.
 - PATCH 1: Added rzv2h_cpg_plldsi_smux_{get,set}_duty_cycle clock
   operations to allow the DRM driver to query and configure the
   appropriate clock path based on the required output duty cycle.
   Updated commit message accordingly.
 - PATCH 2-5: Collected tags.
 - PATCH 6: Moved clk_ids to match enum order.
 - PATCH 7: Collected GUytterhoeven tag. Fixed "dsi_0_vclk2" position
   to match order.
 - PATCH 8: Collected GUytterhoeven tag.
 - PATCH 9: Use single compatible string instead of multiple compatible
   strings for the two DU instances, leveraging a 'renesas,id' property
   to differentiate between DU0 and DU1. Updated commit message.
 - PATCH 10: Removed oneOf from clocks property, which is not sufficient
   to differentiate between RZ/G3E, RZ/V2H(P) and RZ/G2L. Use the already
   existing vclk instead of vclk1 for RZ/G3E DSI bindings. Updated allOf.
 - PATCH 14: Instead of using clk-provider API to select the right parent
   clock, just set the correct duty cycle based on the output. Updated
   commit message accordingly.
 - PATCH 15-16: Collected tags.
 - PATCH 17: Squashed fcpvd0 and fcpvd1 patches into a single patch.
   Collected tags.
 - PATCH 18: Squashed vspd0 and vspd1 patches into a single patch.
   Collected tags.
 - PATCH 19: Reworked DU nodes to use single compatible. Use vclk instead
   of vclk1 for DSI Node and set to the right position.
 - PATCH 20: Fixed: dsi, du and adv7535 are part of the R9A09G047E57
   SMARC SoM board then add entries in the rzg3e-smarc-som.dtsi instead
   of using the r9a09g047e57-smarc-du1-adv7535.dtsi.

Tommaso Merciai (12):
  dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
  drm: renesas: rz-du: vsp: Keep the planes in the VSP
  drm: renesas: rz-du: Reference the DRM device by pointer
  drm: renesas: rz-du: Count all registered encoders for the possible
    clones
  drm: renesas: rz-du: Split the mode setting initialization
  drm: renesas: rz-du: Make the CRTC index relative to the DRM device
  drm: renesas: rz-du: Share the encoder of an output driven by several
    DUs
  drm: renesas: rz-du: Separate the DU instance from the DRM device
  drm: renesas: rz-du: Move the DRM device initialization to helpers
  drm: renesas: rz-du: Support several DU instances in one DRM device
  drm: renesas: rz-du: Add RZ/G3E (R9A09G047) DU support
  arm64: dts: renesas: r9a09g047: Add DU{0,1} nodes

 .../bindings/display/renesas,rzg2l-du.yaml    |  28 +-
 arch/arm64/boot/dts/renesas/r9a09g047.dtsi    |  74 +++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c |   6 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 297 +++++++++++++++---
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  13 +-
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  23 +-
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.h  |   1 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  |  45 ++-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h  |   4 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  |  23 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  |  10 +-
 11 files changed, 415 insertions(+), 109 deletions(-)

-- 
2.54.0


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

* [PATCH v10 01/12] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
@ 2026-11-13 12:19 ` Tommaso Merciai
  2026-11-13 12:19 ` [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP Tommaso Merciai
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:19 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel, Krzysztof Kozlowski

The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression
Processor (FCPVD), a Video Signal Processor (VSPD), Video Signal
Processor (VSPD), and Display Unit (DU).

 - LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
 - LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.

Add new SoC-specific compatible string 'renesas,r9a09g047-du'.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - Collected Krzysztof's tag.

v8->v9:
 - Step back to v5 + added refusal of port3 for others SoCs.
 - Adjusted order and ports description.
   [v5] https://patchwork.kernel.org/project/linux-renesas-soc/patch/ca022fdbba5236c36e0cb3095db4c31e8e0cb1b8.1770996493.git.tommaso.merciai.xr@bp.renesas.com/

v7->v8:
 - Rebased on top of RZ/G3L du support [1]
 - Modelled using ports/port instead of port/ep.
   [1] https://lore.kernel.org/all/20260826174854.199139-1-biju.das.jz@bp.renesas.com/
 - Improved commit msg and commit body.

v6->v7:
 - Rebased on top of [1]
   [1] https://lore.kernel.org/all/20260429170012.366537-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
 - Use single DRM device aggregating both DU instances (1 DU dt node),
   modelling single port for each DU0, DU1 and multiple endpoints for
   outputs.

v5->v6:
 - Extend patternProperties from "^port@[0-1]$" to "^port@[0-3]$" and
   explicitly disable port@2 and port@3 for existing SoCs that do not expose
   them.
 - Reworked ports numbering + improved/fixed ports descriptions in the
   bindings documentation.
 - Improved commit body.

v4->v5:
 - Dropped renesas,id property and updated bindings
   accordingly.

v2->v3:
 - No changes.

v2->v3:
 - No changes.

v1->v2:
 - Use single compatible string instead of multiple compatible strings
   for the two DU instances, leveraging a 'renesas,id' property to
   differentiate between DU0 and DU1.
 - Updated commit message accordingly.

 .../bindings/display/renesas,rzg2l-du.yaml    | 28 ++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
index 5c9b15a09dee..14315b2898e1 100644
--- a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
+++ b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
@@ -21,6 +21,7 @@ properties:
           - renesas,r9a07g043u-du # RZ/G2UL
           - renesas,r9a07g044-du # RZ/G2{L,LC}
           - renesas,r9a08g046-du # RZ/G3L
+          - renesas,r9a09g047-du # RZ/G3E
           - renesas,r9a09g057-du # RZ/V2H(P)
           - renesas,r9a09g077-du # RZ/T2H
       - items:
@@ -66,7 +67,7 @@ properties:
       model-dependent. Each port shall have a single endpoint.
 
     patternProperties:
-      "^port@[0-2]$":
+      "^port@[0-3]$":
         $ref: /schemas/graph.yaml#/properties/port
         unevaluatedProperties: false
 
@@ -110,6 +111,7 @@ allOf:
               description: DPI
             port@1: false
             port@2: false
+            port@3: false
 
           required:
             - port@0
@@ -127,6 +129,7 @@ allOf:
             port@1:
               description: DPI
             port@2: false
+            port@3: false
 
           required:
             - port@0
@@ -146,11 +149,33 @@ allOf:
               description: DPI
             port@2:
               description: LVDS
+            port@3: false
 
           required:
             - port@0
             - port@1
             - port@2
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a09g047-du
+    then:
+      properties:
+        ports:
+          properties:
+            port@0:
+              description: DSI
+            port@1:
+              description: DPAD
+            port@2:
+              description: LVDS 0
+            port@3:
+              description: LVDS 1
+
+          required:
+            - port@0
+            - port@3
   - if:
       properties:
         compatible:
@@ -164,6 +189,7 @@ allOf:
               description: DSI
             port@1: false
             port@2: false
+            port@3: false
 
           required:
             - port@0
-- 
2.54.0


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

* [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
  2026-11-13 12:19 ` [PATCH v10 01/12] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
@ 2026-11-13 12:19 ` Tommaso Merciai
  2026-11-18 14:09   ` Biju Das
  2026-11-13 12:19 ` [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer Tommaso Merciai
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:19 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Each VSP numbers its planes from zero, so the device-wide search in
rzg2l_du_vsp_get_drm_plane() picks the wrong plane as soon as a SoC has
more than one VSP: the primary plane of the second CRTC is looked up on
the first VSP, whose possible_crtcs mask does not cover that CRTC.

In preparation for supporting RZ/G3E, store the planes in the VSP that
owns them and index the per-VSP array directly from
rzg2l_du_crtc_create(), as the R-Car DU driver does, and drop the now
unused search helper.

No functional change intended.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - No changes.

v8->v9:
 - Dropped the vsp_pipe bounds check in rzg2l_du_crtc_create() and the
   now unused num_planes field, aligning with rcar_du_crtc_create().
 - Updated commit message accordingly.

v7->v8:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c |  4 +---
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  | 19 ++-----------------
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  | 10 +++-------
 3 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
index ab2f24cc7683..c57884ab5b9b 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
@@ -409,9 +409,7 @@ int rzg2l_du_crtc_create(struct rzg2l_du_device *rcdu)
 	init_waitqueue_head(&rcrtc->flip_wait);
 	rcrtc->dev = rcdu;
 
-	primary = rzg2l_du_vsp_get_drm_plane(rcrtc, rcrtc->vsp_pipe);
-	if (IS_ERR(primary))
-		return PTR_ERR(primary);
+	primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe]->plane;
 
 	ret = drmm_crtc_init_with_planes(&rcdu->ddev, crtc, primary, NULL,
 					 &crtc_funcs_rz, NULL);
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
index 944bc9ac9589..12fe35740c62 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
@@ -71,22 +71,6 @@ void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc)
 	vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg);
 }
 
-struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
-					     unsigned int pipe_index)
-{
-	struct rzg2l_du_device *rcdu = crtc->vsp->dev;
-	struct drm_plane *plane = NULL;
-
-	drm_for_each_plane(plane, &rcdu->ddev) {
-		struct rzg2l_du_vsp_plane *vsp_plane = to_rzg2l_vsp_plane(plane);
-
-		if (vsp_plane->index == pipe_index)
-			break;
-	}
-
-	return plane ? plane : ERR_PTR(-EINVAL);
-}
-
 static const u32 rzg2l_du_vsp_formats[] = {
 	DRM_FORMAT_RGB332,
 	DRM_FORMAT_ARGB4444,
@@ -303,7 +287,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
 	struct rzg2l_du_device *rcdu = vsp->dev;
 	struct platform_device *pdev;
 	unsigned int num_crtcs = hweight32(crtcs);
-	unsigned int num_planes = 2;
+	unsigned int num_planes = RZG2L_DU_VSP_MAX_PLANES;
 	unsigned int i;
 	int ret;
 
@@ -350,6 +334,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
 
 		plane->vsp = vsp;
 		plane->index = i;
+		vsp->planes[i] = plane;
 
 		drm_plane_helper_add(&plane->plane,
 				     &rzg2l_du_vsp_plane_helper_funcs);
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
index a22aaf0843ed..acb41d343297 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
@@ -27,11 +27,14 @@ struct rzg2l_du_vsp_plane {
 	unsigned int index;
 };
 
+#define RZG2L_DU_VSP_MAX_PLANES		2
+
 struct rzg2l_du_vsp {
 	unsigned int index;
 	struct device *vsp;
 	struct device_link *link;
 	struct rzg2l_du_device *dev;
+	struct rzg2l_du_vsp_plane *planes[RZG2L_DU_VSP_MAX_PLANES];
 };
 
 static inline struct rzg2l_du_vsp_plane *to_rzg2l_vsp_plane(struct drm_plane *p)
@@ -62,8 +65,6 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
 void rzg2l_du_vsp_enable(struct rzg2l_du_crtc *crtc);
 void rzg2l_du_vsp_disable(struct rzg2l_du_crtc *crtc);
 void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc);
-struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
-					     unsigned int pipe_index);
 #else
 static inline int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
 				    unsigned int crtcs)
@@ -74,11 +75,6 @@ static inline int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node
 static inline void rzg2l_du_vsp_enable(struct rzg2l_du_crtc *crtc) { };
 static inline void rzg2l_du_vsp_disable(struct rzg2l_du_crtc *crtc) { };
 static inline void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc) { };
-static inline struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
-							   unsigned int pipe_index)
-{
-	return ERR_PTR(-ENXIO);
-}
 #endif
 
 #endif /* __RZG2L_DU_VSP_H__ */
-- 
2.54.0


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

* [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
  2026-11-13 12:19 ` [PATCH v10 01/12] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
  2026-11-13 12:19 ` [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP Tommaso Merciai
@ 2026-11-13 12:19 ` Tommaso Merciai
  2026-11-23 15:55   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones Tommaso Merciai
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:19 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

struct rzg2l_du_device embeds the DRM device, which makes a DU instance
and the DRM device one and the same. RZ/G3E has two instances that have
to share a single DRM device.

In preparation of supporting it, reference the DRM device by pointer and
give it a container of its own. The instance is allocated with the DRM
device rather than with the platform device, as the CRTC and VSP cleanup
handlers point into it and run once the DRM device is released.

No functional change intended.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - Rebased on top of [1], converted the PM ops too.
 - Kept rzg2l_du_device as platform drvdata, use rcdu->ddev.

v9->v10:
 - No changes just rebased.

v8->v9:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c |  2 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 39 ++++++++++++-------
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  7 +---
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  8 ++--
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.h  |  1 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  |  2 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  |  4 +-
 7 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
index c57884ab5b9b..398532933013 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
@@ -411,7 +411,7 @@ int rzg2l_du_crtc_create(struct rzg2l_du_device *rcdu)
 
 	primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe]->plane;
 
-	ret = drmm_crtc_init_with_planes(&rcdu->ddev, crtc, primary, NULL,
+	ret = drmm_crtc_init_with_planes(rcdu->ddev, crtc, primary, NULL,
 					 &crtc_funcs_rz, NULL);
 	if (ret < 0)
 		return ret;
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index c7d71dd9198e..57197356143f 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -17,6 +17,7 @@
 #include <drm/drm_drv.h>
 #include <drm/drm_fbdev_dma.h>
 #include <drm/drm_gem_dma_helper.h>
+#include <drm/drm_managed.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
@@ -148,14 +149,14 @@ static int rzg2l_du_pm_suspend(struct device *dev)
 {
 	struct rzg2l_du_device *rcdu = dev_get_drvdata(dev);
 
-	return drm_mode_config_helper_suspend(&rcdu->ddev);
+	return drm_mode_config_helper_suspend(rcdu->ddev);
 }
 
 static int rzg2l_du_pm_resume(struct device *dev)
 {
 	struct rzg2l_du_device *rcdu = dev_get_drvdata(dev);
 
-	return drm_mode_config_helper_resume(&rcdu->ddev);
+	return drm_mode_config_helper_resume(rcdu->ddev);
 }
 
 static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
@@ -165,10 +166,14 @@ static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
  * Platform driver
  */
 
+struct rzg2l_du_drm {
+	struct drm_device ddev;
+};
+
 static void rzg2l_du_remove(struct platform_device *pdev)
 {
 	struct rzg2l_du_device *rcdu = platform_get_drvdata(pdev);
-	struct drm_device *ddev = &rcdu->ddev;
+	struct drm_device *ddev = rcdu->ddev;
 
 	drm_dev_unregister(ddev);
 	drm_atomic_helper_shutdown(ddev);
@@ -180,28 +185,34 @@ static void rzg2l_du_shutdown(struct platform_device *pdev)
 {
 	struct rzg2l_du_device *rcdu = platform_get_drvdata(pdev);
 
-	drm_atomic_helper_shutdown(&rcdu->ddev);
+	drm_atomic_helper_shutdown(rcdu->ddev);
 }
 
 static int rzg2l_du_probe(struct platform_device *pdev)
 {
 	struct rzg2l_du_device *rcdu;
+	struct rzg2l_du_drm *rzgdrm;
 	int ret;
 
 	if (drm_firmware_drivers_only())
 		return -ENODEV;
 
 	/* Allocate and initialize the RZ/G2L device structure. */
-	rcdu = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
-				  struct rzg2l_du_device, ddev);
-	if (IS_ERR(rcdu))
-		return PTR_ERR(rcdu);
+	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
+				    struct rzg2l_du_drm, ddev);
+	if (IS_ERR(rzgdrm))
+		return PTR_ERR(rzgdrm);
 
-	rcdu->dev = &pdev->dev;
-	rcdu->info = of_device_get_match_data(rcdu->dev);
+	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
+	if (!rcdu)
+		return -ENOMEM;
 
 	platform_set_drvdata(pdev, rcdu);
 
+	rcdu->dev = &pdev->dev;
+	rcdu->info = of_device_get_match_data(rcdu->dev);
+	rcdu->ddev = &rzgdrm->ddev;
+
 	/* I/O resources */
 	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(rcdu->mmio))
@@ -228,18 +239,18 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 	 * Register the DRM device with the core and the connectors with
 	 * sysfs.
 	 */
-	ret = drm_dev_register(&rcdu->ddev, 0);
+	ret = drm_dev_register(&rzgdrm->ddev, 0);
 	if (ret)
 		goto error;
 
-	drm_info(&rcdu->ddev, "Device %s probed\n", dev_name(&pdev->dev));
+	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
 
-	drm_client_setup(&rcdu->ddev, NULL);
+	drm_client_setup(&rzgdrm->ddev, NULL);
 
 	return 0;
 
 error:
-	drm_kms_helper_poll_fini(&rcdu->ddev);
+	drm_kms_helper_poll_fini(&rzgdrm->ddev);
 	return ret;
 }
 
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
index e9626ef37cde..47ceaf892339 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
@@ -69,7 +69,7 @@ struct rzg2l_du_device {
 
 	void __iomem *mmio;
 
-	struct drm_device ddev;
+	struct drm_device *ddev;
 
 	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
 	unsigned int num_crtcs;
@@ -77,11 +77,6 @@ struct rzg2l_du_device {
 	struct rzg2l_du_vsp vsps[RZG2L_DU_MAX_VSPS];
 };
 
-static inline struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev)
-{
-	return container_of(dev, struct rzg2l_du_device, ddev);
-}
-
 static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
 				unsigned int feature)
 {
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
index a1b48973aa8e..5c21c5f9fbaf 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
@@ -52,8 +52,7 @@ rzg2l_du_encoder_mode_valid(struct drm_encoder *encoder,
 			    const struct drm_display_mode *mode)
 {
 	struct rzg2l_du_encoder *renc = to_rzg2l_encoder(encoder);
-	struct rzg2l_du_device *rcdu = to_rzg2l_du_device(renc->base.dev);
-	const struct rzg2l_du_device_info *info = rcdu->info;
+	const struct rzg2l_du_device_info *info = renc->dev->info;
 
 	if (renc->output != RZG2L_DU_OUTPUT_DPAD0)
 		return MODE_OK;
@@ -133,12 +132,13 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device  *rcdu,
 	dev_dbg(rcdu->dev, "initializing encoder %pOF for output %s\n",
 		enc_node, rzg2l_du_output_name(output));
 
-	renc = drmm_encoder_alloc(&rcdu->ddev, struct rzg2l_du_encoder, base,
+	renc = drmm_encoder_alloc(rcdu->ddev, struct rzg2l_du_encoder, base,
 				  &rzg2l_du_encoder_funcs, DRM_MODE_ENCODER_NONE,
 				  NULL);
 	if (IS_ERR(renc))
 		return PTR_ERR(renc);
 
+	renc->dev = rcdu;
 	renc->output = output;
 	drm_encoder_helper_add(&renc->base, &rzg2l_du_encoder_helper_funcs);
 
@@ -153,7 +153,7 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device  *rcdu,
 	}
 
 	/* Create the connector for the chain of bridges. */
-	connector = drm_bridge_connector_init(&rcdu->ddev, &renc->base);
+	connector = drm_bridge_connector_init(rcdu->ddev, &renc->base);
 	if (IS_ERR(connector)) {
 		dev_err(rcdu->dev,
 			"failed to created connector for output %s (%ld)\n",
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
index 3e430c1f6132..dfffcc14e0a3 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
@@ -17,6 +17,7 @@ struct rzg2l_du_device;
 
 struct rzg2l_du_encoder {
 	struct drm_encoder base;
+	struct rzg2l_du_device *dev;
 	enum rzg2l_du_output output;
 };
 
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
index 87f171145a23..13d14ecacba9 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
@@ -402,7 +402,7 @@ static int rzg2l_du_vsps_init(struct rzg2l_du_device *rcdu)
 
 int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
 {
-	struct drm_device *dev = &rcdu->ddev;
+	struct drm_device *dev = rcdu->ddev;
 	struct drm_encoder *encoder;
 	unsigned int num_encoders;
 	int ret;
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
index 12fe35740c62..4df4f0ff0ed5 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
@@ -298,7 +298,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
 
 	vsp->vsp = &pdev->dev;
 
-	ret = drmm_add_action_or_reset(&rcdu->ddev, rzg2l_du_vsp_cleanup, vsp);
+	ret = drmm_add_action_or_reset(rcdu->ddev, rzg2l_du_vsp_cleanup, vsp);
 	if (ret < 0)
 		return ret;
 
@@ -324,7 +324,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
 					 : DRM_PLANE_TYPE_OVERLAY;
 		struct rzg2l_du_vsp_plane *plane;
 
-		plane = drmm_universal_plane_alloc(&rcdu->ddev, struct rzg2l_du_vsp_plane,
+		plane = drmm_universal_plane_alloc(rcdu->ddev, struct rzg2l_du_vsp_plane,
 						   plane, crtcs, &rzg2l_du_vsp_plane_funcs,
 						   rzg2l_du_vsp_formats,
 						   ARRAY_SIZE(rzg2l_du_vsp_formats),
-- 
2.54.0


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

* [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (2 preceding siblings ...)
  2026-11-13 12:19 ` [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-23 16:16   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization Tommaso Merciai
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

rzg2l_du_modeset_init() sets the possible clones of every encoder
registered with the DRM device, but builds the mask from the number of
outputs that rzg2l_du_encoders_init() initialized successfully. An
output whose bridge fails to attach after its encoder has been allocated
is skipped and not counted, while its encoder stays registered. The
mask then misses the bit of the last encoders, and
drm_mode_config_validate() warns about bogus possible clones.

Build the mask from the number of registered encoders instead.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - No changes.

v8->v9:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
index 13d14ecacba9..6eb1865f43b4 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
@@ -455,7 +455,7 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
 		return -EINVAL;
 	}
 
-	num_encoders = ret;
+	num_encoders = dev->mode_config.num_encoder;
 
 	/*
 	 * Set the possible CRTCs and possible clones. There's always at least
-- 
2.54.0


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

* [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (3 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-23 16:31   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device Tommaso Merciai
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

rzg2l_du_modeset_init() initializes the mode configuration of the DRM
device and creates the KMS objects of the DU instance. On RZ/G3E two
instances share a DRM device, so the mode configuration is initialized
once while each instance creates its own KMS objects.

In preparation for supporting RZ/G3E SoC, split them into
rzg2l_du_modeset_init_drm(), rzg2l_du_modeset_init_du() and
rzg2l_du_modeset_init_finish(), the latter completing the DRM device
once all instances have created their KMS objects, and call them from
the probe function.
As it is no longer tied to an instance, take from the DRM device and
the encoders what used to be taken from the instance.

No functional change intended.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - Dropped rzg2l_du_modeset_init(), call the helpers from probe.
 - Updated commit body accordingly.

v8->v9:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 32 ++++++++++------
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 39 +++++++++++++-------
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h |  4 +-
 3 files changed, 49 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index 57197356143f..d3cccbdf9012 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -223,17 +223,17 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 		return ret;
 
 	/* DRM/KMS objects */
-	ret = rzg2l_du_modeset_init(rcdu);
-	if (ret < 0) {
-		/*
-		 * Don't use dev_err_probe(), as it would overwrite the probe
-		 * deferral reason recorded in rzg2l_du_modeset_init().
-		 */
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev,
-				"failed to initialize DRM/KMS (%d)\n", ret);
+	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
+	if (ret < 0)
 		goto error;
-	}
+
+	ret = rzg2l_du_modeset_init_du(rcdu);
+	if (ret < 0)
+		goto error;
+
+	ret = rzg2l_du_modeset_init_finish(&rzgdrm->ddev);
+	if (ret < 0)
+		goto error_fini;
 
 	/*
 	 * Register the DRM device with the core and the connectors with
@@ -241,7 +241,7 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 	 */
 	ret = drm_dev_register(&rzgdrm->ddev, 0);
 	if (ret)
-		goto error;
+		goto error_fini;
 
 	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
 
@@ -249,8 +249,16 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 
 	return 0;
 
-error:
+error_fini:
 	drm_kms_helper_poll_fini(&rzgdrm->ddev);
+error:
+	/*
+	 * Don't use dev_err_probe(), as it would overwrite the probe deferral
+	 * reason recorded while initializing the DRM/KMS objects.
+	 */
+	if (ret != -EPROBE_DEFER)
+		dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
+
 	return ret;
 }
 
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
index 6eb1865f43b4..73cb3199f90f 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
@@ -400,11 +400,8 @@ static int rzg2l_du_vsps_init(struct rzg2l_du_device *rcdu)
 	return ret;
 }
 
-int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
+int rzg2l_du_modeset_init_drm(struct drm_device *dev)
 {
-	struct drm_device *dev = rcdu->ddev;
-	struct drm_encoder *encoder;
-	unsigned int num_encoders;
 	int ret;
 
 	ret = drmm_mode_config_init(dev);
@@ -424,15 +421,14 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
 	dev->mode_config.max_width = 1920;
 	dev->mode_config.max_height = 1920;
 
-	rcdu->num_crtcs = hweight8(rcdu->info->channels_mask);
+	return 0;
+}
 
-	/*
-	 * Initialize vertical blanking interrupts handling. Start with vblank
-	 * disabled for all CRTCs.
-	 */
-	ret = drm_vblank_init(dev, rcdu->num_crtcs);
-	if (ret < 0)
-		return ret;
+int rzg2l_du_modeset_init_du(struct rzg2l_du_device *rcdu)
+{
+	int ret;
+
+	rcdu->num_crtcs = hweight8(rcdu->info->channels_mask);
 
 	/* Initialize the compositors. */
 	ret = rzg2l_du_vsps_init(rcdu);
@@ -455,6 +451,23 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
 		return -EINVAL;
 	}
 
+	return 0;
+}
+
+int rzg2l_du_modeset_init_finish(struct drm_device *dev)
+{
+	struct drm_encoder *encoder;
+	unsigned int num_encoders;
+	int ret;
+
+	/*
+	 * Initialize vertical blanking interrupts handling. Start with vblank
+	 * disabled for all CRTCs.
+	 */
+	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
+	if (ret < 0)
+		return ret;
+
 	num_encoders = dev->mode_config.num_encoder;
 
 	/*
@@ -465,7 +478,7 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
 	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
 		struct rzg2l_du_encoder *renc = to_rzg2l_encoder(encoder);
 		const struct rzg2l_du_output_routing *route =
-			&rcdu->info->routes[renc->output];
+			&renc->dev->info->routes[renc->output];
 
 		encoder->possible_crtcs = route->possible_outputs;
 		encoder->possible_clones = (1 << num_encoders) - 1;
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
index e2c599f115c6..98627a6de4c4 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
@@ -29,7 +29,9 @@ struct rzg2l_du_format_info {
 
 const struct rzg2l_du_format_info *rzg2l_du_format_info(u32 fourcc);
 
-int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu);
+int rzg2l_du_modeset_init_drm(struct drm_device *dev);
+int rzg2l_du_modeset_init_du(struct rzg2l_du_device *rcdu);
+int rzg2l_du_modeset_init_finish(struct drm_device *dev);
 
 int rzg2l_du_dumb_create(struct drm_file *file, struct drm_device *dev,
 			 struct drm_mode_create_dumb *args);
-- 
2.54.0


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

* [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (4 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-23 16:37   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs Tommaso Merciai
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

The possible_crtcs masks of planes and encoders hold CRTC indices within
the DRM device, but rzg2l_du_vsps_init() and
rzg2l_du_modeset_init_finish() build them from the index of the CRTC
within the DU instance. The two only match while an instance owns the
whole DRM device.

In preparation for supporting RZ/G3E, where two instances share one,
record in each instance the index of its first CRTC and offset the masks
by it. The index is zero for instances that own their DRM device, so
their masks are unchanged.

No functional change intended.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - No changes.

v8->v9:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 1 +
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
index 47ceaf892339..2952c9d7348b 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
@@ -70,6 +70,7 @@ struct rzg2l_du_device {
 	void __iomem *mmio;
 
 	struct drm_device *ddev;
+	unsigned int index;
 
 	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
 	unsigned int num_crtcs;
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
index 73cb3199f90f..456b29538db9 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
@@ -367,7 +367,7 @@ static int rzg2l_du_vsps_init(struct rzg2l_du_device *rcdu)
 		else
 			vsps[vsps_count++].np = args.np;
 
-		vsps[j].crtcs_mask |= BIT(i);
+		vsps[j].crtcs_mask |= BIT(rcdu->index + i);
 
 		/*
 		 * Store the VSP pointer and pipe index in the CRTC. If the
@@ -480,7 +480,7 @@ int rzg2l_du_modeset_init_finish(struct drm_device *dev)
 		const struct rzg2l_du_output_routing *route =
 			&renc->dev->info->routes[renc->output];
 
-		encoder->possible_crtcs = route->possible_outputs;
+		encoder->possible_crtcs = route->possible_outputs << renc->dev->index;
 		encoder->possible_clones = (1 << num_encoders) - 1;
 	}
 
-- 
2.54.0


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

* [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (5 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-23 16:44   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device Tommaso Merciai
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

On a SoC with several DU instances an output can be reachable from more
than one of them, but a drm_bridge can only be attached to one encoder.

In preparation for supporting RZ/G3E, where the DSI and the LVDS channel
1 are reachable from both instances, let the first instance create the
encoder and the others add their CRTC to its possible_crtcs mask, which
rzg2l_du_modeset_init_finish() then extends rather than overwrites.

Without this the second drm_bridge_attach() fails with -EBUSY, leaving
behind the encoder allocated just before it.

SoCs with a single instance are unaffected, as no encoder is ever
already attached.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - No changes.

v8->v9:
 - New patch

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c | 12 ++++++++++++
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c     |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
index 5c21c5f9fbaf..45f980ea3c20 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
@@ -129,6 +129,18 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device  *rcdu,
 			return -EPROBE_DEFER;
 	}
 
+	/*
+	 * A bridge can only be attached to one encoder. If another DU instance
+	 * has already attached it, add this instance's CRTC to that encoder.
+	 */
+	if (bridge->dev == rcdu->ddev && bridge->encoder) {
+		const struct rzg2l_du_output_routing *route =
+			&rcdu->info->routes[output];
+
+		bridge->encoder->possible_crtcs |= route->possible_outputs << rcdu->index;
+		return 0;
+	}
+
 	dev_dbg(rcdu->dev, "initializing encoder %pOF for output %s\n",
 		enc_node, rzg2l_du_output_name(output));
 
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
index 456b29538db9..001c802539e7 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
@@ -480,7 +480,7 @@ int rzg2l_du_modeset_init_finish(struct drm_device *dev)
 		const struct rzg2l_du_output_routing *route =
 			&renc->dev->info->routes[renc->output];
 
-		encoder->possible_crtcs = route->possible_outputs << renc->dev->index;
+		encoder->possible_crtcs |= route->possible_outputs << renc->dev->index;
 		encoder->possible_clones = (1 << num_encoders) - 1;
 	}
 
-- 
2.54.0


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

* [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (6 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-23 16:59   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 09/12] drm: renesas: rz-du: Move the DRM device initialization to helpers Tommaso Merciai
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

On RZ/G3E two DU instances share a DRM device, which can only be
created once both instances have been probed.

Split the DU device structure: keep the match data and the registers in
a structure allocated with the platform device, and allocate the KMS
objects with the DRM device in a new rzg2l_du_instance_init() helper,
as they are released with it.

No functional change intended.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 61 ++++++++++++++------
 1 file changed, 44 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index d3cccbdf9012..d102876c07e1 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -162,6 +162,27 @@ static int rzg2l_du_pm_resume(struct device *dev)
 static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
 				rzg2l_du_pm_suspend, rzg2l_du_pm_resume);
 
+/* -----------------------------------------------------------------------------
+ * DU instance
+ */
+
+static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
+				  struct drm_device *ddev)
+{
+	struct rzg2l_du_device *rcdu;
+
+	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
+	if (!rcdu)
+		return -ENOMEM;
+
+	rcdu->dev = du->dev;
+	rcdu->info = du->info;
+	rcdu->mmio = du->mmio;
+	rcdu->ddev = ddev;
+
+	return rzg2l_du_modeset_init_du(rcdu);
+}
+
 /* -----------------------------------------------------------------------------
  * Platform driver
  */
@@ -190,44 +211,48 @@ static void rzg2l_du_shutdown(struct platform_device *pdev)
 
 static int rzg2l_du_probe(struct platform_device *pdev)
 {
+	const struct rzg2l_du_device_info *info;
 	struct rzg2l_du_device *rcdu;
 	struct rzg2l_du_drm *rzgdrm;
+	void __iomem *mmio;
 	int ret;
 
 	if (drm_firmware_drivers_only())
 		return -ENODEV;
 
-	/* Allocate and initialize the RZ/G2L device structure. */
-	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
-				    struct rzg2l_du_drm, ddev);
-	if (IS_ERR(rzgdrm))
-		return PTR_ERR(rzgdrm);
+	info = of_device_get_match_data(&pdev->dev);
+
+	/* I/O resources */
+	mmio = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(mmio))
+		return PTR_ERR(mmio);
+
+	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+	if (ret)
+		return ret;
 
-	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
+	/* Allocate and initialize the RZ/G2L device structure. */
+	rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL);
 	if (!rcdu)
 		return -ENOMEM;
 
 	platform_set_drvdata(pdev, rcdu);
 
 	rcdu->dev = &pdev->dev;
-	rcdu->info = of_device_get_match_data(rcdu->dev);
-	rcdu->ddev = &rzgdrm->ddev;
-
-	/* I/O resources */
-	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(rcdu->mmio))
-		return PTR_ERR(rcdu->mmio);
+	rcdu->info = info;
+	rcdu->mmio = mmio;
 
-	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
-	if (ret)
-		return ret;
+	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
+				    struct rzg2l_du_drm, ddev);
+	if (IS_ERR(rzgdrm))
+		return PTR_ERR(rzgdrm);
 
 	/* DRM/KMS objects */
 	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
 	if (ret < 0)
 		goto error;
 
-	ret = rzg2l_du_modeset_init_du(rcdu);
+	ret = rzg2l_du_instance_init(rcdu, &rzgdrm->ddev);
 	if (ret < 0)
 		goto error;
 
@@ -243,6 +268,8 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 	if (ret)
 		goto error_fini;
 
+	rcdu->ddev = &rzgdrm->ddev;
+
 	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
 
 	drm_client_setup(&rzgdrm->ddev, NULL);
-- 
2.54.0


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

* [PATCH v10 09/12] drm: renesas: rz-du: Move the DRM device initialization to helpers
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (7 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-13 12:20 ` [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device Tommaso Merciai
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

On RZ/G3E the DRM device can be created and destroyed by the component
master bind/unbind. In preparation for it, move its initialization and
teardown from rzg2l_du_probe()/rzg2l_du_remove() to
rzg2l_du_drm_init()/rzg2l_du_drm_fini() helpers.

No functional change intended.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 120 +++++++++++--------
 1 file changed, 69 insertions(+), 51 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index d102876c07e1..93d59e2cf8a4 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -184,24 +184,87 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
 }
 
 /* -----------------------------------------------------------------------------
- * Platform driver
+ * DRM device
  */
 
 struct rzg2l_du_drm {
 	struct drm_device ddev;
 };
 
-static void rzg2l_du_remove(struct platform_device *pdev)
+static int rzg2l_du_drm_init(struct device *dev)
 {
-	struct rzg2l_du_device *rcdu = platform_get_drvdata(pdev);
-	struct drm_device *ddev = rcdu->ddev;
+	struct rzg2l_du_device *du = dev_get_drvdata(dev);
+	struct rzg2l_du_drm *rzgdrm;
+	struct drm_device *ddev;
+	int ret;
+
+	rzgdrm = devm_drm_dev_alloc(dev, &rzg2l_du_driver,
+				    struct rzg2l_du_drm, ddev);
+	if (IS_ERR(rzgdrm))
+		return PTR_ERR(rzgdrm);
+
+	ddev = &rzgdrm->ddev;
+
+	ret = rzg2l_du_modeset_init_drm(ddev);
+	if (ret < 0)
+		goto error;
+
+	ret = rzg2l_du_instance_init(du, ddev);
+	if (ret < 0)
+		goto error;
+
+	ret = rzg2l_du_modeset_init_finish(ddev);
+	if (ret < 0)
+		goto error_fini;
+
+	/*
+	 * Register the DRM device with the core and the connectors with
+	 * sysfs.
+	 */
+	ret = drm_dev_register(ddev, 0);
+	if (ret)
+		goto error_fini;
+
+	du->ddev = ddev;
+
+	drm_info(ddev, "Device %s probed\n", dev_name(dev));
+
+	drm_client_setup(ddev, NULL);
+
+	return 0;
+
+error_fini:
+	drm_kms_helper_poll_fini(ddev);
+error:
+	/*
+	 * Don't use dev_err_probe(), as it would overwrite the probe deferral
+	 * reason recorded while initializing the DRM/KMS objects.
+	 */
+	if (ret != -EPROBE_DEFER)
+		dev_err(dev, "failed to initialize DRM/KMS (%d)\n", ret);
+
+	return ret;
+}
+
+static void rzg2l_du_drm_fini(struct device *dev)
+{
+	struct rzg2l_du_device *du = dev_get_drvdata(dev);
+	struct drm_device *ddev = du->ddev;
 
 	drm_dev_unregister(ddev);
 	drm_atomic_helper_shutdown(ddev);
-
 	drm_kms_helper_poll_fini(ddev);
 }
 
+/* -----------------------------------------------------------------------------
+ * Platform driver
+ */
+
+static void rzg2l_du_remove(struct platform_device *pdev)
+{
+	rzg2l_du_drm_fini(&pdev->dev);
+}
+
 static void rzg2l_du_shutdown(struct platform_device *pdev)
 {
 	struct rzg2l_du_device *rcdu = platform_get_drvdata(pdev);
@@ -213,7 +276,6 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 {
 	const struct rzg2l_du_device_info *info;
 	struct rzg2l_du_device *rcdu;
-	struct rzg2l_du_drm *rzgdrm;
 	void __iomem *mmio;
 	int ret;
 
@@ -242,51 +304,7 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 	rcdu->info = info;
 	rcdu->mmio = mmio;
 
-	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
-				    struct rzg2l_du_drm, ddev);
-	if (IS_ERR(rzgdrm))
-		return PTR_ERR(rzgdrm);
-
-	/* DRM/KMS objects */
-	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
-	if (ret < 0)
-		goto error;
-
-	ret = rzg2l_du_instance_init(rcdu, &rzgdrm->ddev);
-	if (ret < 0)
-		goto error;
-
-	ret = rzg2l_du_modeset_init_finish(&rzgdrm->ddev);
-	if (ret < 0)
-		goto error_fini;
-
-	/*
-	 * Register the DRM device with the core and the connectors with
-	 * sysfs.
-	 */
-	ret = drm_dev_register(&rzgdrm->ddev, 0);
-	if (ret)
-		goto error_fini;
-
-	rcdu->ddev = &rzgdrm->ddev;
-
-	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
-
-	drm_client_setup(&rzgdrm->ddev, NULL);
-
-	return 0;
-
-error_fini:
-	drm_kms_helper_poll_fini(&rzgdrm->ddev);
-error:
-	/*
-	 * Don't use dev_err_probe(), as it would overwrite the probe deferral
-	 * reason recorded while initializing the DRM/KMS objects.
-	 */
-	if (ret != -EPROBE_DEFER)
-		dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
-
-	return ret;
+	return rzg2l_du_drm_init(&pdev->dev);
 }
 
 static struct platform_driver rzg2l_du_platform_driver = {
-- 
2.54.0


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

* [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (8 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 09/12] drm: renesas: rz-du: Move the DRM device initialization to helpers Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-24  7:47   ` Biju Das
  2026-11-13 12:20 ` [PATCH v10 11/12] drm: renesas: rz-du: Add RZ/G3E (R9A09G047) DU support Tommaso Merciai
  2026-11-13 12:20 ` [PATCH v10 12/12] arm64: dts: renesas: r9a09g047: Add DU{0,1} nodes Tommaso Merciai
  11 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

RZ/G3E has two DU instances that share a single DRM device.

Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component framework
for it. The first available DU instance is the master and creates the
DRM device, the other one binds to it as a component.

If only one DU instance is available, it creates the DRM device directly
at probe time, as on SoCs without the flag.

Set the index of each instance to the number of CRTCs already created.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - New patch.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
 2 files changed, 115 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index 93d59e2cf8a4..873586f2ef28 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -7,6 +7,7 @@
  * Based on rcar_du_drv.c
  */
 
+#include <linux/component.h>
 #include <linux/dma-mapping.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -14,10 +15,12 @@
 
 #include <drm/clients/drm_client_setup.h>
 #include <drm/drm_atomic_helper.h>
+#include <drm/drm_crtc.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fbdev_dma.h>
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_managed.h>
+#include <drm/drm_of.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 
@@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
 				  struct drm_device *ddev)
 {
 	struct rzg2l_du_device *rcdu;
+	int ret;
 
 	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
 	if (!rcdu)
@@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
 	rcdu->mmio = du->mmio;
 	rcdu->ddev = ddev;
 
-	return rzg2l_du_modeset_init_du(rcdu);
+	rcdu->index = ddev->mode_config.num_crtc;
+
+	ret = rzg2l_du_modeset_init_du(rcdu);
+	if (ret < 0)
+		return ret;
+
+	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
+		return -EINVAL;
+
+	return 0;
 }
 
+static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
+				  void *data)
+{
+	return rzg2l_du_instance_init(dev_get_drvdata(dev), data);
+}
+
+static const struct component_ops rzg2l_du_instance_ops = {
+	.bind = rzg2l_du_instance_bind,
+};
+
 /* -----------------------------------------------------------------------------
  * DRM device
  */
@@ -191,7 +214,7 @@ struct rzg2l_du_drm {
 	struct drm_device ddev;
 };
 
-static int rzg2l_du_drm_init(struct device *dev)
+static int rzg2l_du_drm_init(struct device *dev, bool has_components)
 {
 	struct rzg2l_du_device *du = dev_get_drvdata(dev);
 	struct rzg2l_du_drm *rzgdrm;
@@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
 	if (ret < 0)
 		goto error;
 
+	if (has_components) {
+		ret = component_bind_all(dev, ddev);
+		if (ret < 0)
+			goto error;
+	}
+
 	ret = rzg2l_du_modeset_init_finish(ddev);
 	if (ret < 0)
 		goto error_fini;
@@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device *dev)
 
 error_fini:
 	drm_kms_helper_poll_fini(ddev);
+	if (has_components)
+		component_unbind_all(dev, ddev);
 error:
 	/*
 	 * Don't use dev_err_probe(), as it would overwrite the probe deferral
@@ -246,7 +277,7 @@ static int rzg2l_du_drm_init(struct device *dev)
 	return ret;
 }
 
-static void rzg2l_du_drm_fini(struct device *dev)
+static void rzg2l_du_drm_fini(struct device *dev, bool has_components)
 {
 	struct rzg2l_du_device *du = dev_get_drvdata(dev);
 	struct drm_device *ddev = du->ddev;
@@ -254,6 +285,83 @@ static void rzg2l_du_drm_fini(struct device *dev)
 	drm_dev_unregister(ddev);
 	drm_atomic_helper_shutdown(ddev);
 	drm_kms_helper_poll_fini(ddev);
+
+	if (has_components)
+		component_unbind_all(dev, ddev);
+
+	du->ddev = NULL;
+}
+
+/* -----------------------------------------------------------------------------
+ * Component master
+ */
+
+static int rzg2l_du_master_bind(struct device *dev)
+{
+	return rzg2l_du_drm_init(dev, true);
+}
+
+static void rzg2l_du_master_unbind(struct device *dev)
+{
+	rzg2l_du_drm_fini(dev, true);
+}
+
+static const struct component_master_ops rzg2l_du_master_ops = {
+	.bind = rzg2l_du_master_bind,
+	.unbind = rzg2l_du_master_unbind,
+};
+
+static int rzg2l_du_instance_probe(struct rzg2l_du_device *du)
+{
+	struct component_match *match = NULL;
+	const struct of_device_id *of_id;
+	struct device *dev = du->dev;
+
+	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
+		return rzg2l_du_drm_init(dev, false);
+
+	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
+		of_id = of_match_node(dev->driver->of_match_table, np);
+		if (!of_id || of_id->data != du->info)
+			continue;
+
+		/* The first available DU instance is the component master. */
+		if (!du->is_master) {
+			if (np != dev->of_node)
+				return component_add(dev, &rzg2l_du_instance_ops);
+
+			du->is_master = true;
+			continue;
+		}
+
+		drm_of_component_match_add(dev, &match, component_compare_of, np);
+	}
+
+	if (IS_ERR(match))
+		return PTR_ERR(match);
+
+	if (!match)
+		return rzg2l_du_drm_init(dev, false);
+
+	return component_master_add_with_match(dev, &rzg2l_du_master_ops, match);
+}
+
+static void rzg2l_du_instance_remove(struct rzg2l_du_device *du)
+{
+	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT)) {
+		rzg2l_du_drm_fini(du->dev, false);
+		return;
+	}
+
+	if (!du->is_master) {
+		component_del(du->dev, &rzg2l_du_instance_ops);
+		return;
+	}
+
+	component_master_del(du->dev, &rzg2l_du_master_ops);
+
+	if (du->ddev)
+		rzg2l_du_drm_fini(du->dev, false);
 }
 
 /* -----------------------------------------------------------------------------
@@ -262,7 +370,7 @@ static void rzg2l_du_drm_fini(struct device *dev)
 
 static void rzg2l_du_remove(struct platform_device *pdev)
 {
-	rzg2l_du_drm_fini(&pdev->dev);
+	rzg2l_du_instance_remove(platform_get_drvdata(pdev));
 }
 
 static void rzg2l_du_shutdown(struct platform_device *pdev)
@@ -304,7 +412,7 @@ static int rzg2l_du_probe(struct platform_device *pdev)
 	rcdu->info = info;
 	rcdu->mmio = mmio;
 
-	return rzg2l_du_drm_init(&pdev->dev);
+	return rzg2l_du_instance_probe(rcdu);
 }
 
 static struct platform_driver rzg2l_du_platform_driver = {
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
index 2952c9d7348b..4c2e12206d83 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
@@ -21,6 +21,7 @@ struct device;
 struct drm_property;
 
 #define RZG2L_DU_FEATURE_DPIO_OE	BIT(0)	/* Has DPIO output enable control */
+#define RZG2L_DU_FEATURE_COMPONENT	BIT(1)	/* Has several DU instances in one DRM device */
 
 enum rzg2l_du_output {
 	RZG2L_DU_OUTPUT_DSI0,
@@ -71,6 +72,7 @@ struct rzg2l_du_device {
 
 	struct drm_device *ddev;
 	unsigned int index;
+	bool is_master;
 
 	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
 	unsigned int num_crtcs;
-- 
2.54.0


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

* [PATCH v10 11/12] drm: renesas: rz-du: Add RZ/G3E (R9A09G047) DU support
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (9 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  2026-11-13 12:20 ` [PATCH v10 12/12] arm64: dts: renesas: r9a09g047: Add DU{0,1} nodes Tommaso Merciai
  11 siblings, 0 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

The RZ/G3E (R9A09G047) has two DU instances which can both drive the
DSI encoder and channel 1 of the LVDS encoder. Expose them through a
single DRM device.

Request the LVDS duty cycle for the new LVDS channel 1 output as well.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - Dropped rzg2l_du_subsystem.c and the separate DU instance platform
   driver. All SoCs now go through the same probe path and the first
   available RZ/G3E DU instance acts as component master.
 - Split the driver preparation into separate patches.
 - Reworked commit body.

v8->v9:
 - Added newly architetture support creating an ad hoc component
   driver for RZ/G3E display subsystem that embed the 2 du instances
   into single drm device.

v7->v8:
 - Modelled using ports/port instead of port/ep.
 - Rebased on top of RZ/G3L du support [1]
   [1] https://lore.kernel.org/all/20260826174854.199139-1-biju.das.jz@bp.renesas.com/
 - Added mode_clock_min, mode_clock_max for parallel output.
 - Improved commit msg and commit body.

v6->v7:
 - Removed feature flag usage, rebased on top of T2H/N2H LCDC series [1]
   [1] https://patchwork.global.renesas.com/project/spl2-reviews/list/?series=694&state=%2A&archive=both
 - Reworked commit body as now outputs routing is based on endpoint id
   instead of port number.
 - Fixed rzg2l_du_r9a09g047_info instead of rzg2l_du_r9a09g047_du_info.
 - Added bump of RZG2L_DU_MAX_CRTCS and RZG2L_DU_MAX_VSPS to 2.

v5->v6:
 - Aligned ports numbering with the bindings changes.

v4->v5:
 - Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
   update commit body accordingly.
 - Added features field documentation.

v3->v4:
 - No changes.

v2->v3:
 - No changes.

v1->v2:
 - Instead of using clk-provider API to select the right parent clock,
   based on the outputs. Just set the correct duty cycle based on the
   output, this reflects at CPG lvl to select the right parent.
 - Updated commit message accordingly.

 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c  | 29 ++++++++++++++++++-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  3 +-
 .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  3 +-
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index 873586f2ef28..bd8f4c9f1f29 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -79,6 +79,31 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a08g046_info = {
 	.mode_clock_max = 87000,
 };
 
+static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_info = {
+	.channels_mask = BIT(0),
+	.routes = {
+		[RZG2L_DU_OUTPUT_DSI0] = {
+			.possible_outputs = BIT(0),
+			.port = 0,
+		},
+		[RZG2L_DU_OUTPUT_DPAD0] = {
+			.possible_outputs = BIT(0),
+			.port = 1,
+		},
+		[RZG2L_DU_OUTPUT_LVDS0] = {
+			.possible_outputs = BIT(0),
+			.port = 2,
+		},
+		[RZG2L_DU_OUTPUT_LVDS1] = {
+			.possible_outputs = BIT(0),
+			.port = 3,
+		},
+	},
+	.features = RZG2L_DU_FEATURE_COMPONENT,
+	.mode_clock_min = 5400,
+	.mode_clock_max = 87000,
+};
+
 static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
 	.channels_mask = BIT(0),
 	.routes = {
@@ -106,6 +131,7 @@ static const struct of_device_id rzg2l_du_of_table[] = {
 	{ .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
 	{ .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
 	{ .compatible = "renesas,r9a08g046-du", .data = &rzg2l_du_r9a08g046_info },
+	{ .compatible = "renesas,r9a09g047-du", .data = &rzg2l_du_r9a09g047_info },
 	{ .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
 	{ .compatible = "renesas,r9a09g077-du", .data = &rzg2l_du_r9a09g077_info },
 	{ /* sentinel */ }
@@ -118,7 +144,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output)
 	static const char * const names[] = {
 		[RZG2L_DU_OUTPUT_DSI0] = "DSI0",
 		[RZG2L_DU_OUTPUT_DPAD0] = "DPAD0",
-		[RZG2L_DU_OUTPUT_LVDS0] = "LVDS0"
+		[RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
+		[RZG2L_DU_OUTPUT_LVDS1] = "LVDS1"
 	};
 
 	if (output >= ARRAY_SIZE(names))
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
index 4c2e12206d83..2a5bd00e692e 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
@@ -27,6 +27,7 @@ enum rzg2l_du_output {
 	RZG2L_DU_OUTPUT_DSI0,
 	RZG2L_DU_OUTPUT_DPAD0,
 	RZG2L_DU_OUTPUT_LVDS0,
+	RZG2L_DU_OUTPUT_LVDS1,
 	RZG2L_DU_OUTPUT_MAX,
 };
 
@@ -35,7 +36,7 @@ enum rzg2l_du_output {
  * @possible_outputs: bitmask of possible outputs
  * @port: device tree port number corresponding to this output route
  *
- * The DU has 3 possible outputs (DPAD0, DSI0, LVDS0). Output routing data
+ * The DU has 4 possible outputs (DPAD0, DSI0, LVDS0/1). Output routing data
  * specify the valid SoC outputs, which CRTC can drive the output, and the type
  * of in-SoC encoder for the output.
  */
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
index 45f980ea3c20..60709e0fc601 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
@@ -80,7 +80,8 @@ static void rzg2l_du_encoder_atomic_mode_set(struct drm_encoder *encoder,
 	 * - LVDS path has DUTY H/L=4/3, 4/7 duty cycle.
 	 * - DSI/RGB path has symmetric 50% duty cycle.
 	 */
-	if (renc->output == RZG2L_DU_OUTPUT_LVDS0)
+	if (renc->output == RZG2L_DU_OUTPUT_LVDS0 ||
+	    renc->output == RZG2L_DU_OUTPUT_LVDS1)
 		clk_set_duty_cycle(clk_parent, 4, 7);
 	else
 		clk_set_duty_cycle(clk_parent, 1, 2);
-- 
2.54.0


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

* [PATCH v10 12/12] arm64: dts: renesas: r9a09g047: Add DU{0,1} nodes
  2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
                   ` (10 preceding siblings ...)
  2026-11-13 12:20 ` [PATCH v10 11/12] drm: renesas: rz-du: Add RZ/G3E (R9A09G047) DU support Tommaso Merciai
@ 2026-11-13 12:20 ` Tommaso Merciai
  11 siblings, 0 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-13 12:20 UTC (permalink / raw)
  To: tomm.merciai, prabhakar.mahadev-lad.rj
  Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
	Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Add DU{0,1} nodes to RZ/G3E SoC DTSI.

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v9->v10:
 - Removed display-subsystem node and du*_ports, updated commit body
   accordingly.

v8->v9:
 - Split du into du0 and du1 node and added newly display_subsystem node.

v7->v8
 - New patch

 arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 74 ++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index 737bf1c60451..0c9c6842e5d0 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -2239,6 +2239,80 @@ csi2cru: endpoint@0 {
 			};
 		};
 
+		du0: display@16460000 {
+			compatible = "renesas,r9a09g047-du";
+			reg = <0 0x16460000 0 0x10000>;
+			interrupts = <GIC_SPI 882 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 0xed>,
+				 <&cpg CPG_MOD 0xee>,
+				 <&cpg CPG_MOD 0xef>;
+			clock-names = "aclk", "pclk", "vclk";
+			power-domains = <&cpg>;
+			resets = <&cpg 0xdc>;
+			renesas,vsps = <&vspd0 0>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					du0_out_dsi: endpoint {
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					du0_out_lvds0: endpoint {
+					};
+				};
+
+				port@3 {
+					reg = <3>;
+					du0_out_lvds1: endpoint {
+					};
+				};
+			};
+		};
+
+		du1: display@16490000 {
+			compatible = "renesas,r9a09g047-du";
+			reg = <0 0x16490000 0 0x10000>;
+			interrupts = <GIC_SPI 922 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 0x1a8>,
+				 <&cpg CPG_MOD 0x1a9>,
+				 <&cpg CPG_MOD 0x1aa>;
+			clock-names = "aclk", "pclk", "vclk";
+			power-domains = <&cpg>;
+			resets = <&cpg 0x11e>;
+			renesas,vsps = <&vspd1 0>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					du1_out_dsi: endpoint {
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					du1_out_rgb: endpoint {
+					};
+				};
+
+				port@3 {
+					reg = <3>;
+					du1_out_lvds1: endpoint {
+					};
+				};
+			};
+		};
+
 		fcpvd0: fcp@16470000 {
 			compatible = "renesas,r9a09g047-fcpvd",
 				     "renesas,fcpv";
-- 
2.54.0


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

* RE: [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP
  2026-11-13 12:19 ` [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP Tommaso Merciai
@ 2026-11-18 14:09   ` Biju Das
  2026-11-18 18:08     ` Tommaso Merciai
  0 siblings, 1 reply; 31+ messages in thread
From: Biju Das @ 2026-11-18 14:09 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

Thanks for the patch.

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP
> 
> Each VSP numbers its planes from zero, so the device-wide search in
> rzg2l_du_vsp_get_drm_plane() picks the wrong plane as soon as a SoC has more than one VSP: the primary
> plane of the second CRTC is looked up on the first VSP, whose possible_crtcs mask does not cover that
> CRTC.
> 
> In preparation for supporting RZ/G3E, store the planes in the VSP that owns them and index the per-VSP
> array directly from rzg2l_du_crtc_create(), as the R-Car DU driver does, and drop the now unused
> search helper.
> 
> No functional change intended.
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - No changes.
> 
> v8->v9:
>  - Dropped the vsp_pipe bounds check in rzg2l_du_crtc_create() and the
>    now unused num_planes field, aligning with rcar_du_crtc_create().
>  - Updated commit message accordingly.
> 
> v7->v8:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c |  4 +---  drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> | 19 ++-----------------  drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  | 10 +++-------
>  3 files changed, 6 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_crtc.c
> index ab2f24cc7683..c57884ab5b9b 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> @@ -409,9 +409,7 @@ int rzg2l_du_crtc_create(struct rzg2l_du_device *rcdu)
>  	init_waitqueue_head(&rcrtc->flip_wait);
>  	rcrtc->dev = rcdu;
> 
> -	primary = rzg2l_du_vsp_get_drm_plane(rcrtc, rcrtc->vsp_pipe);
> -	if (IS_ERR(primary))
> -		return PTR_ERR(primary);
> +	primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe]->plane;

The bounds check on vsp_pipe  is dropped.  planes[vsp_pipe] is now indexed directly into a 2-entry array,
so a bad DT value oopses.

> 
>  	ret = drmm_crtc_init_with_planes(&rcdu->ddev, crtc, primary, NULL,
>  					 &crtc_funcs_rz, NULL);
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_vsp.c
> index 944bc9ac9589..12fe35740c62 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> @@ -71,22 +71,6 @@ void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc)
>  	vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg);  }
> 
> -struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> -					     unsigned int pipe_index)
> -{
> -	struct rzg2l_du_device *rcdu = crtc->vsp->dev;
> -	struct drm_plane *plane = NULL;
> -
> -	drm_for_each_plane(plane, &rcdu->ddev) {
> -		struct rzg2l_du_vsp_plane *vsp_plane = to_rzg2l_vsp_plane(plane);
> -
> -		if (vsp_plane->index == pipe_index)
> -			break;

Do you need to remove this function? 
as plane has vsp and index information.

plane->vsp = vsp; 
plane->index = i;

Cheers,
Biju

> -	}
> -
> -	return plane ? plane : ERR_PTR(-EINVAL);
> -}
> -
>  static const u32 rzg2l_du_vsp_formats[] = {
>  	DRM_FORMAT_RGB332,
>  	DRM_FORMAT_ARGB4444,
> @@ -303,7 +287,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
>  	struct rzg2l_du_device *rcdu = vsp->dev;
>  	struct platform_device *pdev;
>  	unsigned int num_crtcs = hweight32(crtcs);
> -	unsigned int num_planes = 2;
> +	unsigned int num_planes = RZG2L_DU_VSP_MAX_PLANES;
>  	unsigned int i;
>  	int ret;
> 
> @@ -350,6 +334,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> 
>  		plane->vsp = vsp;
>  		plane->index = i;
> +		vsp->planes[i] = plane;
> 
>  		drm_plane_helper_add(&plane->plane,
>  				     &rzg2l_du_vsp_plane_helper_funcs);
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_vsp.h
> index a22aaf0843ed..acb41d343297 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
> @@ -27,11 +27,14 @@ struct rzg2l_du_vsp_plane {
>  	unsigned int index;
>  };
> 
> +#define RZG2L_DU_VSP_MAX_PLANES		2
> +
>  struct rzg2l_du_vsp {
>  	unsigned int index;
>  	struct device *vsp;
>  	struct device_link *link;
>  	struct rzg2l_du_device *dev;
> +	struct rzg2l_du_vsp_plane *planes[RZG2L_DU_VSP_MAX_PLANES];
>  };
> 
>  static inline struct rzg2l_du_vsp_plane *to_rzg2l_vsp_plane(struct drm_plane *p) @@ -62,8 +65,6 @@
> int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,  void
> rzg2l_du_vsp_enable(struct rzg2l_du_crtc *crtc);  void rzg2l_du_vsp_disable(struct rzg2l_du_crtc
> *crtc);  void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc); -struct drm_plane
> *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> -					     unsigned int pipe_index);
>  #else
>  static inline int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
>  				    unsigned int crtcs)
> @@ -74,11 +75,6 @@ static inline int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node
> static inline void rzg2l_du_vsp_enable(struct rzg2l_du_crtc *crtc) { };  static inline void
> rzg2l_du_vsp_disable(struct rzg2l_du_crtc *crtc) { };  static inline void
> rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc) { }; -static inline struct drm_plane
> *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> -							   unsigned int pipe_index)
> -{
> -	return ERR_PTR(-ENXIO);
> -}
>  #endif
> 
>  #endif /* __RZG2L_DU_VSP_H__ */
> --
> 2.54.0


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

* Re: [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP
  2026-11-18 14:09   ` Biju Das
@ 2026-11-18 18:08     ` Tommaso Merciai
  0 siblings, 0 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-18 18:08 UTC (permalink / raw)
  To: Biju Das
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Biju,
Thanks for your review.

On Wed, Nov 18, 2026 at 02:09:38PM +0000, Biju Das wrote:
> Hi Tommaso,
> 
> Thanks for the patch.
> 
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 13 November 2026 12:20
> > Subject: [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP
> > 
> > Each VSP numbers its planes from zero, so the device-wide search in
> > rzg2l_du_vsp_get_drm_plane() picks the wrong plane as soon as a SoC has more than one VSP: the primary
> > plane of the second CRTC is looked up on the first VSP, whose possible_crtcs mask does not cover that
> > CRTC.
> > 
> > In preparation for supporting RZ/G3E, store the planes in the VSP that owns them and index the per-VSP
> > array directly from rzg2l_du_crtc_create(), as the R-Car DU driver does, and drop the now unused
> > search helper.
> > 
> > No functional change intended.
> > 
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v9->v10:
> >  - No changes.
> > 
> > v8->v9:
> >  - Dropped the vsp_pipe bounds check in rzg2l_du_crtc_create() and the
> >    now unused num_planes field, aligning with rcar_du_crtc_create().
> >  - Updated commit message accordingly.
> > 
> > v7->v8:
> >  - New patch.
> > 
> >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c |  4 +---  drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> > | 19 ++-----------------  drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h  | 10 +++-------
> >  3 files changed, 6 insertions(+), 27 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_crtc.c
> > index ab2f24cc7683..c57884ab5b9b 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> > @@ -409,9 +409,7 @@ int rzg2l_du_crtc_create(struct rzg2l_du_device *rcdu)
> >  	init_waitqueue_head(&rcrtc->flip_wait);
> >  	rcrtc->dev = rcdu;
> > 
> > -	primary = rzg2l_du_vsp_get_drm_plane(rcrtc, rcrtc->vsp_pipe);
> > -	if (IS_ERR(primary))
> > -		return PTR_ERR(primary);
> > +	primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe]->plane;
> 
> The bounds check on vsp_pipe  is dropped.  planes[vsp_pipe] is now indexed directly into a 2-entry array,
> so a bad DT value oopses.
> 
> > 
> >  	ret = drmm_crtc_init_with_planes(&rcdu->ddev, crtc, primary, NULL,
> >  					 &crtc_funcs_rz, NULL);
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_vsp.c
> > index 944bc9ac9589..12fe35740c62 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> > @@ -71,22 +71,6 @@ void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc)
> >  	vsp1_du_atomic_flush(crtc->vsp->vsp, crtc->vsp_pipe, &cfg);  }
> > 
> > -struct drm_plane *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> > -					     unsigned int pipe_index)
> > -{
> > -	struct rzg2l_du_device *rcdu = crtc->vsp->dev;
> > -	struct drm_plane *plane = NULL;
> > -
> > -	drm_for_each_plane(plane, &rcdu->ddev) {
> > -		struct rzg2l_du_vsp_plane *vsp_plane = to_rzg2l_vsp_plane(plane);
> > -
> > -		if (vsp_plane->index == pipe_index)
> > -			break;
> 
> Do you need to remove this function? 
> as plane has vsp and index information.
> 
> plane->vsp = vsp; 
> plane->index = i;

I think we can keep this function adding vsp_plane->index check:
	
	if (vsp_plane->vsp == crtc->vsp &&
	    vsp_plane->index == pipe_index)
	
While at it I notice that rzg2l_du_vsp_get_drm_plane() 
never return ERR_PTR(-EINVAL) because plane == NULL can't happens.

Will address also this into the next iteration.

Kind regards,
Tommaso

> 
> Cheers,
> Biju
> 
> > -	}
> > -
> > -	return plane ? plane : ERR_PTR(-EINVAL);
> > -}
> > -
> >  static const u32 rzg2l_du_vsp_formats[] = {
> >  	DRM_FORMAT_RGB332,
> >  	DRM_FORMAT_ARGB4444,
> > @@ -303,7 +287,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> >  	struct rzg2l_du_device *rcdu = vsp->dev;
> >  	struct platform_device *pdev;
> >  	unsigned int num_crtcs = hweight32(crtcs);
> > -	unsigned int num_planes = 2;
> > +	unsigned int num_planes = RZG2L_DU_VSP_MAX_PLANES;
> >  	unsigned int i;
> >  	int ret;
> > 
> > @@ -350,6 +334,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> > 
> >  		plane->vsp = vsp;
> >  		plane->index = i;
> > +		vsp->planes[i] = plane;
> > 
> >  		drm_plane_helper_add(&plane->plane,
> >  				     &rzg2l_du_vsp_plane_helper_funcs);
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_vsp.h
> > index a22aaf0843ed..acb41d343297 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h
> > @@ -27,11 +27,14 @@ struct rzg2l_du_vsp_plane {
> >  	unsigned int index;
> >  };
> > 
> > +#define RZG2L_DU_VSP_MAX_PLANES		2
> > +
> >  struct rzg2l_du_vsp {
> >  	unsigned int index;
> >  	struct device *vsp;
> >  	struct device_link *link;
> >  	struct rzg2l_du_device *dev;
> > +	struct rzg2l_du_vsp_plane *planes[RZG2L_DU_VSP_MAX_PLANES];
> >  };
> > 
> >  static inline struct rzg2l_du_vsp_plane *to_rzg2l_vsp_plane(struct drm_plane *p) @@ -62,8 +65,6 @@
> > int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,  void
> > rzg2l_du_vsp_enable(struct rzg2l_du_crtc *crtc);  void rzg2l_du_vsp_disable(struct rzg2l_du_crtc
> > *crtc);  void rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc); -struct drm_plane
> > *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> > -					     unsigned int pipe_index);
> >  #else
> >  static inline int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> >  				    unsigned int crtcs)
> > @@ -74,11 +75,6 @@ static inline int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node
> > static inline void rzg2l_du_vsp_enable(struct rzg2l_du_crtc *crtc) { };  static inline void
> > rzg2l_du_vsp_disable(struct rzg2l_du_crtc *crtc) { };  static inline void
> > rzg2l_du_vsp_atomic_flush(struct rzg2l_du_crtc *crtc) { }; -static inline struct drm_plane
> > *rzg2l_du_vsp_get_drm_plane(struct rzg2l_du_crtc *crtc,
> > -							   unsigned int pipe_index)
> > -{
> > -	return ERR_PTR(-ENXIO);
> > -}
> >  #endif
> > 
> >  #endif /* __RZG2L_DU_VSP_H__ */
> > --
> > 2.54.0
> 

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

* RE: [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer
  2026-11-13 12:19 ` [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer Tommaso Merciai
@ 2026-11-23 15:55   ` Biju Das
  0 siblings, 0 replies; 31+ messages in thread
From: Biju Das @ 2026-11-23 15:55 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer
> 
> struct rzg2l_du_device embeds the DRM device, which makes a DU instance and the DRM device one and the
> same. RZ/G3E has two instances that have to share a single DRM device.
> 
> In preparation of supporting it, reference the DRM device by pointer and give it a container of its
> own. The instance is allocated with the DRM device rather than with the platform device, as the CRTC
> and VSP cleanup handlers point into it and run once the DRM device is released.
> 
> No functional change intended.
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - Rebased on top of [1], converted the PM ops too.
>  - Kept rzg2l_du_device as platform drvdata, use rcdu->ddev.
> 
> v9->v10:
>  - No changes just rebased.

Duplicate change log v9->v10.

> 
> v8->v9:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c |  2 +-  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> | 39 ++++++++++++-------  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h  |  7 +---
>   .../gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  8 ++--  .../gpu/drm/renesas/rz-
> du/rzg2l_du_encoder.h  |  1 +  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c  |  2 +-
> drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c  |  4 +-
>  7 files changed, 35 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_crtc.c
> index c57884ab5b9b..398532933013 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> @@ -411,7 +411,7 @@ int rzg2l_du_crtc_create(struct rzg2l_du_device *rcdu)
> 
>  	primary = &rcrtc->vsp->planes[rcrtc->vsp_pipe]->plane;
> 
> -	ret = drmm_crtc_init_with_planes(&rcdu->ddev, crtc, primary, NULL,
> +	ret = drmm_crtc_init_with_planes(rcdu->ddev, crtc, primary, NULL,
>  					 &crtc_funcs_rz, NULL);
>  	if (ret < 0)
>  		return ret;
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.c
> index c7d71dd9198e..57197356143f 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> @@ -17,6 +17,7 @@
>  #include <drm/drm_drv.h>
>  #include <drm/drm_fbdev_dma.h>
>  #include <drm/drm_gem_dma_helper.h>
> +#include <drm/drm_managed.h>
>  #include <drm/drm_print.h>
>  #include <drm/drm_probe_helper.h>
> 
> @@ -148,14 +149,14 @@ static int rzg2l_du_pm_suspend(struct device *dev)  {
>  	struct rzg2l_du_device *rcdu = dev_get_drvdata(dev);
> 
> -	return drm_mode_config_helper_suspend(&rcdu->ddev);
> +	return drm_mode_config_helper_suspend(rcdu->ddev);
>  }
> 
>  static int rzg2l_du_pm_resume(struct device *dev)  {
>  	struct rzg2l_du_device *rcdu = dev_get_drvdata(dev);
> 
> -	return drm_mode_config_helper_resume(&rcdu->ddev);
> +	return drm_mode_config_helper_resume(rcdu->ddev);
>  }
> 
>  static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
> @@ -165,10 +166,14 @@ static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
>   * Platform driver
>   */
> 
> +struct rzg2l_du_drm {
> +	struct drm_device ddev;
> +};

> +
>  static void rzg2l_du_remove(struct platform_device *pdev)  {
>  	struct rzg2l_du_device *rcdu = platform_get_drvdata(pdev);
> -	struct drm_device *ddev = &rcdu->ddev;
> +	struct drm_device *ddev = rcdu->ddev;
> 
>  	drm_dev_unregister(ddev);
>  	drm_atomic_helper_shutdown(ddev);
> @@ -180,28 +185,34 @@ static void rzg2l_du_shutdown(struct platform_device *pdev)  {
>  	struct rzg2l_du_device *rcdu = platform_get_drvdata(pdev);
> 
> -	drm_atomic_helper_shutdown(&rcdu->ddev);
> +	drm_atomic_helper_shutdown(rcdu->ddev);
>  }
> 
>  static int rzg2l_du_probe(struct platform_device *pdev)  {
>  	struct rzg2l_du_device *rcdu;
> +	struct rzg2l_du_drm *rzgdrm;
>  	int ret;
> 
>  	if (drm_firmware_drivers_only())
>  		return -ENODEV;
> 
>  	/* Allocate and initialize the RZ/G2L device structure. */
> -	rcdu = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> -				  struct rzg2l_du_device, ddev);
> -	if (IS_ERR(rcdu))
> -		return PTR_ERR(rcdu);
> +	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> +				    struct rzg2l_du_drm, ddev);
> +	if (IS_ERR(rzgdrm))
> +		return PTR_ERR(rzgdrm);
> 
> -	rcdu->dev = &pdev->dev;
> -	rcdu->info = of_device_get_match_data(rcdu->dev);
> +	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
> +	if (!rcdu)
> +		return -ENOMEM;
> 
>  	platform_set_drvdata(pdev, rcdu);

Previously this code is after rcdu->info. 

> 
> +	rcdu->dev = &pdev->dev;
> +	rcdu->info = of_device_get_match_data(rcdu->dev);
> +	rcdu->ddev = &rzgdrm->ddev;
> +
>  	/* I/O resources */
>  	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rcdu->mmio))
> @@ -228,18 +239,18 @@ static int rzg2l_du_probe(struct platform_device *pdev)
>  	 * Register the DRM device with the core and the connectors with
>  	 * sysfs.
>  	 */
> -	ret = drm_dev_register(&rcdu->ddev, 0);
> +	ret = drm_dev_register(&rzgdrm->ddev, 0);
>  	if (ret)
>  		goto error;
> 
> -	drm_info(&rcdu->ddev, "Device %s probed\n", dev_name(&pdev->dev));
> +	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
> 
> -	drm_client_setup(&rcdu->ddev, NULL);
> +	drm_client_setup(&rzgdrm->ddev, NULL);
> 
>  	return 0;
> 
>  error:
> -	drm_kms_helper_poll_fini(&rcdu->ddev);
> +	drm_kms_helper_poll_fini(&rzgdrm->ddev);
>  	return ret;
>  }
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.h
> index e9626ef37cde..47ceaf892339 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> @@ -69,7 +69,7 @@ struct rzg2l_du_device {
> 
>  	void __iomem *mmio;
> 
> -	struct drm_device ddev;
> +	struct drm_device *ddev;
> 
>  	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
>  	unsigned int num_crtcs;
> @@ -77,11 +77,6 @@ struct rzg2l_du_device {
>  	struct rzg2l_du_vsp vsps[RZG2L_DU_MAX_VSPS];  };
> 
> -static inline struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev) -{
> -	return container_of(dev, struct rzg2l_du_device, ddev);
> -}
> -
>  static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
>  				unsigned int feature)
>  {
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_encoder.c
> index a1b48973aa8e..5c21c5f9fbaf 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
> @@ -52,8 +52,7 @@ rzg2l_du_encoder_mode_valid(struct drm_encoder *encoder,
>  			    const struct drm_display_mode *mode)  {
>  	struct rzg2l_du_encoder *renc = to_rzg2l_encoder(encoder);
> -	struct rzg2l_du_device *rcdu = to_rzg2l_du_device(renc->base.dev);
> -	const struct rzg2l_du_device_info *info = rcdu->info;

Maybe to keep the change minimal

       struct rzg2l_du_device *rcdu = renc->rcdu;
	 const struct rzg2l_du_device_info *info = rcdu->info;

> +	const struct rzg2l_du_device_info *info = renc->dev->info;
> 
>  	if (renc->output != RZG2L_DU_OUTPUT_DPAD0)
>  		return MODE_OK;
> @@ -133,12 +132,13 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device  *rcdu,
>  	dev_dbg(rcdu->dev, "initializing encoder %pOF for output %s\n",
>  		enc_node, rzg2l_du_output_name(output));
> 
> -	renc = drmm_encoder_alloc(&rcdu->ddev, struct rzg2l_du_encoder, base,
> +	renc = drmm_encoder_alloc(rcdu->ddev, struct rzg2l_du_encoder, base,
>  				  &rzg2l_du_encoder_funcs, DRM_MODE_ENCODER_NONE,
>  				  NULL);
>  	if (IS_ERR(renc))
>  		return PTR_ERR(renc);
> 
> +	renc->dev = rcdu;
>  	renc->output = output;
>  	drm_encoder_helper_add(&renc->base, &rzg2l_du_encoder_helper_funcs);
> 
> @@ -153,7 +153,7 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device  *rcdu,
>  	}
> 
>  	/* Create the connector for the chain of bridges. */
> -	connector = drm_bridge_connector_init(&rcdu->ddev, &renc->base);
> +	connector = drm_bridge_connector_init(rcdu->ddev, &renc->base);
>  	if (IS_ERR(connector)) {
>  		dev_err(rcdu->dev,
>  			"failed to created connector for output %s (%ld)\n", diff --git
> a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
> index 3e430c1f6132..dfffcc14e0a3 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.h
> @@ -17,6 +17,7 @@ struct rzg2l_du_device;
> 
>  struct rzg2l_du_encoder {
>  	struct drm_encoder base;
> +	struct rzg2l_du_device *dev;

dev->rcdu for consistency

Cheers,
Biju

>  	enum rzg2l_du_output output;
>  };
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_kms.c
> index 87f171145a23..13d14ecacba9 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> @@ -402,7 +402,7 @@ static int rzg2l_du_vsps_init(struct rzg2l_du_device *rcdu)
> 
>  int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)  {
> -	struct drm_device *dev = &rcdu->ddev;
> +	struct drm_device *dev = rcdu->ddev;
>  	struct drm_encoder *encoder;
>  	unsigned int num_encoders;
>  	int ret;
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_vsp.c
> index 12fe35740c62..4df4f0ff0ed5 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c
> @@ -298,7 +298,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
> 
>  	vsp->vsp = &pdev->dev;
> 
> -	ret = drmm_add_action_or_reset(&rcdu->ddev, rzg2l_du_vsp_cleanup, vsp);
> +	ret = drmm_add_action_or_reset(rcdu->ddev, rzg2l_du_vsp_cleanup, vsp);
>  	if (ret < 0)
>  		return ret;
> 
> @@ -324,7 +324,7 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np,
>  					 : DRM_PLANE_TYPE_OVERLAY;
>  		struct rzg2l_du_vsp_plane *plane;
> 
> -		plane = drmm_universal_plane_alloc(&rcdu->ddev, struct rzg2l_du_vsp_plane,
> +		plane = drmm_universal_plane_alloc(rcdu->ddev, struct
> +rzg2l_du_vsp_plane,
>  						   plane, crtcs, &rzg2l_du_vsp_plane_funcs,
>  						   rzg2l_du_vsp_formats,
>  						   ARRAY_SIZE(rzg2l_du_vsp_formats),
> --
> 2.54.0


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

* RE: [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones
  2026-11-13 12:20 ` [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones Tommaso Merciai
@ 2026-11-23 16:16   ` Biju Das
  0 siblings, 0 replies; 31+ messages in thread
From: Biju Das @ 2026-11-23 16:16 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones
> 
> rzg2l_du_modeset_init() sets the possible clones of every encoder registered with the DRM device, but
> builds the mask from the number of outputs that rzg2l_du_encoders_init() initialized successfully. An
> output whose bridge fails to attach after its encoder has been allocated is skipped and not counted,
> while its encoder stays registered. The mask then misses the bit of the last encoders, and
> drm_mode_config_validate() warns about bogus possible clones.
> 
> Build the mask from the number of registered encoders instead.

Looks this is a fix. Can you please move this patch at the starting and add 
Fixes tag.

Cheers,
Biju

> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - No changes.
> 
> v8->v9:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_kms.c
> index 13d14ecacba9..6eb1865f43b4 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> @@ -455,7 +455,7 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
>  		return -EINVAL;
>  	}
> 
> -	num_encoders = ret;
> +	num_encoders = dev->mode_config.num_encoder;
> 
>  	/*
>  	 * Set the possible CRTCs and possible clones. There's always at least
> --
> 2.54.0


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

* RE: [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization
  2026-11-13 12:20 ` [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization Tommaso Merciai
@ 2026-11-23 16:31   ` Biju Das
  0 siblings, 0 replies; 31+ messages in thread
From: Biju Das @ 2026-11-23 16:31 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization
> 
> rzg2l_du_modeset_init() initializes the mode configuration of the DRM device and creates the KMS
> objects of the DU instance. On RZ/G3E two instances share a DRM device, so the mode configuration is
> initialized once while each instance creates its own KMS objects.
> 
> In preparation for supporting RZ/G3E SoC, split them into rzg2l_du_modeset_init_drm(),
> rzg2l_du_modeset_init_du() and rzg2l_du_modeset_init_finish(), the latter completing the DRM device
> once all instances have created their KMS objects, and call them from the probe function.
> As it is no longer tied to an instance, take from the DRM device and the encoders what used to be
> taken from the instance.
> 
> No functional change intended.

There is a change in code flow drm_vblank_init() is called after CRTC's created now.

> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - Dropped rzg2l_du_modeset_init(), call the helpers from probe.
>  - Updated commit body accordingly.
> 
> v8->v9:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 32 ++++++++++------  drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_kms.c | 39 +++++++++++++-------  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h |  4 +-
>  3 files changed, 49 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.c
> index 57197356143f..d3cccbdf9012 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> @@ -223,17 +223,17 @@ static int rzg2l_du_probe(struct platform_device *pdev)
>  		return ret;
> 
>  	/* DRM/KMS objects */
> -	ret = rzg2l_du_modeset_init(rcdu);
> -	if (ret < 0) {
> -		/*
> -		 * Don't use dev_err_probe(), as it would overwrite the probe
> -		 * deferral reason recorded in rzg2l_du_modeset_init().
> -		 */
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(&pdev->dev,
> -				"failed to initialize DRM/KMS (%d)\n", ret);
> +	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
> +	if (ret < 0)
>  		goto error;
> -	}
> +
> +	ret = rzg2l_du_modeset_init_du(rcdu);
> +	if (ret < 0)
> +		goto error;
> +
> +	ret = rzg2l_du_modeset_init_finish(&rzgdrm->ddev);
> +	if (ret < 0)
> +		goto error_fini;
> 
>  	/*
>  	 * Register the DRM device with the core and the connectors with @@ -241,7 +241,7 @@ static int
> rzg2l_du_probe(struct platform_device *pdev)
>  	 */
>  	ret = drm_dev_register(&rzgdrm->ddev, 0);
>  	if (ret)
> -		goto error;
> +		goto error_fini;
> 
>  	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
> 
> @@ -249,8 +249,16 @@ static int rzg2l_du_probe(struct platform_device *pdev)
> 
>  	return 0;
> 
> -error:
> +error_fini:
>  	drm_kms_helper_poll_fini(&rzgdrm->ddev);
> +error:
> +	/*
> +	 * Don't use dev_err_probe(), as it would overwrite the probe deferral
> +	 * reason recorded while initializing the DRM/KMS objects.
> +	 */
> +	if (ret != -EPROBE_DEFER)
> +		dev_err(&pdev->dev, "failed to initialize DRM/KMS (%d)\n", ret);
> +
>  	return ret;
>  }
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_kms.c
> index 6eb1865f43b4..73cb3199f90f 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> @@ -400,11 +400,8 @@ static int rzg2l_du_vsps_init(struct rzg2l_du_device *rcdu)
>  	return ret;
>  }
> 
> -int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
> +int rzg2l_du_modeset_init_drm(struct drm_device *dev)
>  {
> -	struct drm_device *dev = rcdu->ddev;
> -	struct drm_encoder *encoder;
> -	unsigned int num_encoders;
>  	int ret;
> 
>  	ret = drmm_mode_config_init(dev);
> @@ -424,15 +421,14 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
>  	dev->mode_config.max_width = 1920;
>  	dev->mode_config.max_height = 1920;
> 
> -	rcdu->num_crtcs = hweight8(rcdu->info->channels_mask);
> +	return 0;
> +}
> 
> -	/*
> -	 * Initialize vertical blanking interrupts handling. Start with vblank
> -	 * disabled for all CRTCs.
> -	 */
> -	ret = drm_vblank_init(dev, rcdu->num_crtcs);
> -	if (ret < 0)
> -		return ret;
> +int rzg2l_du_modeset_init_du(struct rzg2l_du_device *rcdu) {
> +	int ret;
> +
> +	rcdu->num_crtcs = hweight8(rcdu->info->channels_mask);
> 
>  	/* Initialize the compositors. */
>  	ret = rzg2l_du_vsps_init(rcdu);
> @@ -455,6 +451,23 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
>  		return -EINVAL;
>  	}
> 
> +	return 0;
> +}
> +
> +int rzg2l_du_modeset_init_finish(struct drm_device *dev) {
> +	struct drm_encoder *encoder;
> +	unsigned int num_encoders;
> +	int ret;
> +
> +	/*
> +	 * Initialize vertical blanking interrupts handling. Start with vblank
> +	 * disabled for all CRTCs.
> +	 */
> +	ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
> +	if (ret < 0)
> +		return ret;
> +
>  	num_encoders = dev->mode_config.num_encoder;
> 
>  	/*
> @@ -465,7 +478,7 @@ int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu)
>  	list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
>  		struct rzg2l_du_encoder *renc = to_rzg2l_encoder(encoder);

		struct rzg2l_du_device *rcdu = renc->rcdu;

Cheers,
Biju

>  		const struct rzg2l_du_output_routing *route =
> -			&rcdu->info->routes[renc->output];
> +			&renc->dev->info->routes[renc->output];
> 
>  		encoder->possible_crtcs = route->possible_outputs;
>  		encoder->possible_clones = (1 << num_encoders) - 1; diff --git
> a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
> index e2c599f115c6..98627a6de4c4 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.h
> @@ -29,7 +29,9 @@ struct rzg2l_du_format_info {
> 
>  const struct rzg2l_du_format_info *rzg2l_du_format_info(u32 fourcc);
> 
> -int rzg2l_du_modeset_init(struct rzg2l_du_device *rcdu);
> +int rzg2l_du_modeset_init_drm(struct drm_device *dev); int
> +rzg2l_du_modeset_init_du(struct rzg2l_du_device *rcdu); int
> +rzg2l_du_modeset_init_finish(struct drm_device *dev);
> 
>  int rzg2l_du_dumb_create(struct drm_file *file, struct drm_device *dev,
>  			 struct drm_mode_create_dumb *args);
> --
> 2.54.0


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

* RE: [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device
  2026-11-13 12:20 ` [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device Tommaso Merciai
@ 2026-11-23 16:37   ` Biju Das
  0 siblings, 0 replies; 31+ messages in thread
From: Biju Das @ 2026-11-23 16:37 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device
> 
> The possible_crtcs masks of planes and encoders hold CRTC indices within the DRM device, but
> rzg2l_du_vsps_init() and
> rzg2l_du_modeset_init_finish() build them from the index of the CRTC within the DU instance. The two
> only match while an instance owns the whole DRM device.
> 
> In preparation for supporting RZ/G3E, where two instances share one, record in each instance the index
> of its first CRTC and offset the masks by it. The index is zero for instances that own their DRM
> device, so their masks are unchanged.
> 
> No functional change intended.
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - No changes.
> 
> v8->v9:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 1 +  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 4
> ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.h
> index 47ceaf892339..2952c9d7348b 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> @@ -70,6 +70,7 @@ struct rzg2l_du_device {
>  	void __iomem *mmio;
> 
>  	struct drm_device *ddev;
> +	unsigned int index;
> 
>  	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
>  	unsigned int num_crtcs;
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_kms.c
> index 73cb3199f90f..456b29538db9 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> @@ -367,7 +367,7 @@ static int rzg2l_du_vsps_init(struct rzg2l_du_device *rcdu)
>  		else
>  			vsps[vsps_count++].np = args.np;
> 
> -		vsps[j].crtcs_mask |= BIT(i);
> +		vsps[j].crtcs_mask |= BIT(rcdu->index + i);
> 
>  		/*
>  		 * Store the VSP pointer and pipe index in the CRTC. If the @@ -480,7 +480,7 @@ int
> rzg2l_du_modeset_init_finish(struct drm_device *dev)
>  		const struct rzg2l_du_output_routing *route =
>  			&renc->dev->info->routes[renc->output];
> 
> -		encoder->possible_crtcs = route->possible_outputs;
> +		encoder->possible_crtcs = route->possible_outputs <<
> +renc->dev->index;

If you define struct rzg2l_du_device *rcdu = renc->rcdu; in patch#5

encoder->possible_crtcs = route->possible_outputs << rcdu->index;

Cheers,
Biju


>  		encoder->possible_clones = (1 << num_encoders) - 1;
>  	}
> 
> --
> 2.54.0


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

* RE: [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs
  2026-11-13 12:20 ` [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs Tommaso Merciai
@ 2026-11-23 16:44   ` Biju Das
  0 siblings, 0 replies; 31+ messages in thread
From: Biju Das @ 2026-11-23 16:44 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs
> 
> On a SoC with several DU instances an output can be reachable from more than one of them, but a
> drm_bridge can only be attached to one encoder.
> 
> In preparation for supporting RZ/G3E, where the DSI and the LVDS channel
> 1 are reachable from both instances, let the first instance create the encoder and the others add
> their CRTC to its possible_crtcs mask, which
> rzg2l_du_modeset_init_finish() then extends rather than overwrites.
> 
> Without this the second drm_bridge_attach() fails with -EBUSY, leaving behind the encoder allocated
> just before it.
> 
> SoCs with a single instance are unaffected, as no encoder is ever already attached.
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - No changes.
> 
> v8->v9:
>  - New patch
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c | 12 ++++++++++++
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c     |  2 +-
>  2 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_encoder.c
> index 5c21c5f9fbaf..45f980ea3c20 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c
> @@ -129,6 +129,18 @@ int rzg2l_du_encoder_init(struct rzg2l_du_device  *rcdu,
>  			return -EPROBE_DEFER;
>  	}
> 
> +	/*
> +	 * A bridge can only be attached to one encoder. If another DU instance
> +	 * has already attached it, add this instance's CRTC to that encoder.
> +	 */

The shared-encoder path returns 0 without creating a connector. That is fine,
but it relies on bridge->encoder and bridge->dev being valid, so please add a 
comment about that.

Cheers,
Biju

> +	if (bridge->dev == rcdu->ddev && bridge->encoder) {
> +		const struct rzg2l_du_output_routing *route =
> +			&rcdu->info->routes[output];
> +
> +		bridge->encoder->possible_crtcs |= route->possible_outputs << rcdu->index;
> +		return 0;
> +	}
> +
>  	dev_dbg(rcdu->dev, "initializing encoder %pOF for output %s\n",
>  		enc_node, rzg2l_du_output_name(output));
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_kms.c
> index 456b29538db9..001c802539e7 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c
> @@ -480,7 +480,7 @@ int rzg2l_du_modeset_init_finish(struct drm_device *dev)
>  		const struct rzg2l_du_output_routing *route =
>  			&renc->dev->info->routes[renc->output];
> 
> -		encoder->possible_crtcs = route->possible_outputs << renc->dev->index;
> +		encoder->possible_crtcs |= route->possible_outputs <<
> +renc->dev->index;
>  		encoder->possible_clones = (1 << num_encoders) - 1;
>  	}
> 
> --
> 2.54.0


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

* RE: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
  2026-11-13 12:20 ` [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device Tommaso Merciai
@ 2026-11-23 16:59   ` Biju Das
  2026-11-24  9:20     ` Tommaso Merciai
  0 siblings, 1 reply; 31+ messages in thread
From: Biju Das @ 2026-11-23 16:59 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
> 
> On RZ/G3E two DU instances share a DRM device, which can only be created once both instances have been
> probed.
> 
> Split the DU device structure: keep the match data and the registers in a structure allocated with the
> platform device, and allocate the KMS objects with the DRM device in a new rzg2l_du_instance_init()
> helper, as they are released with it.
> 
> No functional change intended.
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 61 ++++++++++++++------
>  1 file changed, 44 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.c
> index d3cccbdf9012..d102876c07e1 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> @@ -162,6 +162,27 @@ static int rzg2l_du_pm_resume(struct device *dev)  static
> DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
>  				rzg2l_du_pm_suspend, rzg2l_du_pm_resume);
> 
> +/*
> +-----------------------------------------------------------------------
> +------
> + * DU instance
> + */
> +
> +static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> +				  struct drm_device *ddev)
> +{
> +	struct rzg2l_du_device *rcdu;
> +
> +	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> +	if (!rcdu)
> +		return -ENOMEM;

Why there is duplicate allocation of rcdu? One in probe() and here

Cheers,
Biju

> +
> +	rcdu->dev = du->dev;
> +	rcdu->info = du->info;
> +	rcdu->mmio = du->mmio;
> +	rcdu->ddev = ddev;
> +
> +	return rzg2l_du_modeset_init_du(rcdu); }
> +
>  /* -----------------------------------------------------------------------------
>   * Platform driver
>   */
> @@ -190,44 +211,48 @@ static void rzg2l_du_shutdown(struct platform_device *pdev)
> 
>  static int rzg2l_du_probe(struct platform_device *pdev)  {
> +	const struct rzg2l_du_device_info *info;
>  	struct rzg2l_du_device *rcdu;
>  	struct rzg2l_du_drm *rzgdrm;
> +	void __iomem *mmio;
>  	int ret;
> 
>  	if (drm_firmware_drivers_only())
>  		return -ENODEV;
> 
> -	/* Allocate and initialize the RZ/G2L device structure. */
> -	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> -				    struct rzg2l_du_drm, ddev);
> -	if (IS_ERR(rzgdrm))
> -		return PTR_ERR(rzgdrm);
> +	info = of_device_get_match_data(&pdev->dev);
> +
> +	/* I/O resources */
> +	mmio = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(mmio))
> +		return PTR_ERR(mmio);
> +
> +	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> +	if (ret)
> +		return ret;
> 
> -	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
> +	/* Allocate and initialize the RZ/G2L device structure. */
> +	rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL);
>  	if (!rcdu)
>  		return -ENOMEM;
> 
>  	platform_set_drvdata(pdev, rcdu);
> 
>  	rcdu->dev = &pdev->dev;
> -	rcdu->info = of_device_get_match_data(rcdu->dev);
> -	rcdu->ddev = &rzgdrm->ddev;
> -
> -	/* I/O resources */
> -	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(rcdu->mmio))
> -		return PTR_ERR(rcdu->mmio);
> +	rcdu->info = info;
> +	rcdu->mmio = mmio;
> 
> -	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> -	if (ret)
> -		return ret;
> +	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> +				    struct rzg2l_du_drm, ddev);
> +	if (IS_ERR(rzgdrm))
> +		return PTR_ERR(rzgdrm);
> 
>  	/* DRM/KMS objects */
>  	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
>  	if (ret < 0)
>  		goto error;
> 
> -	ret = rzg2l_du_modeset_init_du(rcdu);
> +	ret = rzg2l_du_instance_init(rcdu, &rzgdrm->ddev);
>  	if (ret < 0)
>  		goto error;
> 
> @@ -243,6 +268,8 @@ static int rzg2l_du_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto error_fini;
> 
> +	rcdu->ddev = &rzgdrm->ddev;
> +
>  	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
> 
>  	drm_client_setup(&rzgdrm->ddev, NULL);
> --
> 2.54.0


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

* RE: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-13 12:20 ` [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device Tommaso Merciai
@ 2026-11-24  7:47   ` Biju Das
  2026-11-24 11:53     ` Tommaso Merciai
  0 siblings, 1 reply; 31+ messages in thread
From: Biju Das @ 2026-11-24  7:47 UTC (permalink / raw)
  To: Tommaso Merciai, Tommaso Merciai, Prabhakar Mahadev Lad
  Cc: linux-renesas-soc, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	magnus.damm, Laurent Pinchart, dri-devel, devicetree,
	linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 November 2026 12:20
> Subject: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> 
> RZ/G3E has two DU instances that share a single DRM device.
> 
> Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component framework for it. The first available DU
> instance is the master and creates the DRM device, the other one binds to it as a component.
> 
> If only one DU instance is available, it creates the DRM device directly at probe time, as on SoCs
> without the flag.
> 
> Set the index of each instance to the number of CRTCs already created.
> 
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v9->v10:
>  - New patch.
> 
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
>  2 files changed, 115 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.c
> index 93d59e2cf8a4..873586f2ef28 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> @@ -7,6 +7,7 @@
>   * Based on rcar_du_drv.c
>   */
> 
> +#include <linux/component.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
> @@ -14,10 +15,12 @@
> 
>  #include <drm/clients/drm_client_setup.h>  #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_crtc.h>
>  #include <drm/drm_drv.h>
>  #include <drm/drm_fbdev_dma.h>
>  #include <drm/drm_gem_dma_helper.h>
>  #include <drm/drm_managed.h>
> +#include <drm/drm_of.h>
>  #include <drm/drm_print.h>
>  #include <drm/drm_probe_helper.h>
> 
> @@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
>  				  struct drm_device *ddev)
>  {
>  	struct rzg2l_du_device *rcdu;
> +	int ret;
> 
>  	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
>  	if (!rcdu)
> @@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
>  	rcdu->mmio = du->mmio;
>  	rcdu->ddev = ddev;
> 
> -	return rzg2l_du_modeset_init_du(rcdu);
> +	rcdu->index = ddev->mode_config.num_crtc;
> +
> +	ret = rzg2l_du_modeset_init_du(rcdu);
> +	if (ret < 0)
> +		return ret;
> +
> +	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
> +		return -EINVAL;
> +
> +	return 0;
>  }
> 
> +static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
> +				  void *data)
> +{
> +	return rzg2l_du_instance_init(dev_get_drvdata(dev), data); }
> +
> +static const struct component_ops rzg2l_du_instance_ops = {
> +	.bind = rzg2l_du_instance_bind,
> +};
> +
>  /* -----------------------------------------------------------------------------
>   * DRM device
>   */
> @@ -191,7 +214,7 @@ struct rzg2l_du_drm {
>  	struct drm_device ddev;
>  };
> 
> -static int rzg2l_du_drm_init(struct device *dev)
> +static int rzg2l_du_drm_init(struct device *dev, bool has_components)
>  {
>  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
>  	struct rzg2l_du_drm *rzgdrm;
> @@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
>  	if (ret < 0)
>  		goto error;
> 
> +	if (has_components) {
> +		ret = component_bind_all(dev, ddev);
> +		if (ret < 0)
> +			goto error;
> +	}
> +
>  	ret = rzg2l_du_modeset_init_finish(ddev);
>  	if (ret < 0)
>  		goto error_fini;
> @@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device *dev)
> 
>  error_fini:
>  	drm_kms_helper_poll_fini(ddev);
> +	if (has_components)
> +		component_unbind_all(dev, ddev);
>  error:
>  	/*
>  	 * Don't use dev_err_probe(), as it would overwrite the probe deferral @@ -246,7 +277,7 @@
> static int rzg2l_du_drm_init(struct device *dev)
>  	return ret;
>  }
> 
> -static void rzg2l_du_drm_fini(struct device *dev)
> +static void rzg2l_du_drm_fini(struct device *dev, bool has_components)
>  {
>  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
>  	struct drm_device *ddev = du->ddev;
> @@ -254,6 +285,83 @@ static void rzg2l_du_drm_fini(struct device *dev)
>  	drm_dev_unregister(ddev);
>  	drm_atomic_helper_shutdown(ddev);
>  	drm_kms_helper_poll_fini(ddev);
> +
> +	if (has_components)
> +		component_unbind_all(dev, ddev);
> +
> +	du->ddev = NULL;
> +}
> +
> +/*
> +-----------------------------------------------------------------------
> +------
> + * Component master
> + */
> +
> +static int rzg2l_du_master_bind(struct device *dev) {
> +	return rzg2l_du_drm_init(dev, true);
> +}
> +
> +static void rzg2l_du_master_unbind(struct device *dev) {
> +	rzg2l_du_drm_fini(dev, true);
> +}
> +
> +static const struct component_master_ops rzg2l_du_master_ops = {
> +	.bind = rzg2l_du_master_bind,
> +	.unbind = rzg2l_du_master_unbind,
> +};
> +
> +static int rzg2l_du_instance_probe(struct rzg2l_du_device *du) {
> +	struct component_match *match = NULL;
> +	const struct of_device_id *of_id;
> +	struct device *dev = du->dev;
> +
> +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
> +		return rzg2l_du_drm_init(dev, false);
> +
> +	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
> +		of_id = of_match_node(dev->driver->of_match_table, np);
> +		if (!of_id || of_id->data != du->info)
> +			continue;
> +
> +		/* The first available DU instance is the component master. */
> +		if (!du->is_master) {
> +			if (np != dev->of_node)
> +				return component_add(dev, &rzg2l_du_instance_ops);
> +
> +			du->is_master = true;
> +			continue;
> +		}
> +
> +		drm_of_component_match_add(dev, &match, component_compare_of, np);


The master is chosen purely by DT order. If the first available DU never probes,
the second never gets a DRM device. How do you handle this case?

Deferral from master_bind also only works via the component_add/
component_master_add_with_match return path,

Have you tested with a late-probing DSI or LVDS bridge?

Have you tested component bind/unbind/rebind of both master and slave?

Have you tested PM and shutdown on the second DU?                                                                                                                               
     du->ddev is only set on the master's platform data. The slave's PM suspend/resume and 
     shutdown therefore call the helpers with NULL

> +	}
> +
> +	if (IS_ERR(match))
> +		return PTR_ERR(match);

Why this error path cannot be inside loop?

Cheers,
Biju

> +
> +	if (!match)
> +		return rzg2l_du_drm_init(dev, false);
> +
> +	return component_master_add_with_match(dev, &rzg2l_du_master_ops,
> +match); }
> +
> +static void rzg2l_du_instance_remove(struct rzg2l_du_device *du) {
> +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT)) {
> +		rzg2l_du_drm_fini(du->dev, false);
> +		return;
> +	}
> +
> +	if (!du->is_master) {
> +		component_del(du->dev, &rzg2l_du_instance_ops);
> +		return;
> +	}
> +
> +	component_master_del(du->dev, &rzg2l_du_master_ops);
> +
> +	if (du->ddev)
> +		rzg2l_du_drm_fini(du->dev, false);
>  }
> 
>  /* -----------------------------------------------------------------------------
> @@ -262,7 +370,7 @@ static void rzg2l_du_drm_fini(struct device *dev)
> 
>  static void rzg2l_du_remove(struct platform_device *pdev)  {
> -	rzg2l_du_drm_fini(&pdev->dev);
> +	rzg2l_du_instance_remove(platform_get_drvdata(pdev));
>  }
> 
>  static void rzg2l_du_shutdown(struct platform_device *pdev) @@ -304,7 +412,7 @@ static int
> rzg2l_du_probe(struct platform_device *pdev)
>  	rcdu->info = info;
>  	rcdu->mmio = mmio;
> 
> -	return rzg2l_du_drm_init(&pdev->dev);
> +	return rzg2l_du_instance_probe(rcdu);
>  }
> 
>  static struct platform_driver rzg2l_du_platform_driver = { diff --git a/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> index 2952c9d7348b..4c2e12206d83 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> @@ -21,6 +21,7 @@ struct device;
>  struct drm_property;
> 
>  #define RZG2L_DU_FEATURE_DPIO_OE	BIT(0)	/* Has DPIO output enable control */
> +#define RZG2L_DU_FEATURE_COMPONENT	BIT(1)	/* Has several DU instances in one DRM device */
> 
>  enum rzg2l_du_output {
>  	RZG2L_DU_OUTPUT_DSI0,
> @@ -71,6 +72,7 @@ struct rzg2l_du_device {
> 
>  	struct drm_device *ddev;
>  	unsigned int index;
> +	bool is_master;
> 
>  	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
>  	unsigned int num_crtcs;
> --
> 2.54.0


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

* Re: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
  2026-11-23 16:59   ` Biju Das
@ 2026-11-24  9:20     ` Tommaso Merciai
  2026-11-24  9:33       ` Biju Das
  0 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-24  9:20 UTC (permalink / raw)
  To: Biju Das
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Biju,
Thanks for your review.

On Mon, Nov 23, 2026 at 04:59:32PM +0000, Biju Das wrote:
> Hi Tommaso,
> 
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 13 November 2026 12:20
> > Subject: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
> > 
> > On RZ/G3E two DU instances share a DRM device, which can only be created once both instances have been
> > probed.
> > 
> > Split the DU device structure: keep the match data and the registers in a structure allocated with the
> > platform device, and allocate the KMS objects with the DRM device in a new rzg2l_du_instance_init()
> > helper, as they are released with it.
> > 
> > No functional change intended.
> > 
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v9->v10:
> >  - New patch.
> > 
> >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 61 ++++++++++++++------
> >  1 file changed, 44 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_drv.c
> > index d3cccbdf9012..d102876c07e1 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > @@ -162,6 +162,27 @@ static int rzg2l_du_pm_resume(struct device *dev)  static
> > DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
> >  				rzg2l_du_pm_suspend, rzg2l_du_pm_resume);
> > 
> > +/*
> > +-----------------------------------------------------------------------
> > +------
> > + * DU instance
> > + */
> > +
> > +static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > +				  struct drm_device *ddev)
> > +{
> > +	struct rzg2l_du_device *rcdu;
> > +
> > +	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > +	if (!rcdu)
> > +		return -ENOMEM;
> 
> Why there is duplicate allocation of rcdu? One in probe() and here

The two allocations have different lifetimes.

The one in rzg2l_du_probe() is tied to the platform device. It holds
what is needed before the DRM device exists and outside of the
component bind (dev, info, mmio, and ddev/is_master for the master,
PM and remove), as on RZ/G3E the DRM device is only created once both
instances have been probed.

The one in rzg2l_du_instance_init() holds the KMS objects (crtcs, vsps,
lvds, index). Their drmm cleanup handlers point into it and run when
the DRM device is released, which can happen after the platform device
has been unbound, so it has to be allocated with the DRM device.

Thanks, Tommaso

> 
> Cheers,
> Biju
> 
> > +
> > +	rcdu->dev = du->dev;
> > +	rcdu->info = du->info;
> > +	rcdu->mmio = du->mmio;
> > +	rcdu->ddev = ddev;
> > +
> > +	return rzg2l_du_modeset_init_du(rcdu); }
> > +
> >  /* -----------------------------------------------------------------------------
> >   * Platform driver
> >   */
> > @@ -190,44 +211,48 @@ static void rzg2l_du_shutdown(struct platform_device *pdev)
> > 
> >  static int rzg2l_du_probe(struct platform_device *pdev)  {
> > +	const struct rzg2l_du_device_info *info;
> >  	struct rzg2l_du_device *rcdu;
> >  	struct rzg2l_du_drm *rzgdrm;
> > +	void __iomem *mmio;
> >  	int ret;
> > 
> >  	if (drm_firmware_drivers_only())
> >  		return -ENODEV;
> > 
> > -	/* Allocate and initialize the RZ/G2L device structure. */
> > -	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> > -				    struct rzg2l_du_drm, ddev);
> > -	if (IS_ERR(rzgdrm))
> > -		return PTR_ERR(rzgdrm);
> > +	info = of_device_get_match_data(&pdev->dev);
> > +
> > +	/* I/O resources */
> > +	mmio = devm_platform_ioremap_resource(pdev, 0);
> > +	if (IS_ERR(mmio))
> > +		return PTR_ERR(mmio);
> > +
> > +	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> > +	if (ret)
> > +		return ret;
> > 
> > -	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
> > +	/* Allocate and initialize the RZ/G2L device structure. */
> > +	rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL);
> >  	if (!rcdu)
> >  		return -ENOMEM;
> > 
> >  	platform_set_drvdata(pdev, rcdu);
> > 
> >  	rcdu->dev = &pdev->dev;
> > -	rcdu->info = of_device_get_match_data(rcdu->dev);
> > -	rcdu->ddev = &rzgdrm->ddev;
> > -
> > -	/* I/O resources */
> > -	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
> > -	if (IS_ERR(rcdu->mmio))
> > -		return PTR_ERR(rcdu->mmio);
> > +	rcdu->info = info;
> > +	rcdu->mmio = mmio;
> > 
> > -	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> > -	if (ret)
> > -		return ret;
> > +	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> > +				    struct rzg2l_du_drm, ddev);
> > +	if (IS_ERR(rzgdrm))
> > +		return PTR_ERR(rzgdrm);
> > 
> >  	/* DRM/KMS objects */
> >  	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
> >  	if (ret < 0)
> >  		goto error;
> > 
> > -	ret = rzg2l_du_modeset_init_du(rcdu);
> > +	ret = rzg2l_du_instance_init(rcdu, &rzgdrm->ddev);
> >  	if (ret < 0)
> >  		goto error;
> > 
> > @@ -243,6 +268,8 @@ static int rzg2l_du_probe(struct platform_device *pdev)
> >  	if (ret)
> >  		goto error_fini;
> > 
> > +	rcdu->ddev = &rzgdrm->ddev;
> > +
> >  	drm_info(&rzgdrm->ddev, "Device %s probed\n", dev_name(&pdev->dev));
> > 
> >  	drm_client_setup(&rzgdrm->ddev, NULL);
> > --
> > 2.54.0
> 

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

* RE: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
  2026-11-24  9:20     ` Tommaso Merciai
@ 2026-11-24  9:33       ` Biju Das
  2026-11-24 11:59         ` Tommaso Merciai
  0 siblings, 1 reply; 31+ messages in thread
From: Biju Das @ 2026-11-24  9:33 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 24 November 2026 09:21
> Subject: Re: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
> 
> Hi Biju,
> Thanks for your review.
> 
> On Mon, Nov 23, 2026 at 04:59:32PM +0000, Biju Das wrote:
> > Hi Tommaso,
> >
> > > -----Original Message-----
> > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > Sent: 13 November 2026 12:20
> > > Subject: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU
> > > instance from the DRM device
> > >
> > > On RZ/G3E two DU instances share a DRM device, which can only be
> > > created once both instances have been probed.
> > >
> > > Split the DU device structure: keep the match data and the registers
> > > in a structure allocated with the platform device, and allocate the
> > > KMS objects with the DRM device in a new rzg2l_du_instance_init() helper, as they are released
> with it.
> > >
> > > No functional change intended.
> > >
> > > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > ---
> > > v9->v10:
> > >  - New patch.
> > >
> > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 61
> > > ++++++++++++++------
> > >  1 file changed, 44 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > b/drivers/gpu/drm/renesas/rz- du/rzg2l_du_drv.c index
> > > d3cccbdf9012..d102876c07e1 100644
> > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > @@ -162,6 +162,27 @@ static int rzg2l_du_pm_resume(struct device
> > > *dev)  static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
> > >  				rzg2l_du_pm_suspend, rzg2l_du_pm_resume);
> > >
> > > +/*
> > > +-------------------------------------------------------------------
> > > +----
> > > +------
> > > + * DU instance
> > > + */
> > > +
> > > +static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > +				  struct drm_device *ddev)
> > > +{
> > > +	struct rzg2l_du_device *rcdu;
> > > +
> > > +	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > > +	if (!rcdu)
> > > +		return -ENOMEM;
> >
> > Why there is duplicate allocation of rcdu? One in probe() and here
> 
> The two allocations have different lifetimes.
> 
> The one in rzg2l_du_probe() is tied to the platform device. It holds what is needed before the DRM
> device exists and outside of the component bind (dev, info, mmio, and ddev/is_master for the master,
> PM and remove), as on RZ/G3E the DRM device is only created once both instances have been probed.
> 
> The one in rzg2l_du_instance_init() holds the KMS objects (crtcs, vsps, lvds, index). Their drmm
> cleanup handlers point into it and run when the DRM device is released, which can happen after the
> platform device has been unbound, so it has to be allocated with the DRM device.

Then there is an issue right, platform unbound will unmap mmio and other data structures it allocated
in rzg2l_du_probe()and drm driver is using after that( Use after free Bug)

Cheers,
Biju

> 
> Thanks, Tommaso
> 
> >
> > Cheers,
> > Biju
> >
> > > +
> > > +	rcdu->dev = du->dev;
> > > +	rcdu->info = du->info;
> > > +	rcdu->mmio = du->mmio;
> > > +	rcdu->ddev = ddev;
> > > +
> > > +	return rzg2l_du_modeset_init_du(rcdu); }
> > > +
> > >  /* -----------------------------------------------------------------------------
> > >   * Platform driver
> > >   */
> > > @@ -190,44 +211,48 @@ static void rzg2l_du_shutdown(struct
> > > platform_device *pdev)
> > >
> > >  static int rzg2l_du_probe(struct platform_device *pdev)  {
> > > +	const struct rzg2l_du_device_info *info;
> > >  	struct rzg2l_du_device *rcdu;
> > >  	struct rzg2l_du_drm *rzgdrm;
> > > +	void __iomem *mmio;
> > >  	int ret;
> > >
> > >  	if (drm_firmware_drivers_only())
> > >  		return -ENODEV;
> > >
> > > -	/* Allocate and initialize the RZ/G2L device structure. */
> > > -	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> > > -				    struct rzg2l_du_drm, ddev);
> > > -	if (IS_ERR(rzgdrm))
> > > -		return PTR_ERR(rzgdrm);
> > > +	info = of_device_get_match_data(&pdev->dev);
> > > +
> > > +	/* I/O resources */
> > > +	mmio = devm_platform_ioremap_resource(pdev, 0);
> > > +	if (IS_ERR(mmio))
> > > +		return PTR_ERR(mmio);
> > > +
> > > +	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> > > +	if (ret)
> > > +		return ret;
> > >
> > > -	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
> > > +	/* Allocate and initialize the RZ/G2L device structure. */
> > > +	rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL);
> > >  	if (!rcdu)
> > >  		return -ENOMEM;
> > >
> > >  	platform_set_drvdata(pdev, rcdu);
> > >
> > >  	rcdu->dev = &pdev->dev;
> > > -	rcdu->info = of_device_get_match_data(rcdu->dev);
> > > -	rcdu->ddev = &rzgdrm->ddev;
> > > -
> > > -	/* I/O resources */
> > > -	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
> > > -	if (IS_ERR(rcdu->mmio))
> > > -		return PTR_ERR(rcdu->mmio);
> > > +	rcdu->info = info;
> > > +	rcdu->mmio = mmio;
> > >
> > > -	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> > > -	if (ret)
> > > -		return ret;
> > > +	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> > > +				    struct rzg2l_du_drm, ddev);
> > > +	if (IS_ERR(rzgdrm))
> > > +		return PTR_ERR(rzgdrm);
> > >
> > >  	/* DRM/KMS objects */
> > >  	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
> > >  	if (ret < 0)
> > >  		goto error;
> > >
> > > -	ret = rzg2l_du_modeset_init_du(rcdu);
> > > +	ret = rzg2l_du_instance_init(rcdu, &rzgdrm->ddev);
> > >  	if (ret < 0)
> > >  		goto error;
> > >
> > > @@ -243,6 +268,8 @@ static int rzg2l_du_probe(struct platform_device *pdev)
> > >  	if (ret)
> > >  		goto error_fini;
> > >
> > > +	rcdu->ddev = &rzgdrm->ddev;
> > > +
> > >  	drm_info(&rzgdrm->ddev, "Device %s probed\n",
> > > dev_name(&pdev->dev));
> > >
> > >  	drm_client_setup(&rzgdrm->ddev, NULL);
> > > --
> > > 2.54.0
> >

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

* Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-24  7:47   ` Biju Das
@ 2026-11-24 11:53     ` Tommaso Merciai
  2026-11-24 13:18       ` Biju Das
  0 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-24 11:53 UTC (permalink / raw)
  To: Biju Das
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Biju,
Thanks for your review.

On Tue, Nov 24, 2026 at 07:47:04AM +0000, Biju Das wrote:
> Hi Tommaso,
> 
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 13 November 2026 12:20
> > Subject: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> > 
> > RZ/G3E has two DU instances that share a single DRM device.
> > 
> > Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component framework for it. The first available DU
> > instance is the master and creates the DRM device, the other one binds to it as a component.
> > 
> > If only one DU instance is available, it creates the DRM device directly at probe time, as on SoCs
> > without the flag.
> > 
> > Set the index of each instance to the number of CRTCs already created.
> > 
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v9->v10:
> >  - New patch.
> > 
> >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
> >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
> >  2 files changed, 115 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_drv.c
> > index 93d59e2cf8a4..873586f2ef28 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > @@ -7,6 +7,7 @@
> >   * Based on rcar_du_drv.c
> >   */
> > 
> > +#include <linux/component.h>
> >  #include <linux/dma-mapping.h>
> >  #include <linux/module.h>
> >  #include <linux/of.h>
> > @@ -14,10 +15,12 @@
> > 
> >  #include <drm/clients/drm_client_setup.h>  #include <drm/drm_atomic_helper.h>
> > +#include <drm/drm_crtc.h>
> >  #include <drm/drm_drv.h>
> >  #include <drm/drm_fbdev_dma.h>
> >  #include <drm/drm_gem_dma_helper.h>
> >  #include <drm/drm_managed.h>
> > +#include <drm/drm_of.h>
> >  #include <drm/drm_print.h>
> >  #include <drm/drm_probe_helper.h>
> > 
> > @@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> >  				  struct drm_device *ddev)
> >  {
> >  	struct rzg2l_du_device *rcdu;
> > +	int ret;
> > 
> >  	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> >  	if (!rcdu)
> > @@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> >  	rcdu->mmio = du->mmio;
> >  	rcdu->ddev = ddev;
> > 
> > -	return rzg2l_du_modeset_init_du(rcdu);
> > +	rcdu->index = ddev->mode_config.num_crtc;
> > +
> > +	ret = rzg2l_du_modeset_init_du(rcdu);
> > +	if (ret < 0)
> > +		return ret;
> > +
> > +	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
> > +		return -EINVAL;
> > +
> > +	return 0;
> >  }
> > 
> > +static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
> > +				  void *data)
> > +{
> > +	return rzg2l_du_instance_init(dev_get_drvdata(dev), data); }
> > +
> > +static const struct component_ops rzg2l_du_instance_ops = {
> > +	.bind = rzg2l_du_instance_bind,
> > +};
> > +
> >  /* -----------------------------------------------------------------------------
> >   * DRM device
> >   */
> > @@ -191,7 +214,7 @@ struct rzg2l_du_drm {
> >  	struct drm_device ddev;
> >  };
> > 
> > -static int rzg2l_du_drm_init(struct device *dev)
> > +static int rzg2l_du_drm_init(struct device *dev, bool has_components)
> >  {
> >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> >  	struct rzg2l_du_drm *rzgdrm;
> > @@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
> >  	if (ret < 0)
> >  		goto error;
> > 
> > +	if (has_components) {
> > +		ret = component_bind_all(dev, ddev);
> > +		if (ret < 0)
> > +			goto error;
> > +	}
> > +
> >  	ret = rzg2l_du_modeset_init_finish(ddev);
> >  	if (ret < 0)
> >  		goto error_fini;
> > @@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device *dev)
> > 
> >  error_fini:
> >  	drm_kms_helper_poll_fini(ddev);
> > +	if (has_components)
> > +		component_unbind_all(dev, ddev);
> >  error:
> >  	/*
> >  	 * Don't use dev_err_probe(), as it would overwrite the probe deferral @@ -246,7 +277,7 @@
> > static int rzg2l_du_drm_init(struct device *dev)
> >  	return ret;
> >  }
> > 
> > -static void rzg2l_du_drm_fini(struct device *dev)
> > +static void rzg2l_du_drm_fini(struct device *dev, bool has_components)
> >  {
> >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> >  	struct drm_device *ddev = du->ddev;
> > @@ -254,6 +285,83 @@ static void rzg2l_du_drm_fini(struct device *dev)
> >  	drm_dev_unregister(ddev);
> >  	drm_atomic_helper_shutdown(ddev);
> >  	drm_kms_helper_poll_fini(ddev);
> > +
> > +	if (has_components)
> > +		component_unbind_all(dev, ddev);
> > +
> > +	du->ddev = NULL;
> > +}
> > +
> > +/*
> > +-----------------------------------------------------------------------
> > +------
> > + * Component master
> > + */
> > +
> > +static int rzg2l_du_master_bind(struct device *dev) {
> > +	return rzg2l_du_drm_init(dev, true);
> > +}
> > +
> > +static void rzg2l_du_master_unbind(struct device *dev) {
> > +	rzg2l_du_drm_fini(dev, true);
> > +}
> > +
> > +static const struct component_master_ops rzg2l_du_master_ops = {
> > +	.bind = rzg2l_du_master_bind,
> > +	.unbind = rzg2l_du_master_unbind,
> > +};
> > +
> > +static int rzg2l_du_instance_probe(struct rzg2l_du_device *du) {
> > +	struct component_match *match = NULL;
> > +	const struct of_device_id *of_id;
> > +	struct device *dev = du->dev;
> > +
> > +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
> > +		return rzg2l_du_drm_init(dev, false);
> > +
> > +	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
> > +		of_id = of_match_node(dev->driver->of_match_table, np);
> > +		if (!of_id || of_id->data != du->info)
> > +			continue;
> > +
> > +		/* The first available DU instance is the component master. */
> > +		if (!du->is_master) {
> > +			if (np != dev->of_node)
> > +				return component_add(dev, &rzg2l_du_instance_ops);
> > +
> > +			du->is_master = true;
> > +			continue;
> > +		}
> > +
> > +		drm_of_component_match_add(dev, &match, component_compare_of, np);
> 
> 
> The master is chosen purely by DT order. If the first available DU never probes,
> the second never gets a DRM device. How do you handle this case?

All available instances are part of the component match, so the DRM
device is only created once all of them have probed, whichever one is
the master. 

This is how the component framework works.

To use a single DU, the other one can be disabled in DT, in this case
the remaining instance becomes the master and initializes the DRM
device on its own.

> 
> Deferral from master_bind also only works via the component_add/
> component_master_add_with_match return path,

Yes, the bind is attempted from the probe of the last instance completing
the match, and -EPROBE_DEFER is returned from that probe, which is then
retried.


> 
> Have you tested with a late-probing DSI or LVDS bridge?

---------------------------------------------------------------------
Test has been done with later patches were DSI support and pm support
will be introduced:
	
	(DU0 | DU1) -> DSI
---------------------------------------------------------------------



For late-probing testing tI've blacklisted the followings driver:

modprobe.blacklist=rzg2l_du_drm,rzg2l_mipi_dsi,adv7511

modprobe rzg2l_du_drm
modprobe rzg2l_mipi_dsi 
modprobe adv7511

modetest -M rzg2l-du

modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24

logs:
root@smarc-rzg3e:~# modprobe rzg2l_du_drm
root@smarc-rzg3e:~# modprobe rzg2l_mipi_dsi
root@smarc-rzg3e:~# modprobe adv7511

[   34.097032] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[   34.107851] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[   34.114977] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[   34.251434] Console: switching to colour frame buffer device 240x67
[   34.301448] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device
[   34.305835] systemd-journald[202]: Successfully sent stream file descriptor to service manager.

root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~# modetest -M rzg2l-du
Encoders:
id      crtc    type    possible crtcs  possible clones
46      45      none    0x00000003      0x00000001

Connectors:
id      encoder status          name            size (mm)       modes   encoders
47      46      connected       HDMI-A-1        700x390         30      46
  modes:
        index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  #1 1920x1080 59.94 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  #2 1920x1080 50.00 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  #3 1680x1050 59.88 1680 1728 1760 1840 1050 1053 1059 1080 119000 flags: phsync, nvsync; type: driver
  #4 1600x900 60.00 1600 1624 1704 1800 900 901 904 1000 108000 flags: phsync, pvsync; type: driver
  #5 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  #6 1280x1024 60.02 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  #7 1440x900 59.90 1440 1488 1520 1600 900 903 909 926 88750 flags: phsync, nvsync; type: driver
  #8 1280x800 59.91 1280 1328 1360 1440 800 803 809 823 71000 flags: phsync, nvsync; type: driver
  #9 1152x864 75.00 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  #10 1280x720 60.00 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #11 1280x720 59.94 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  #12 1280x720 50.00 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #13 1024x768 75.03 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  #14 1024x768 70.07 1024 1048 1184 1328 768 771 777 806 75000 flags: nhsync, nvsync; type: driver
  #15 1024x768 60.00 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  #16 832x624 74.55 832 864 928 1152 624 625 628 667 57284 flags: nhsync, nvsync; type: driver
  #17 800x600 75.00 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  #18 800x600 72.19 800 856 976 1040 600 637 643 666 50000 flags: phsync, pvsync; type: driver
  #19 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  #20 800x600 56.25 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
  #21 720x576 50.00 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  #22 720x480 60.00 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  #23 720x480 59.94 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  #24 640x480 75.00 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  #25 640x480 72.81 640 664 704 832 480 489 492 520 31500 flags: nhsync, nvsync; type: driver
  #26 640x480 66.67 640 704 768 864 480 483 486 525 30240 flags: nhsync, nvsync; type: driver
  #27 640x480 60.00 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  #28 640x480 59.94 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  #29 720x400 70.08 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff004c2d0070324e4e34
                        0e1f0103804627782a1c02a853459623
                        1b4d58bfef80714f81c0810081809500
                        a9c0b3000101023a801871382d40582c
                        4500ba892100001e000000fd00324b1e
                        5112000a202020202020000000fc0043
                        3332523530780a2020202020000000ff
                        00483443523430303033345a002001f3
                        02031af14690041f1312032309070783
                        01000066030c00100080023a80d07238
                        2d40102c4580ba892100001e011d0072
                        51d01e206e285500ba892100001e011d
                        00bc52d01e20b8285540ba892100001e
                        8c0ad08a20e02d10103e9600ba892100
                        00182a4480a07038274030203500ba89
                        2100001a00000000000000000000002c
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
        7 non-desktop:
                flags: immutable range
                values: 0 1
                value: 0
        4 TILE:
                flags: immutable blob
                blobs:

                value:
        48 max bpc:
                flags: range
                values: 8 8
                value: 8
        49 color format:
                flags: enum
                enums: AUTO=0 RGB=1
                value: 0

CRTCs:
id      fb      pos     size
45      71      (0,0)   (1920x1080)
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0
60      0       (0,0)   (0x0)
  #0  nan 0 0 0 0 0 0 0 0 0 flags: ; type:
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
35      45      71      0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        37 alpha:
                flags: range
                values: 0 65535
                value: 65535
        38 zpos:
                flags: range
                values: 0 1
                value: 0
        39 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
40      0       0       0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        42 alpha:
                flags: range
                values: 0 65535
                value: 65535
        43 zpos:
                flags: range
                values: 0 1
                value: 1
        44 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
50      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        52 alpha:
                flags: range
                values: 0 65535
                value: 65535
        53 zpos:
                flags: range
                values: 0 1
                value: 0
        54 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
55      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        57 alpha:
                flags: range
                values: 0 65535
                value: 65535
        58 zpos:
                flags: range
                values: 0 1
                value: 1
        59 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0

Frame buffers:
id      size    pitch


modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 45

modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 60

> 
> Have you tested component bind/unbind/rebind of both master and slave?

For bind/unbind/rebind testing:

echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/unbind;
echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/bind

modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24

echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/unbind
echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/bind

modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
	

logs below:

root@smarc-rzg3e:~# killall weston
root@smarc-rzg3e:~# [   41.334337] systemd-journald[200]: Successfully sent stream file descriptor to service manager.
echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/unbind
[   46.426867] Console: switching to colour dummy device 80x25
root@smarc-rzg3e:~# echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/bind
[   49.070454] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[   49.080934] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[   49.088044] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[   49.279781] Console: switching to colour frame buffer device 240x67
[   49.330057] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device
root@smarc-rzg3e:~# [   49.363063] systemd-journald[200]: Successfully sent stream file descriptor to service manager.

root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~# [   50.534177] kauditd_printk_skb: 5 callbacks suppressed
[   50.534192] audit: type=1334 audit(946684832.568:22): prog-id=18 op=UNLOAD
[   50.546285] audit: type=1334 audit(946684832.568:23): prog-id=17 op=UNLOAD
[   50.553146] audit: type=1334 audit(946684832.568:24): prog-id=16 op=UNLOAD
echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/unbind[   51.133730]

[   51.626775] Console: switching to colour dummy device 80x25
root@smarc-rzg3e:~# echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/bind
[   53.269741] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[   53.280220] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[   53.287318] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[   53.479225] Console: switching to colour frame buffer device 240x67
[   53.529185] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device
root@smarc-rzg3e:~# [   53.539745] systemd-journald[200]: Successfully sent stream file descriptor to service manager.

root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~# echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/unbind
[   57.766813] Console: switching to colour dummy device 80x25
[   57.815545] systemd-journald[200]: Data hash table of /run/log/journal/02e142bc802e4550b9efefd2285280e1/system.journal has a fill level at 75.0 (10924 of 14563 items, 8388608 file size, 7
67 bytes per hash table item), suggesting rotation.
[   57.836680] systemd-journald[200]: /run/log/journal/02e142bc802e4550b9efefd2285280e1/system.journal: Journal header limits reached or header out-of-date, rotating.
[   57.851259] systemd-journald[200]: Rotating...
[   57.856364] systemd-journald[200]: Reserving 333 entries in field hash table.
root@smarc-rzg3e:~# [   57.869671] systemd-journald[200]: Reserving 14563 entries in data hash table.
[   57.877270] systemd-journald[200]: Vacuuming...
[   57.882656] systemd-journald[200]: Vacuuming done, freed 0B of archived journals from /run/log/journal/02e142bc802e4550b9efefd2285280e1.
echo 16460000.display > /sys/bus/platform/drivers/rzg2l-du/bind
[   59.169758] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[   59.180273] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[   59.187363] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[   59.379197] Console: switching to colour frame buffer device 240x67
[   59.429414] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device
root@smarc-rzg3e:~# [   59.464090] systemd-journald[200]: Successfully sent stream file descriptor to service manager.

root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 45

root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 60



echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/unbind;
[  111.818673] Console: switching to colour dummy device 80x25
root@smarc-rzg3e:~# echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/unbind;^C
root@smarc-rzg3e:~# echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/bind
[  117.530345] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[  117.543450] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[  117.550564] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[  117.742291] Console: switching to colour frame buffer device 240x67
[  117.792105] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device
[  117.795892] systemd-journald[200]: Successfully sent stream file descriptor to service manager.
root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~#
root@smarc-rzg3e:~# echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/unbind;
[  121.578706] Console: switching to colour dummy device 80x25
root@smarc-rzg3e:~# echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/bind
[  122.881739] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[  122.892215] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[  122.899310] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[  123.091215] Console: switching to colour frame buffer device 240x67
[  123.141287] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device
[  123.146450] systemd-journald[200]: Successfully sent stream file descriptor to service manager.
root@smarc-rzg3e:~# echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/unbind;
[  124.526683] Console: switching to colour dummy device 80x25
root@smarc-rzg3e:~# echo 16490000.display > /sys/bus/platform/drivers/rzg2l-du/bind
[  125.643119] rzg2l-du 16460000.display: bound 16490000.display (ops rzg2l_du_instance_ops [rzg2l_du_drm])
[  125.653626] [drm] Initialized rzg2l-du 1.0.0 for 16460000.display on minor 1
[  125.660745] rzg2l-du 16460000.display: [drm] Device 16460000.display probed
[  125.668228] rzg2l-du 16460000.display: [drm] Cannot find any crtc or sizes
[  125.675588] rzg2l-du 16460000.display: [drm] Cannot find any crtc or sizes
[  126.298364] Console: switching to colour frame buffer device 240x67
[  126.348428] rzg2l-du 16460000.display: [drm] fb0: rzg2l-dudrmfb frame buffer device


root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 45

root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 60

> 
> Have you tested PM and shutdown on the second DU?                                                                                                                               
>      du->ddev is only set on the master's platform data. The slave's PM suspend/resume and 
>      shutdown therefore call the helpers with NULL

For pm testing:

killall weston
modetest -M rzg2l-du

modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24

echo s2idle > /sys/power/mem_sleep
echo mem > /sys/power/state

modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24

echo deep > /sys/power/mem_sleep
echo mem > /sys/power/state

logs below:


root@smarc-rzg3e:~# killall weston
root@smarc-rzg3e:~# modetest -M rzg2l-du
Encoders:
id      crtc    type    possible crtcs  possible clones
46      45      none    0x00000003      0x00000001

Connectors:
id      encoder status          name            size (mm)       modes   encoders
47      46      connected       HDMI-A-1        700x390         30      46
  modes:
        index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  #1 1920x1080 59.94 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  #2 1920x1080 50.00 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  #3 1680x1050 59.88 1680 1728 1760 1840 1050 1053 1059 1080 119000 flags: phsync, nvsync; type: driver
  #4 1600x900 60.00 1600 1624 1704 1800 900 901 904 1000 108000 flags: phsync, pvsync; type: driver
  #5 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  #6 1280x1024 60.02 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  #7 1440x900 59.90 1440 1488 1520 1600 900 903 909 926 88750 flags: phsync, nvsync; type: driver
  #8 1280x800 59.91 1280 1328 1360 1440 800 803 809 823 71000 flags: phsync, nvsync; type: driver
  #9 1152x864 75.00 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  #10 1280x720 60.00 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #11 1280x720 59.94 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  #12 1280x720 50.00 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #13 1024x768 75.03 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  #14 1024x768 70.07 1024 1048 1184 1328 768 771 777 806 75000 flags: nhsync, nvsync; type: driver
  #15 1024x768 60.00 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  #16 832x624 74.55 832 864 928 1152 624 625 628 667 57284 flags: nhsync, nvsync; type: driver
  #17 800x600 75.00 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  #18 800x600 72.19 800 856 976 1040 600 637 643 666 50000 flags: phsync, pvsync; type: driver
  #19 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  #20 800x600 56.25 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
  #21 720x576 50.00 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  #22 720x480 60.00 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  #23 720x480 59.94 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  #24 640x480 75.00 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  #25 640x480 72.81 640 664 704 832 480 489 492 520 31500 flags: nhsync, nvsync; type: driver
  #26 640x480 66.67 640 704 768 864 480 483 486 525 30240 flags: nhsync, nvsync; type: driver
  #27 640x480 60.00 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  #28 640x480 59.94 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  #29 720x400 70.08 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff004c2d0070324e4e34
                        0e1f0103804627782a1c02a853459623
                        1b4d58bfef80714f81c0810081809500
                        a9c0b3000101023a801871382d40582c
                        4500ba892100001e000000fd00324b1e
                        5112000a202020202020000000fc0043
                        3332523530780a2020202020000000ff
                        00483443523430303033345a002001f3
                        02031af14690041f1312032309070783
                        01000066030c00100080023a80d07238
                        2d40102c4580ba892100001e011d0072
                        51d01e206e285500ba892100001e011d
                        00bc52d01e20b8285540ba892100001e
                        8c0ad08a20e02d10103e9600ba892100
                        00182a4480a07038274030203500ba89
                        2100001a00000000000000000000002c
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
        7 non-desktop:
                flags: immutable range
                values: 0 1
                value: 0
        4 TILE:
                flags: immutable blob
                blobs:

                value:
        48 max bpc:
                flags: range
                values: 8 8
                value: 8
        49 color format:
                flags: enum
                enums: AUTO=0 RGB=1
                value: 0

CRTCs:
id      fb      pos     size
45      62      (0,0)   (1920x1080)
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0
60      0       (0,0)   (0x0)
  #0  nan 0 0 0 0 0 0 0 0 0 flags: ; type: 
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
35      45      62      0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        37 alpha:
                flags: range
                values: 0 65535
                value: 65535
        38 zpos:
                flags: range
                values: 0 1
                value: 0
        39 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
40      0       0       0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        42 alpha:
                flags: range
                values: 0 65535
                value: 65535
        43 zpos:
                flags: range
                values: 0 1
                value: 1
        44 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
50      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        52 alpha:
                flags: range
                values: 0 65535
                value: 65535
        53 zpos:
                flags: range
                values: 0 1
                value: 0
        54 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
55      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        57 alpha:
                flags: range
                values: 0 65535
                value: 65535
        58 zpos:
                flags: range
                values: 0 1
                value: 1
        59 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0

Frame buffers:
id      size    pitch

root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 45
[   44.559633] systemd-journald[202]: Successfully sent stream file descriptor to service manager.
^C
root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 60
[   50.450287] kauditd_printk_skb: 5 callbacks suppressed
[   50.450302] audit: type=1334 audit(946684832.636:22): prog-id=18 op=UNLOAD
[   50.462403] audit: type=1334 audit(946684832.636:23): prog-id=17 op=UNLOAD
[   50.469318] audit: type=1334 audit(946684832.636:24): prog-id=16 op=UNLOAD
^C
root@smarc-rzg3e:~# echo s2idle > /sys/power/mem_sleep
root@smarc-rzg3e:~# echo mem > /sys/power/state
[   55.950242] PM: suspend entry (s2idle)
[   55.954103] Filesystems sync: 0.000 seconds
[   55.964559] Freezing user space processes
[   55.970155] Freezing user space processes completed (elapsed 0.001 seconds)
[   55.977115] OOM killer disabled.
[   55.980337] Freezing remaining freezable tasks
[   55.986028] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   56.116254] renesas-gbeth 15c30000.ethernet end0: Link is Down
[   58.164169] dwmac4: Master AXI performs any burst length
[   58.169653] renesas-gbeth 15c30000.ethernet end0: No Safety Features support found
[   58.177374] renesas-gbeth 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
[   58.186087] renesas-gbeth 15c30000.ethernet end0: configuring for phy/rgmii-id link mode
[   58.203707] dwmac4: Master AXI performs any burst length
[   58.209154] renesas-gbeth 15c40000.ethernet end1: No Safety Features support found
[   58.216866] renesas-gbeth 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
[   58.225526] renesas-gbeth 15c40000.ethernet end1: configuring for phy/rgmii-id link mode
[   58.281889] usb usb1: root hub lost power or was reset
[   58.287057] usb usb2: root hub lost power or was reset
[   58.368314] usb usb5: root hub lost power or was reset
[   58.373641] usb usb6: root hub lost power or was reset
[   58.456301] usb usb4: root hub lost power or was reset
[   58.461640] usb usb3: root hub lost power or was reset
[   58.666593] usb 6-1: reset high-speed USB device number 2 using ehci-platform
[   58.926707] OOM killer enabled.
[   58.929875] Restarting tasks: Starting
[   58.934849] Restarting tasks: Done
[   58.939359] random: crng reseeded on system resumption
[   58.951835] PM: suspend exit
root@smarc-rzg3e:~# [   60.725440] renesas-gbeth 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control off

root@smarc-rzg3e:~# 
root@smarc-rzg3e:~# 
root@smarc-rzg3e:~# 
root@smarc-rzg3e:~# modetest -M rzg2l-du
Encoders:
id      crtc    type    possible crtcs  possible clones
46      45      none    0x00000003      0x00000001

Connectors:
id      encoder status          name            size (mm)       modes   encoders
47      46      connected       HDMI-A-1        700x390         30      46
  modes:
        index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  #1 1920x1080 59.94 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  #2 1920x1080 50.00 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  #3 1680x1050 59.88 1680 1728 1760 1840 1050 1053 1059 1080 119000 flags: phsync, nvsync; type: driver
  #4 1600x900 60.00 1600 1624 1704 1800 900 901 904 1000 108000 flags: phsync, pvsync; type: driver
  #5 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  #6 1280x1024 60.02 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  #7 1440x900 59.90 1440 1488 1520 1600 900 903 909 926 88750 flags: phsync, nvsync; type: driver
  #8 1280x800 59.91 1280 1328 1360 1440 800 803 809 823 71000 flags: phsync, nvsync; type: driver
  #9 1152x864 75.00 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  #10 1280x720 60.00 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #11 1280x720 59.94 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  #12 1280x720 50.00 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #13 1024x768 75.03 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  #14 1024x768 70.07 1024 1048 1184 1328 768 771 777 806 75000 flags: nhsync, nvsync; type: driver
  #15 1024x768 60.00 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  #16 832x624 74.55 832 864 928 1152 624 625 628 667 57284 flags: nhsync, nvsync; type: driver
  #17 800x600 75.00 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  #18 800x600 72.19 800 856 976 1040 600 637 643 666 50000 flags: phsync, pvsync; type: driver
  #19 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  #20 800x600 56.25 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
  #21 720x576 50.00 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  #22 720x480 60.00 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  #23 720x480 59.94 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  #24 640x480 75.00 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  #25 640x480 72.81 640 664 704 832 480 489 492 520 31500 flags: nhsync, nvsync; type: driver
  #26 640x480 66.67 640 704 768 864 480 483 486 525 30240 flags: nhsync, nvsync; type: driver
  #27 640x480 60.00 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  #28 640x480 59.94 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  #29 720x400 70.08 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff004c2d0070324e4e34
                        0e1f0103804627782a1c02a853459623
                        1b4d58bfef80714f81c0810081809500
                        a9c0b3000101023a801871382d40582c
                        4500ba892100001e000000fd00324b1e
                        5112000a202020202020000000fc0043
                        3332523530780a2020202020000000ff
                        00483443523430303033345a002001f3
                        02031af14690041f1312032309070783
                        01000066030c00100080023a80d07238
                        2d40102c4580ba892100001e011d0072
                        51d01e206e285500ba892100001e011d
                        00bc52d01e20b8285540ba892100001e
                        8c0ad08a20e02d10103e9600ba892100
                        00182a4480a07038274030203500ba89
                        2100001a00000000000000000000002c
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
        7 non-desktop:
                flags: immutable range
                values: 0 1
                value: 0
        4 TILE:
                flags: immutable blob
                blobs:

                value:
        48 max bpc:
                flags: range
                values: 8 8
                value: 8
        49 color format:
                flags: enum
                enums: AUTO=0 RGB=1
                value: 0

CRTCs:
id      fb      pos     size
45      62      (0,0)   (1920x1080)
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0
60      0       (0,0)   (0x0)
  #0  nan 0 0 0 0 0 0 0 0 0 flags: ; type: 
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
35      45      62      0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        37 alpha:
                flags: range
                values: 0 65535
                value: 65535
        38 zpos:
                flags: range
                values: 0 1
                value: 0
        39 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
40      0       0       0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        42 alpha:
                flags: range
                values: 0 65535
                value: 65535
        43 zpos:
                flags: range
                values: 0 1
                value: 1
        44 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
50      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        52 alpha:
                flags: range
                values: 0 65535
                value: 65535
        53 zpos:
                flags: range
                values: 0 1
                value: 0
        54 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
55      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        57 alpha:
                flags: range
                values: 0 65535
                value: 65535
        58 zpos:
                flags: range
                values: 0 1
                value: 1
        59 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0

Frame buffers:
id      size    pitch

root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 45
^C
root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 60
^C
root@smarc-rzg3e:~# echo deep > /sys/power/mem_sleep
root@smarc-rzg3e:~# echo mem > /sys/power/state
[   86.526300] PM: suspend entry (deep)
[   86.529989] Filesystems sync: 0.000 seconds
[   86.543798] Freezing user space processes
[   86.549193] Freezing user space processes completed (elapsed 0.001 seconds)
[   86.556145] OOM killer disabled.
[   86.559367] Freezing remaining freezable tasks
[   86.565016] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   86.684418] renesas-gbeth 15c30000.ethernet end0: Link is Down
[   86.706835] Disabling non-boot CPUs ...
[   86.715969] psci: CPU3 killed (polled 0 ms)
[   86.728817] psci: CPU2 killed (polled 0 ms)
[   86.741605] psci: CPU1 killed (polled 0 ms)
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-169-g1410189b0
NOTICE:  BL2: Built : 17:45:23, Jul 30 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
[   86.750589] Enabling non-boot CPUs ...
[   86.754920] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
[   86.754960] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[   86.755931] CPU1 is up
[   86.772062] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
[   86.772085] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[   86.772773] CPU2 is up
[   86.788895] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
[   86.788918] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[   86.789790] CPU3 is up
[   86.825010] rzv2h-cpg 10420000.clock-controller: Failed to enable CLK_ON 0x63c/adg_0_audio_clka
[   86.840289] dwmac4: Master AXI performs any burst length
[   86.845741] renesas-gbeth 15c30000.ethernet end0: No Safety Features support found
[   86.853480] renesas-gbeth 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
[   86.862207] renesas-gbeth 15c30000.ethernet end0: configuring for phy/rgmii-id link mode
[   86.879788] dwmac4: Master AXI performs any burst length
[   86.885260] renesas-gbeth 15c40000.ethernet end1: No Safety Features support found
[   86.892958] renesas-gbeth 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
[   86.901615] renesas-gbeth 15c40000.ethernet end1: configuring for phy/rgmii-id link mode
[   86.958678] usb usb1: root hub lost power or was reset
[   86.963847] usb usb2: root hub lost power or was reset
[   87.044240] usb usb5: root hub lost power or was reset
[   87.049560] usb usb6: root hub lost power or was reset
[   87.132269] usb usb4: root hub lost power or was reset
[   87.137619] usb usb3: root hub lost power or was reset
[   87.342563] usb 6-1: reset high-speed USB device number 2 using ehci-platform
[   87.602717] OOM killer enabled.
[   87.605883] Restarting tasks: Starting
[   87.610733] Restarting tasks: Done
[   87.614240] random: crng reseeded on system resumption
[   87.628591] PM: suspend exit
root@smarc-rzg3e:~# 
root@smarc-rzg3e:~# 
root@smarc-rzg3e:~# modetest -M rzg2l-du
Encoders:
id      crtc    type    possible crtcs  possible clones
46      45      none    0x00000003      0x00000001

Connectors:
id      encoder status          name            size (mm)       modes   encoders
47      46      connected       HDMI-A-1        700x390         30      46
  modes:
        index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  #1 1920x1080 59.94 1920 2008 2052 2200 1080 1084 1089 1125 148352 flags: phsync, pvsync; type: driver
  #2 1920x1080 50.00 1920 2448 2492 2640 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: driver
  #3 1680x1050 59.88 1680 1728 1760 1840 1050 1053 1059 1080 119000 flags: phsync, nvsync; type: driver
  #4 1600x900 60.00 1600 1624 1704 1800 900 901 904 1000 108000 flags: phsync, pvsync; type: driver
  #5 1280x1024 75.02 1280 1296 1440 1688 1024 1025 1028 1066 135000 flags: phsync, pvsync; type: driver
  #6 1280x1024 60.02 1280 1328 1440 1688 1024 1025 1028 1066 108000 flags: phsync, pvsync; type: driver
  #7 1440x900 59.90 1440 1488 1520 1600 900 903 909 926 88750 flags: phsync, nvsync; type: driver
  #8 1280x800 59.91 1280 1328 1360 1440 800 803 809 823 71000 flags: phsync, nvsync; type: driver
  #9 1152x864 75.00 1152 1216 1344 1600 864 865 868 900 108000 flags: phsync, pvsync; type: driver
  #10 1280x720 60.00 1280 1390 1430 1650 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #11 1280x720 59.94 1280 1390 1430 1650 720 725 730 750 74176 flags: phsync, pvsync; type: driver
  #12 1280x720 50.00 1280 1720 1760 1980 720 725 730 750 74250 flags: phsync, pvsync; type: driver
  #13 1024x768 75.03 1024 1040 1136 1312 768 769 772 800 78750 flags: phsync, pvsync; type: driver
  #14 1024x768 70.07 1024 1048 1184 1328 768 771 777 806 75000 flags: nhsync, nvsync; type: driver
  #15 1024x768 60.00 1024 1048 1184 1344 768 771 777 806 65000 flags: nhsync, nvsync; type: driver
  #16 832x624 74.55 832 864 928 1152 624 625 628 667 57284 flags: nhsync, nvsync; type: driver
  #17 800x600 75.00 800 816 896 1056 600 601 604 625 49500 flags: phsync, pvsync; type: driver
  #18 800x600 72.19 800 856 976 1040 600 637 643 666 50000 flags: phsync, pvsync; type: driver
  #19 800x600 60.32 800 840 968 1056 600 601 605 628 40000 flags: phsync, pvsync; type: driver
  #20 800x600 56.25 800 824 896 1024 600 601 603 625 36000 flags: phsync, pvsync; type: driver
  #21 720x576 50.00 720 732 796 864 576 581 586 625 27000 flags: nhsync, nvsync; type: driver
  #22 720x480 60.00 720 736 798 858 480 489 495 525 27027 flags: nhsync, nvsync; type: driver
  #23 720x480 59.94 720 736 798 858 480 489 495 525 27000 flags: nhsync, nvsync; type: driver
  #24 640x480 75.00 640 656 720 840 480 481 484 500 31500 flags: nhsync, nvsync; type: driver
  #25 640x480 72.81 640 664 704 832 480 489 492 520 31500 flags: nhsync, nvsync; type: driver
  #26 640x480 66.67 640 704 768 864 480 483 486 525 30240 flags: nhsync, nvsync; type: driver
  #27 640x480 60.00 640 656 752 800 480 490 492 525 25200 flags: nhsync, nvsync; type: driver
  #28 640x480 59.94 640 656 752 800 480 490 492 525 25175 flags: nhsync, nvsync; type: driver
  #29 720x400 70.08 720 738 846 900 400 412 414 449 28320 flags: nhsync, pvsync; type: driver
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff004c2d0070324e4e34
                        0e1f0103804627782a1c02a853459623
                        1b4d58bfef80714f81c0810081809500
                        a9c0b3000101023a801871382d40582c
                        4500ba892100001e000000fd00324b1e
                        5112000a202020202020000000fc0043
                        3332523530780a2020202020000000ff
                        00483443523430303033345a002001f3
                        02031af14690041f1312032309070783
                        01000066030c00100080023a80d07238
                        2d40102c4580ba892100001e011d0072
                        51d01e206e285500ba892100001e011d
                        00bc52d01e20b8285540ba892100001e
                        8c0ad08a20e02d10103e9600ba892100
                        00182a4480a07038274030203500ba89
                        2100001a00000000000000000000002c
        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0
        5 link-status:
                flags: enum
                enums: Good=0 Bad=1
                value: 0
        7 non-desktop:
                flags: immutable range
                values: 0 1
                value: 0
        4 TILE:
                flags: immutable blob
                blobs:

                value:
        48 max bpc:
                flags: range
                values: 8 8
                value: 8
        49 color format:
                flags: enum
                enums: AUTO=0 RGB=1
                value: 0

CRTCs:
id      fb      pos     size
45      62      (0,0)   (1920x1080)
  #0 1920x1080 60.00 1920 2008 2052 2200 1080 1084 1089 1125 148500 flags: phsync, pvsync; type: preferred, driver
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0
60      0       (0,0)   (0x0)
  #0  nan 0 0 0 0 0 0 0 0 0 flags: ; type: 
  props:
        25 VRR_ENABLED:
                flags: range
                values: 0 1
                value: 0

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
35      45      62      0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        37 alpha:
                flags: range
                values: 0 65535
                value: 65535
        38 zpos:
                flags: range
                values: 0 1
                value: 0
        39 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
40      0       0       0,0             0,0     0               0x00000001
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        42 alpha:
                flags: range
                values: 0 65535
                value: 65535
        43 zpos:
                flags: range
                values: 0 1
                value: 1
        44 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
50      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 1
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        52 alpha:
                flags: range
                values: 0 65535
                value: 65535
        53 zpos:
                flags: range
                values: 0 1
                value: 0
        54 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0
55      0       0       0,0             0,0     0               0x00000002
  formats: RGB8 AR12 XR12 AR15 XR15 RG16 BG24 RG24 BA24 BX24 AR24 XR24 UYVY YUYV YVYU NV12 NV21 NV16 NV61 YU12 YV12 YU16 YV16 YU24 YV24
  props:
        9 type:
                flags: immutable enum
                enums: Overlay=0 Primary=1 Cursor=2
                value: 0
        32 IN_FORMATS:
                flags: immutable blob
                blobs:

                value:
                        01000000000000001900000018000000
                        01000000800000005247423841523132
                        58523132415231355852313552473136
                        42473234524732344241323442583234
                        41523234585232345559565959555956
                        595659554e5631324e5632314e563136
                        4e563631595531325956313259553136
                        59563136595532345956323400000000
                        ffffff01000000000000000000000000
                        0000000000000000
                in_formats blob decoded:
                         RGB8:  LINEAR(0x0)
                         AR12:  LINEAR(0x0)
                         XR12:  LINEAR(0x0)
                         AR15:  LINEAR(0x0)
                         XR15:  LINEAR(0x0)
                         RG16:  LINEAR(0x0)
                         BG24:  LINEAR(0x0)
                         RG24:  LINEAR(0x0)
                         BA24:  LINEAR(0x0)
                         BX24:  LINEAR(0x0)
                         AR24:  LINEAR(0x0)
                         XR24:  LINEAR(0x0)
                         UYVY:  LINEAR(0x0)
                         YUYV:  LINEAR(0x0)
                         YVYU:  LINEAR(0x0)
                         NV12:  LINEAR(0x0)
                         NV21:  LINEAR(0x0)
                         NV16:  LINEAR(0x0)
                         NV61:  LINEAR(0x0)
                         YU12:  LINEAR(0x0)
                         YV12:  LINEAR(0x0)
                         YU16:  LINEAR(0x0)
                         YV16:  LINEAR(0x0)
                         YU24:  LINEAR(0x0)
                         YV24:  LINEAR(0x0)
        57 alpha:
                flags: range
                values: 0 65535
                value: 65535
        58 zpos:
                flags: range
                values: 0 1
                value: 1
        59 pixel blend mode:
                flags: enum
                enums: None=2 Pre-multiplied=0 Coverage=1
                value: 0

Frame buffers:
id      size    pitch

root@smarc-rzg3e:~# [  102.244161] systemd-journald[202]: Sent WATCHDOG=1 notification.
modetest -M rzg2l-du -s 47@45:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 45
^C
root@smarc-rzg3e:~# modetest -M rzg2l-du -s 47@60:1920x1080-59.94@XR24
setting mode 1920x1080-59.94Hz on connectors 47, crtc 60

> 
> > +	}
> > +
> > +	if (IS_ERR(match))
> > +		return PTR_ERR(match);
> 
> Why this error path cannot be inside loop?

component_match_add_release() ignores further calls once the match is an
error pointer, so a single check after the loop is enough.

Kind regards,
Tommaso

> 
> Cheers,
> Biju
> 
> > +
> > +	if (!match)
> > +		return rzg2l_du_drm_init(dev, false);
> > +
> > +	return component_master_add_with_match(dev, &rzg2l_du_master_ops,
> > +match); }
> > +
> > +static void rzg2l_du_instance_remove(struct rzg2l_du_device *du) {
> > +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT)) {
> > +		rzg2l_du_drm_fini(du->dev, false);
> > +		return;
> > +	}
> > +
> > +	if (!du->is_master) {
> > +		component_del(du->dev, &rzg2l_du_instance_ops);
> > +		return;
> > +	}
> > +
> > +	component_master_del(du->dev, &rzg2l_du_master_ops);
> > +
> > +	if (du->ddev)
> > +		rzg2l_du_drm_fini(du->dev, false);
> >  }
> > 
> >  /* -----------------------------------------------------------------------------
> > @@ -262,7 +370,7 @@ static void rzg2l_du_drm_fini(struct device *dev)
> > 
> >  static void rzg2l_du_remove(struct platform_device *pdev)  {
> > -	rzg2l_du_drm_fini(&pdev->dev);
> > +	rzg2l_du_instance_remove(platform_get_drvdata(pdev));
> >  }
> > 
> >  static void rzg2l_du_shutdown(struct platform_device *pdev) @@ -304,7 +412,7 @@ static int
> > rzg2l_du_probe(struct platform_device *pdev)
> >  	rcdu->info = info;
> >  	rcdu->mmio = mmio;
> > 
> > -	return rzg2l_du_drm_init(&pdev->dev);
> > +	return rzg2l_du_instance_probe(rcdu);
> >  }
> > 
> >  static struct platform_driver rzg2l_du_platform_driver = { diff --git a/drivers/gpu/drm/renesas/rz-
> > du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> > index 2952c9d7348b..4c2e12206d83 100644
> > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> > @@ -21,6 +21,7 @@ struct device;
> >  struct drm_property;
> > 
> >  #define RZG2L_DU_FEATURE_DPIO_OE	BIT(0)	/* Has DPIO output enable control */
> > +#define RZG2L_DU_FEATURE_COMPONENT	BIT(1)	/* Has several DU instances in one DRM device */
> > 
> >  enum rzg2l_du_output {
> >  	RZG2L_DU_OUTPUT_DSI0,
> > @@ -71,6 +72,7 @@ struct rzg2l_du_device {
> > 
> >  	struct drm_device *ddev;
> >  	unsigned int index;
> > +	bool is_master;
> > 
> >  	struct rzg2l_du_crtc crtcs[RZG2L_DU_MAX_CRTCS];
> >  	unsigned int num_crtcs;
> > --
> > 2.54.0
> 
> 

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

* Re: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
  2026-11-24  9:33       ` Biju Das
@ 2026-11-24 11:59         ` Tommaso Merciai
  2026-11-24 12:51           ` Biju Das
  0 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-24 11:59 UTC (permalink / raw)
  To: Biju Das
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Biju,

On Tue, Nov 24, 2026 at 09:33:13AM +0000, Biju Das wrote:
> Hi Tommaso,
> 
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 24 November 2026 09:21
> > Subject: Re: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
> > 
> > Hi Biju,
> > Thanks for your review.
> > 
> > On Mon, Nov 23, 2026 at 04:59:32PM +0000, Biju Das wrote:
> > > Hi Tommaso,
> > >
> > > > -----Original Message-----
> > > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > Sent: 13 November 2026 12:20
> > > > Subject: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU
> > > > instance from the DRM device
> > > >
> > > > On RZ/G3E two DU instances share a DRM device, which can only be
> > > > created once both instances have been probed.
> > > >
> > > > Split the DU device structure: keep the match data and the registers
> > > > in a structure allocated with the platform device, and allocate the
> > > > KMS objects with the DRM device in a new rzg2l_du_instance_init() helper, as they are released
> > with it.
> > > >
> > > > No functional change intended.
> > > >
> > > > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > ---
> > > > v9->v10:
> > > >  - New patch.
> > > >
> > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 61
> > > > ++++++++++++++------
> > > >  1 file changed, 44 insertions(+), 17 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > b/drivers/gpu/drm/renesas/rz- du/rzg2l_du_drv.c index
> > > > d3cccbdf9012..d102876c07e1 100644
> > > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > @@ -162,6 +162,27 @@ static int rzg2l_du_pm_resume(struct device
> > > > *dev)  static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
> > > >  				rzg2l_du_pm_suspend, rzg2l_du_pm_resume);
> > > >
> > > > +/*
> > > > +-------------------------------------------------------------------
> > > > +----
> > > > +------
> > > > + * DU instance
> > > > + */
> > > > +
> > > > +static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > > +				  struct drm_device *ddev)
> > > > +{
> > > > +	struct rzg2l_du_device *rcdu;
> > > > +
> > > > +	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > > > +	if (!rcdu)
> > > > +		return -ENOMEM;
> > >
> > > Why there is duplicate allocation of rcdu? One in probe() and here
> > 
> > The two allocations have different lifetimes.
> > 
> > The one in rzg2l_du_probe() is tied to the platform device. It holds what is needed before the DRM
> > device exists and outside of the component bind (dev, info, mmio, and ddev/is_master for the master,
> > PM and remove), as on RZ/G3E the DRM device is only created once both instances have been probed.
> > 
> > The one in rzg2l_du_instance_init() holds the KMS objects (crtcs, vsps, lvds, index). Their drmm
> > cleanup handlers point into it and run when the DRM device is released, which can happen after the
> > platform device has been unbound, so it has to be allocated with the DRM device.
> 
> Then there is an issue right, platform unbound will unmap mmio and other data structures it allocated
> in rzg2l_du_probe()and drm driver is using after that( Use after free Bug)

Mmmm In theory no.

The KMS part keeps its own copy of dev, info and mmio, and its drmm
cleanup handlers only drop references, they don't access the hardware.


Kind regards,
Tommaso

> 
> Cheers,
> Biju
> 
> > 
> > Thanks, Tommaso
> > 
> > >
> > > Cheers,
> > > Biju
> > >
> > > > +
> > > > +	rcdu->dev = du->dev;
> > > > +	rcdu->info = du->info;
> > > > +	rcdu->mmio = du->mmio;
> > > > +	rcdu->ddev = ddev;
> > > > +
> > > > +	return rzg2l_du_modeset_init_du(rcdu); }
> > > > +
> > > >  /* -----------------------------------------------------------------------------
> > > >   * Platform driver
> > > >   */
> > > > @@ -190,44 +211,48 @@ static void rzg2l_du_shutdown(struct
> > > > platform_device *pdev)
> > > >
> > > >  static int rzg2l_du_probe(struct platform_device *pdev)  {
> > > > +	const struct rzg2l_du_device_info *info;
> > > >  	struct rzg2l_du_device *rcdu;
> > > >  	struct rzg2l_du_drm *rzgdrm;
> > > > +	void __iomem *mmio;
> > > >  	int ret;
> > > >
> > > >  	if (drm_firmware_drivers_only())
> > > >  		return -ENODEV;
> > > >
> > > > -	/* Allocate and initialize the RZ/G2L device structure. */
> > > > -	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> > > > -				    struct rzg2l_du_drm, ddev);
> > > > -	if (IS_ERR(rzgdrm))
> > > > -		return PTR_ERR(rzgdrm);
> > > > +	info = of_device_get_match_data(&pdev->dev);
> > > > +
> > > > +	/* I/O resources */
> > > > +	mmio = devm_platform_ioremap_resource(pdev, 0);
> > > > +	if (IS_ERR(mmio))
> > > > +		return PTR_ERR(mmio);
> > > > +
> > > > +	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> > > > +	if (ret)
> > > > +		return ret;
> > > >
> > > > -	rcdu = drmm_kzalloc(&rzgdrm->ddev, sizeof(*rcdu), GFP_KERNEL);
> > > > +	/* Allocate and initialize the RZ/G2L device structure. */
> > > > +	rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL);
> > > >  	if (!rcdu)
> > > >  		return -ENOMEM;
> > > >
> > > >  	platform_set_drvdata(pdev, rcdu);
> > > >
> > > >  	rcdu->dev = &pdev->dev;
> > > > -	rcdu->info = of_device_get_match_data(rcdu->dev);
> > > > -	rcdu->ddev = &rzgdrm->ddev;
> > > > -
> > > > -	/* I/O resources */
> > > > -	rcdu->mmio = devm_platform_ioremap_resource(pdev, 0);
> > > > -	if (IS_ERR(rcdu->mmio))
> > > > -		return PTR_ERR(rcdu->mmio);
> > > > +	rcdu->info = info;
> > > > +	rcdu->mmio = mmio;
> > > >
> > > > -	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> > > > -	if (ret)
> > > > -		return ret;
> > > > +	rzgdrm = devm_drm_dev_alloc(&pdev->dev, &rzg2l_du_driver,
> > > > +				    struct rzg2l_du_drm, ddev);
> > > > +	if (IS_ERR(rzgdrm))
> > > > +		return PTR_ERR(rzgdrm);
> > > >
> > > >  	/* DRM/KMS objects */
> > > >  	ret = rzg2l_du_modeset_init_drm(&rzgdrm->ddev);
> > > >  	if (ret < 0)
> > > >  		goto error;
> > > >
> > > > -	ret = rzg2l_du_modeset_init_du(rcdu);
> > > > +	ret = rzg2l_du_instance_init(rcdu, &rzgdrm->ddev);
> > > >  	if (ret < 0)
> > > >  		goto error;
> > > >
> > > > @@ -243,6 +268,8 @@ static int rzg2l_du_probe(struct platform_device *pdev)
> > > >  	if (ret)
> > > >  		goto error_fini;
> > > >
> > > > +	rcdu->ddev = &rzgdrm->ddev;
> > > > +
> > > >  	drm_info(&rzgdrm->ddev, "Device %s probed\n",
> > > > dev_name(&pdev->dev));
> > > >
> > > >  	drm_client_setup(&rzgdrm->ddev, NULL);
> > > > --
> > > > 2.54.0
> > >

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

* RE: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
  2026-11-24 11:59         ` Tommaso Merciai
@ 2026-11-24 12:51           ` Biju Das
  0 siblings, 0 replies; 31+ messages in thread
From: Biju Das @ 2026-11-24 12:51 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel


Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 24 November 2026 11:59
> Subject: Re: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device
> 
> Hi Biju,
> 
> On Tue, Nov 24, 2026 at 09:33:13AM +0000, Biju Das wrote:
> > Hi Tommaso,
> >
> > > -----Original Message-----
> > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > Sent: 24 November 2026 09:21
> > > Subject: Re: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU
> > > instance from the DRM device
> > >
> > > Hi Biju,
> > > Thanks for your review.
> > >
> > > On Mon, Nov 23, 2026 at 04:59:32PM +0000, Biju Das wrote:
> > > > Hi Tommaso,
> > > >
> > > > > -----Original Message-----
> > > > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > > Sent: 13 November 2026 12:20
> > > > > Subject: [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU
> > > > > instance from the DRM device
> > > > >
> > > > > On RZ/G3E two DU instances share a DRM device, which can only be
> > > > > created once both instances have been probed.
> > > > >
> > > > > Split the DU device structure: keep the match data and the
> > > > > registers in a structure allocated with the platform device, and
> > > > > allocate the KMS objects with the DRM device in a new
> > > > > rzg2l_du_instance_init() helper, as they are released
> > > with it.
> > > > >
> > > > > No functional change intended.
> > > > >
> > > > > Signed-off-by: Tommaso Merciai
> > > > > <tommaso.merciai.xr@bp.renesas.com>
> > > > > ---
> > > > > v9->v10:
> > > > >  - New patch.
> > > > >
> > > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 61
> > > > > ++++++++++++++------
> > > > >  1 file changed, 44 insertions(+), 17 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > b/drivers/gpu/drm/renesas/rz- du/rzg2l_du_drv.c index
> > > > > d3cccbdf9012..d102876c07e1 100644
> > > > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > @@ -162,6 +162,27 @@ static int rzg2l_du_pm_resume(struct device
> > > > > *dev)  static DEFINE_SIMPLE_DEV_PM_OPS(rzg2l_du_pm_ops,
> > > > >  				rzg2l_du_pm_suspend, rzg2l_du_pm_resume);
> > > > >
> > > > > +/*
> > > > > +---------------------------------------------------------------
> > > > > +----
> > > > > +----
> > > > > +------
> > > > > + * DU instance
> > > > > + */
> > > > > +
> > > > > +static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > > > +				  struct drm_device *ddev)
> > > > > +{
> > > > > +	struct rzg2l_du_device *rcdu;
> > > > > +
> > > > > +	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > > > > +	if (!rcdu)
> > > > > +		return -ENOMEM;
> > > >
> > > > Why there is duplicate allocation of rcdu? One in probe() and here
> > >
> > > The two allocations have different lifetimes.
> > >
> > > The one in rzg2l_du_probe() is tied to the platform device. It holds
> > > what is needed before the DRM device exists and outside of the
> > > component bind (dev, info, mmio, and ddev/is_master for the master, PM and remove), as on RZ/G3E
> the DRM device is only created once both instances have been probed.
> > >
> > > The one in rzg2l_du_instance_init() holds the KMS objects (crtcs,
> > > vsps, lvds, index). Their drmm cleanup handlers point into it and
> > > run when the DRM device is released, which can happen after the platform device has been unbound,
> so it has to be allocated with the DRM device.
> >
> > Then there is an issue right, platform unbound will unmap mmio and
> > other data structures it allocated in rzg2l_du_probe()and drm driver
> > is using after that( Use after free Bug)
> 
> Mmmm In theory no.
> 
> The KMS part keeps its own copy of dev, info and mmio, and its drmm cleanup handlers only drop
> references, they don't access the hardware.

Can you please make sure these variables set to NULL, after
Platform unbound?

Cheers,
Biju


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

* RE: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-24 11:53     ` Tommaso Merciai
@ 2026-11-24 13:18       ` Biju Das
  2026-11-24 13:59         ` Tommaso Merciai
  0 siblings, 1 reply; 31+ messages in thread
From: Biju Das @ 2026-11-24 13:18 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 24 November 2026 11:53
> Subject: Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> 
> Hi Biju,
> Thanks for your review.
> 
> On Tue, Nov 24, 2026 at 07:47:04AM +0000, Biju Das wrote:
> > Hi Tommaso,
> >
> > > -----Original Message-----
> > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > Sent: 13 November 2026 12:20
> > > Subject: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> > >
> > > RZ/G3E has two DU instances that share a single DRM device.
> > >
> > > Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component framework for it. The first available
> DU
> > > instance is the master and creates the DRM device, the other one binds to it as a component.
> > >
> > > If only one DU instance is available, it creates the DRM device directly at probe time, as on SoCs
> > > without the flag.
> > >
> > > Set the index of each instance to the number of CRTCs already created.
> > >
> > > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > ---
> > > v9->v10:
> > >  - New patch.
> > >
> > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
> > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
> > >  2 files changed, 115 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> > > du/rzg2l_du_drv.c
> > > index 93d59e2cf8a4..873586f2ef28 100644
> > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > @@ -7,6 +7,7 @@
> > >   * Based on rcar_du_drv.c
> > >   */
> > >
> > > +#include <linux/component.h>
> > >  #include <linux/dma-mapping.h>
> > >  #include <linux/module.h>
> > >  #include <linux/of.h>
> > > @@ -14,10 +15,12 @@
> > >
> > >  #include <drm/clients/drm_client_setup.h>  #include <drm/drm_atomic_helper.h>
> > > +#include <drm/drm_crtc.h>
> > >  #include <drm/drm_drv.h>
> > >  #include <drm/drm_fbdev_dma.h>
> > >  #include <drm/drm_gem_dma_helper.h>
> > >  #include <drm/drm_managed.h>
> > > +#include <drm/drm_of.h>
> > >  #include <drm/drm_print.h>
> > >  #include <drm/drm_probe_helper.h>
> > >
> > > @@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > >  				  struct drm_device *ddev)
> > >  {
> > >  	struct rzg2l_du_device *rcdu;
> > > +	int ret;
> > >
> > >  	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > >  	if (!rcdu)
> > > @@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > >  	rcdu->mmio = du->mmio;
> > >  	rcdu->ddev = ddev;
> > >
> > > -	return rzg2l_du_modeset_init_du(rcdu);
> > > +	rcdu->index = ddev->mode_config.num_crtc;
> > > +
> > > +	ret = rzg2l_du_modeset_init_du(rcdu);
> > > +	if (ret < 0)
> > > +		return ret;
> > > +
> > > +	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
> > > +		return -EINVAL;
> > > +
> > > +	return 0;
> > >  }
> > >
> > > +static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
> > > +				  void *data)
> > > +{
> > > +	return rzg2l_du_instance_init(dev_get_drvdata(dev), data); }
> > > +
> > > +static const struct component_ops rzg2l_du_instance_ops = {
> > > +	.bind = rzg2l_du_instance_bind,
> > > +};
> > > +
> > >  /* -----------------------------------------------------------------------------
> > >   * DRM device
> > >   */
> > > @@ -191,7 +214,7 @@ struct rzg2l_du_drm {
> > >  	struct drm_device ddev;
> > >  };
> > >
> > > -static int rzg2l_du_drm_init(struct device *dev)
> > > +static int rzg2l_du_drm_init(struct device *dev, bool has_components)
> > >  {
> > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > >  	struct rzg2l_du_drm *rzgdrm;
> > > @@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
> > >  	if (ret < 0)
> > >  		goto error;
> > >
> > > +	if (has_components) {
> > > +		ret = component_bind_all(dev, ddev);
> > > +		if (ret < 0)
> > > +			goto error;
> > > +	}
> > > +
> > >  	ret = rzg2l_du_modeset_init_finish(ddev);
> > >  	if (ret < 0)
> > >  		goto error_fini;
> > > @@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device *dev)
> > >
> > >  error_fini:
> > >  	drm_kms_helper_poll_fini(ddev);
> > > +	if (has_components)
> > > +		component_unbind_all(dev, ddev);
> > >  error:
> > >  	/*
> > >  	 * Don't use dev_err_probe(), as it would overwrite the probe deferral @@ -246,7 +277,7 @@
> > > static int rzg2l_du_drm_init(struct device *dev)
> > >  	return ret;
> > >  }
> > >
> > > -static void rzg2l_du_drm_fini(struct device *dev)
> > > +static void rzg2l_du_drm_fini(struct device *dev, bool has_components)
> > >  {
> > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > >  	struct drm_device *ddev = du->ddev;
> > > @@ -254,6 +285,83 @@ static void rzg2l_du_drm_fini(struct device *dev)
> > >  	drm_dev_unregister(ddev);
> > >  	drm_atomic_helper_shutdown(ddev);
> > >  	drm_kms_helper_poll_fini(ddev);
> > > +
> > > +	if (has_components)
> > > +		component_unbind_all(dev, ddev);
> > > +
> > > +	du->ddev = NULL;
> > > +}
> > > +
> > > +/*
> > > +-----------------------------------------------------------------------
> > > +------
> > > + * Component master
> > > + */
> > > +
> > > +static int rzg2l_du_master_bind(struct device *dev) {
> > > +	return rzg2l_du_drm_init(dev, true);
> > > +}
> > > +
> > > +static void rzg2l_du_master_unbind(struct device *dev) {
> > > +	rzg2l_du_drm_fini(dev, true);
> > > +}
> > > +
> > > +static const struct component_master_ops rzg2l_du_master_ops = {
> > > +	.bind = rzg2l_du_master_bind,
> > > +	.unbind = rzg2l_du_master_unbind,
> > > +};
> > > +
> > > +static int rzg2l_du_instance_probe(struct rzg2l_du_device *du) {
> > > +	struct component_match *match = NULL;
> > > +	const struct of_device_id *of_id;
> > > +	struct device *dev = du->dev;
> > > +
> > > +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
> > > +		return rzg2l_du_drm_init(dev, false);
> > > +
> > > +	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
> > > +		of_id = of_match_node(dev->driver->of_match_table, np);
> > > +		if (!of_id || of_id->data != du->info)
> > > +			continue;
> > > +
> > > +		/* The first available DU instance is the component master. */
> > > +		if (!du->is_master) {
> > > +			if (np != dev->of_node)
> > > +				return component_add(dev, &rzg2l_du_instance_ops);
> > > +
> > > +			du->is_master = true;
> > > +			continue;
> > > +		}
> > > +
> > > +		drm_of_component_match_add(dev, &match, component_compare_of, np);
> >
> >
> > The master is chosen purely by DT order. If the first available DU never probes,
> > the second never gets a DRM device. How do you handle this case?
> 
> All available instances are part of the component match, so the DRM
> device is only created once all of them have probed, whichever one is
> the master.
> 
> This is how the component framework works.
> 
> To use a single DU, the other one can be disabled in DT, in this case
> the remaining instance becomes the master and initializes the DRM
> device on its own.


Assume both DU's available and run time

second DU is probed first and master never probed at all.
What is the state of second DU as bind never calls?




> >
> > > +	}
> > > +
> > > +	if (IS_ERR(match))
> > > +		return PTR_ERR(match);
> >
> > Why this error path cannot be inside loop?
> 
> component_match_add_release() ignores further calls once the match is an
> error pointer, so a single check after the loop is enough.

If there is an error, you can do early return, instead of keep looping.

Cheers,
Biju

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

* Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-24 13:18       ` Biju Das
@ 2026-11-24 13:59         ` Tommaso Merciai
  2026-11-24 14:11           ` Biju Das
  0 siblings, 1 reply; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-24 13:59 UTC (permalink / raw)
  To: Biju Das
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Biju,

On Tue, Nov 24, 2026 at 01:18:43PM +0000, Biju Das wrote:
> Hi Tommaso,
> 
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 24 November 2026 11:53
> > Subject: Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> > 
> > Hi Biju,
> > Thanks for your review.
> > 
> > On Tue, Nov 24, 2026 at 07:47:04AM +0000, Biju Das wrote:
> > > Hi Tommaso,
> > >
> > > > -----Original Message-----
> > > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > Sent: 13 November 2026 12:20
> > > > Subject: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> > > >
> > > > RZ/G3E has two DU instances that share a single DRM device.
> > > >
> > > > Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component framework for it. The first available
> > DU
> > > > instance is the master and creates the DRM device, the other one binds to it as a component.
> > > >
> > > > If only one DU instance is available, it creates the DRM device directly at probe time, as on SoCs
> > > > without the flag.
> > > >
> > > > Set the index of each instance to the number of CRTCs already created.
> > > >
> > > > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > ---
> > > > v9->v10:
> > > >  - New patch.
> > > >
> > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
> > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
> > > >  2 files changed, 115 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-
> > > > du/rzg2l_du_drv.c
> > > > index 93d59e2cf8a4..873586f2ef28 100644
> > > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > @@ -7,6 +7,7 @@
> > > >   * Based on rcar_du_drv.c
> > > >   */
> > > >
> > > > +#include <linux/component.h>
> > > >  #include <linux/dma-mapping.h>
> > > >  #include <linux/module.h>
> > > >  #include <linux/of.h>
> > > > @@ -14,10 +15,12 @@
> > > >
> > > >  #include <drm/clients/drm_client_setup.h>  #include <drm/drm_atomic_helper.h>
> > > > +#include <drm/drm_crtc.h>
> > > >  #include <drm/drm_drv.h>
> > > >  #include <drm/drm_fbdev_dma.h>
> > > >  #include <drm/drm_gem_dma_helper.h>
> > > >  #include <drm/drm_managed.h>
> > > > +#include <drm/drm_of.h>
> > > >  #include <drm/drm_print.h>
> > > >  #include <drm/drm_probe_helper.h>
> > > >
> > > > @@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > >  				  struct drm_device *ddev)
> > > >  {
> > > >  	struct rzg2l_du_device *rcdu;
> > > > +	int ret;
> > > >
> > > >  	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > > >  	if (!rcdu)
> > > > @@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > >  	rcdu->mmio = du->mmio;
> > > >  	rcdu->ddev = ddev;
> > > >
> > > > -	return rzg2l_du_modeset_init_du(rcdu);
> > > > +	rcdu->index = ddev->mode_config.num_crtc;
> > > > +
> > > > +	ret = rzg2l_du_modeset_init_du(rcdu);
> > > > +	if (ret < 0)
> > > > +		return ret;
> > > > +
> > > > +	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
> > > > +		return -EINVAL;
> > > > +
> > > > +	return 0;
> > > >  }
> > > >
> > > > +static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
> > > > +				  void *data)
> > > > +{
> > > > +	return rzg2l_du_instance_init(dev_get_drvdata(dev), data); }
> > > > +
> > > > +static const struct component_ops rzg2l_du_instance_ops = {
> > > > +	.bind = rzg2l_du_instance_bind,
> > > > +};
> > > > +
> > > >  /* -----------------------------------------------------------------------------
> > > >   * DRM device
> > > >   */
> > > > @@ -191,7 +214,7 @@ struct rzg2l_du_drm {
> > > >  	struct drm_device ddev;
> > > >  };
> > > >
> > > > -static int rzg2l_du_drm_init(struct device *dev)
> > > > +static int rzg2l_du_drm_init(struct device *dev, bool has_components)
> > > >  {
> > > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > > >  	struct rzg2l_du_drm *rzgdrm;
> > > > @@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
> > > >  	if (ret < 0)
> > > >  		goto error;
> > > >
> > > > +	if (has_components) {
> > > > +		ret = component_bind_all(dev, ddev);
> > > > +		if (ret < 0)
> > > > +			goto error;
> > > > +	}
> > > > +
> > > >  	ret = rzg2l_du_modeset_init_finish(ddev);
> > > >  	if (ret < 0)
> > > >  		goto error_fini;
> > > > @@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device *dev)
> > > >
> > > >  error_fini:
> > > >  	drm_kms_helper_poll_fini(ddev);
> > > > +	if (has_components)
> > > > +		component_unbind_all(dev, ddev);
> > > >  error:
> > > >  	/*
> > > >  	 * Don't use dev_err_probe(), as it would overwrite the probe deferral @@ -246,7 +277,7 @@
> > > > static int rzg2l_du_drm_init(struct device *dev)
> > > >  	return ret;
> > > >  }
> > > >
> > > > -static void rzg2l_du_drm_fini(struct device *dev)
> > > > +static void rzg2l_du_drm_fini(struct device *dev, bool has_components)
> > > >  {
> > > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > > >  	struct drm_device *ddev = du->ddev;
> > > > @@ -254,6 +285,83 @@ static void rzg2l_du_drm_fini(struct device *dev)
> > > >  	drm_dev_unregister(ddev);
> > > >  	drm_atomic_helper_shutdown(ddev);
> > > >  	drm_kms_helper_poll_fini(ddev);
> > > > +
> > > > +	if (has_components)
> > > > +		component_unbind_all(dev, ddev);
> > > > +
> > > > +	du->ddev = NULL;
> > > > +}
> > > > +
> > > > +/*
> > > > +-----------------------------------------------------------------------
> > > > +------
> > > > + * Component master
> > > > + */
> > > > +
> > > > +static int rzg2l_du_master_bind(struct device *dev) {
> > > > +	return rzg2l_du_drm_init(dev, true);
> > > > +}
> > > > +
> > > > +static void rzg2l_du_master_unbind(struct device *dev) {
> > > > +	rzg2l_du_drm_fini(dev, true);
> > > > +}
> > > > +
> > > > +static const struct component_master_ops rzg2l_du_master_ops = {
> > > > +	.bind = rzg2l_du_master_bind,
> > > > +	.unbind = rzg2l_du_master_unbind,
> > > > +};
> > > > +
> > > > +static int rzg2l_du_instance_probe(struct rzg2l_du_device *du) {
> > > > +	struct component_match *match = NULL;
> > > > +	const struct of_device_id *of_id;
> > > > +	struct device *dev = du->dev;
> > > > +
> > > > +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
> > > > +		return rzg2l_du_drm_init(dev, false);
> > > > +
> > > > +	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
> > > > +		of_id = of_match_node(dev->driver->of_match_table, np);
> > > > +		if (!of_id || of_id->data != du->info)
> > > > +			continue;
> > > > +
> > > > +		/* The first available DU instance is the component master. */
> > > > +		if (!du->is_master) {
> > > > +			if (np != dev->of_node)
> > > > +				return component_add(dev, &rzg2l_du_instance_ops);
> > > > +
> > > > +			du->is_master = true;
> > > > +			continue;
> > > > +		}
> > > > +
> > > > +		drm_of_component_match_add(dev, &match, component_compare_of, np);
> > >
> > >
> > > The master is chosen purely by DT order. If the first available DU never probes,
> > > the second never gets a DRM device. How do you handle this case?
> > 
> > All available instances are part of the component match, so the DRM
> > device is only created once all of them have probed, whichever one is
> > the master.
> > 
> > This is how the component framework works.
> > 
> > To use a single DU, the other one can be disabled in DT, in this case
> > the remaining instance becomes the master and initializes the DRM
> > device on its own.
> 
> 
> Assume both DU's available and run time
> 
> second DU is probed first and master never probed at all.
> What is the state of second DU as bind never calls?


The second DU probes, registers itself with component_add() and stays
idle, without touching the hardware. 

When the master probes, both instances are bound and the DRM device is
created.

If the master never probes, there is no DRM device, because the bind is
only triggered once the master has registered the aggregate device with
component_master_add_with_match()

Kind regards,
Tommaso

> 
> 
> 
> 
> > >
> > > > +	}
> > > > +
> > > > +	if (IS_ERR(match))
> > > > +		return PTR_ERR(match);
> > >
> > > Why this error path cannot be inside loop?
> > 
> > component_match_add_release() ignores further calls once the match is an
> > error pointer, so a single check after the loop is enough.
> 
> If there is an error, you can do early return, instead of keep looping.

Then we will have:

		drm_of_component_match_add(dev, &match, component_compare_of, np);
		if (IS_ERR(match))
			return PTR_ERR(match);
	}

	if (!match)
		return rzg2l_du_drm_init(dev, false);

Ok for me, thanks.

Kind regards,
Tommaso


> 
> Cheers,
> Biju
> 

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

* RE: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-24 13:59         ` Tommaso Merciai
@ 2026-11-24 14:11           ` Biju Das
  2026-11-24 14:52             ` Tommaso Merciai
  0 siblings, 1 reply; 31+ messages in thread
From: Biju Das @ 2026-11-24 14:11 UTC (permalink / raw)
  To: Tommaso Merciai
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Tommaso,

> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 24 November 2026 13:59
> Subject: Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> 
> Hi Biju,
> 
> On Tue, Nov 24, 2026 at 01:18:43PM +0000, Biju Das wrote:
> > Hi Tommaso,
> >
> > > -----Original Message-----
> > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > Sent: 24 November 2026 11:53
> > > Subject: Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several
> > > DU instances in one DRM device
> > >
> > > Hi Biju,
> > > Thanks for your review.
> > >
> > > On Tue, Nov 24, 2026 at 07:47:04AM +0000, Biju Das wrote:
> > > > Hi Tommaso,
> > > >
> > > > > -----Original Message-----
> > > > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > > Sent: 13 November 2026 12:20
> > > > > Subject: [PATCH v10 10/12] drm: renesas: rz-du: Support several
> > > > > DU instances in one DRM device
> > > > >
> > > > > RZ/G3E has two DU instances that share a single DRM device.
> > > > >
> > > > > Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component
> > > > > framework for it. The first available
> > > DU
> > > > > instance is the master and creates the DRM device, the other one binds to it as a component.
> > > > >
> > > > > If only one DU instance is available, it creates the DRM device
> > > > > directly at probe time, as on SoCs without the flag.
> > > > >
> > > > > Set the index of each instance to the number of CRTCs already created.
> > > > >
> > > > > Signed-off-by: Tommaso Merciai
> > > > > <tommaso.merciai.xr@bp.renesas.com>
> > > > > ---
> > > > > v9->v10:
> > > > >  - New patch.
> > > > >
> > > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
> > > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
> > > > >  2 files changed, 115 insertions(+), 5 deletions(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > b/drivers/gpu/drm/renesas/rz- du/rzg2l_du_drv.c index
> > > > > 93d59e2cf8a4..873586f2ef28 100644
> > > > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > @@ -7,6 +7,7 @@
> > > > >   * Based on rcar_du_drv.c
> > > > >   */
> > > > >
> > > > > +#include <linux/component.h>
> > > > >  #include <linux/dma-mapping.h>
> > > > >  #include <linux/module.h>
> > > > >  #include <linux/of.h>
> > > > > @@ -14,10 +15,12 @@
> > > > >
> > > > >  #include <drm/clients/drm_client_setup.h>  #include
> > > > > <drm/drm_atomic_helper.h>
> > > > > +#include <drm/drm_crtc.h>
> > > > >  #include <drm/drm_drv.h>
> > > > >  #include <drm/drm_fbdev_dma.h>
> > > > >  #include <drm/drm_gem_dma_helper.h>  #include
> > > > > <drm/drm_managed.h>
> > > > > +#include <drm/drm_of.h>
> > > > >  #include <drm/drm_print.h>
> > > > >  #include <drm/drm_probe_helper.h>
> > > > >
> > > > > @@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > > >  				  struct drm_device *ddev)
> > > > >  {
> > > > >  	struct rzg2l_du_device *rcdu;
> > > > > +	int ret;
> > > > >
> > > > >  	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > > > >  	if (!rcdu)
> > > > > @@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > > >  	rcdu->mmio = du->mmio;
> > > > >  	rcdu->ddev = ddev;
> > > > >
> > > > > -	return rzg2l_du_modeset_init_du(rcdu);
> > > > > +	rcdu->index = ddev->mode_config.num_crtc;
> > > > > +
> > > > > +	ret = rzg2l_du_modeset_init_du(rcdu);
> > > > > +	if (ret < 0)
> > > > > +		return ret;
> > > > > +
> > > > > +	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
> > > > > +		return -EINVAL;
> > > > > +
> > > > > +	return 0;
> > > > >  }
> > > > >
> > > > > +static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
> > > > > +				  void *data)
> > > > > +{
> > > > > +	return rzg2l_du_instance_init(dev_get_drvdata(dev), data); }
> > > > > +
> > > > > +static const struct component_ops rzg2l_du_instance_ops = {
> > > > > +	.bind = rzg2l_du_instance_bind, };
> > > > > +
> > > > >  /* -----------------------------------------------------------------------------
> > > > >   * DRM device
> > > > >   */
> > > > > @@ -191,7 +214,7 @@ struct rzg2l_du_drm {
> > > > >  	struct drm_device ddev;
> > > > >  };
> > > > >
> > > > > -static int rzg2l_du_drm_init(struct device *dev)
> > > > > +static int rzg2l_du_drm_init(struct device *dev, bool
> > > > > +has_components)
> > > > >  {
> > > > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > > > >  	struct rzg2l_du_drm *rzgdrm;
> > > > > @@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
> > > > >  	if (ret < 0)
> > > > >  		goto error;
> > > > >
> > > > > +	if (has_components) {
> > > > > +		ret = component_bind_all(dev, ddev);
> > > > > +		if (ret < 0)
> > > > > +			goto error;
> > > > > +	}
> > > > > +
> > > > >  	ret = rzg2l_du_modeset_init_finish(ddev);
> > > > >  	if (ret < 0)
> > > > >  		goto error_fini;
> > > > > @@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device
> > > > > *dev)
> > > > >
> > > > >  error_fini:
> > > > >  	drm_kms_helper_poll_fini(ddev);
> > > > > +	if (has_components)
> > > > > +		component_unbind_all(dev, ddev);
> > > > >  error:
> > > > >  	/*
> > > > >  	 * Don't use dev_err_probe(), as it would overwrite the probe
> > > > > deferral @@ -246,7 +277,7 @@ static int rzg2l_du_drm_init(struct device *dev)
> > > > >  	return ret;
> > > > >  }
> > > > >
> > > > > -static void rzg2l_du_drm_fini(struct device *dev)
> > > > > +static void rzg2l_du_drm_fini(struct device *dev, bool
> > > > > +has_components)
> > > > >  {
> > > > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > > > >  	struct drm_device *ddev = du->ddev; @@ -254,6 +285,83 @@
> > > > > static void rzg2l_du_drm_fini(struct device *dev)
> > > > >  	drm_dev_unregister(ddev);
> > > > >  	drm_atomic_helper_shutdown(ddev);
> > > > >  	drm_kms_helper_poll_fini(ddev);
> > > > > +
> > > > > +	if (has_components)
> > > > > +		component_unbind_all(dev, ddev);
> > > > > +
> > > > > +	du->ddev = NULL;
> > > > > +}
> > > > > +
> > > > > +/*
> > > > > +---------------------------------------------------------------
> > > > > +--------
> > > > > +------
> > > > > + * Component master
> > > > > + */
> > > > > +
> > > > > +static int rzg2l_du_master_bind(struct device *dev) {
> > > > > +	return rzg2l_du_drm_init(dev, true); }
> > > > > +
> > > > > +static void rzg2l_du_master_unbind(struct device *dev) {
> > > > > +	rzg2l_du_drm_fini(dev, true);
> > > > > +}
> > > > > +
> > > > > +static const struct component_master_ops rzg2l_du_master_ops = {
> > > > > +	.bind = rzg2l_du_master_bind,
> > > > > +	.unbind = rzg2l_du_master_unbind, };
> > > > > +
> > > > > +static int rzg2l_du_instance_probe(struct rzg2l_du_device *du) {
> > > > > +	struct component_match *match = NULL;
> > > > > +	const struct of_device_id *of_id;
> > > > > +	struct device *dev = du->dev;
> > > > > +
> > > > > +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
> > > > > +		return rzg2l_du_drm_init(dev, false);
> > > > > +
> > > > > +	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
> > > > > +		of_id = of_match_node(dev->driver->of_match_table, np);
> > > > > +		if (!of_id || of_id->data != du->info)
> > > > > +			continue;
> > > > > +
> > > > > +		/* The first available DU instance is the component master. */
> > > > > +		if (!du->is_master) {
> > > > > +			if (np != dev->of_node)
> > > > > +				return component_add(dev, &rzg2l_du_instance_ops);
> > > > > +
> > > > > +			du->is_master = true;
> > > > > +			continue;
> > > > > +		}
> > > > > +
> > > > > +		drm_of_component_match_add(dev, &match, component_compare_of,
> > > > > +np);
> > > >
> > > >
> > > > The master is chosen purely by DT order. If the first available DU
> > > > never probes, the second never gets a DRM device. How do you handle this case?
> > >
> > > All available instances are part of the component match, so the DRM
> > > device is only created once all of them have probed, whichever one
> > > is the master.
> > >
> > > This is how the component framework works.
> > >
> > > To use a single DU, the other one can be disabled in DT, in this
> > > case the remaining instance becomes the master and initializes the
> > > DRM device on its own.
> >
> >
> > Assume both DU's available and run time
> >
> > second DU is probed first and master never probed at all.
> > What is the state of second DU as bind never calls?
> 
> 
> The second DU probes, registers itself with component_add() and stays idle, without touching the
> hardware.
> 
> When the master probes, both instances are bound and the DRM device is created.
> 
> If the master never probes, there is no DRM device, because the bind is only triggered once the master
> has registered the aggregate device with
> component_master_add_with_match()

Not sure is it the normal use case? DU0 and DU1 are independent devices

1) DU0 or DU1 should work independently irrespective of the probe failure of
   other device

2) When both DU's are probed, then we need to aggregate the device using component
   framework so that use case like dynamically switching DSI0 to DSI1 can be achieved.

Cheers,
Biju


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

* Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
  2026-11-24 14:11           ` Biju Das
@ 2026-11-24 14:52             ` Tommaso Merciai
  0 siblings, 0 replies; 31+ messages in thread
From: Tommaso Merciai @ 2026-11-24 14:52 UTC (permalink / raw)
  To: Biju Das
  Cc: Tommaso Merciai, Prabhakar Mahadev Lad, linux-renesas-soc,
	David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, magnus.damm, Laurent Pinchart,
	dri-devel, devicetree, linux-kernel

Hi Biju,

On Tue, Nov 24, 2026 at 02:11:16PM +0000, Biju Das wrote:
> Hi Tommaso,
> 
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 24 November 2026 13:59
> > Subject: Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device
> > 
> > Hi Biju,
> > 
> > On Tue, Nov 24, 2026 at 01:18:43PM +0000, Biju Das wrote:
> > > Hi Tommaso,
> > >
> > > > -----Original Message-----
> > > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > Sent: 24 November 2026 11:53
> > > > Subject: Re: [PATCH v10 10/12] drm: renesas: rz-du: Support several
> > > > DU instances in one DRM device
> > > >
> > > > Hi Biju,
> > > > Thanks for your review.
> > > >
> > > > On Tue, Nov 24, 2026 at 07:47:04AM +0000, Biju Das wrote:
> > > > > Hi Tommaso,
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > > > > > Sent: 13 November 2026 12:20
> > > > > > Subject: [PATCH v10 10/12] drm: renesas: rz-du: Support several
> > > > > > DU instances in one DRM device
> > > > > >
> > > > > > RZ/G3E has two DU instances that share a single DRM device.
> > > > > >
> > > > > > Add an RZG2L_DU_FEATURE_COMPONENT flag and use the component
> > > > > > framework for it. The first available
> > > > DU
> > > > > > instance is the master and creates the DRM device, the other one binds to it as a component.
> > > > > >
> > > > > > If only one DU instance is available, it creates the DRM device
> > > > > > directly at probe time, as on SoCs without the flag.
> > > > > >
> > > > > > Set the index of each instance to the number of CRTCs already created.
> > > > > >
> > > > > > Signed-off-by: Tommaso Merciai
> > > > > > <tommaso.merciai.xr@bp.renesas.com>
> > > > > > ---
> > > > > > v9->v10:
> > > > > >  - New patch.
> > > > > >
> > > > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 118 ++++++++++++++++++-
> > > > > >  drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h |   2 +
> > > > > >  2 files changed, 115 insertions(+), 5 deletions(-)
> > > > > >
> > > > > > diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > > b/drivers/gpu/drm/renesas/rz- du/rzg2l_du_drv.c index
> > > > > > 93d59e2cf8a4..873586f2ef28 100644
> > > > > > --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > > +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> > > > > > @@ -7,6 +7,7 @@
> > > > > >   * Based on rcar_du_drv.c
> > > > > >   */
> > > > > >
> > > > > > +#include <linux/component.h>
> > > > > >  #include <linux/dma-mapping.h>
> > > > > >  #include <linux/module.h>
> > > > > >  #include <linux/of.h>
> > > > > > @@ -14,10 +15,12 @@
> > > > > >
> > > > > >  #include <drm/clients/drm_client_setup.h>  #include
> > > > > > <drm/drm_atomic_helper.h>
> > > > > > +#include <drm/drm_crtc.h>
> > > > > >  #include <drm/drm_drv.h>
> > > > > >  #include <drm/drm_fbdev_dma.h>
> > > > > >  #include <drm/drm_gem_dma_helper.h>  #include
> > > > > > <drm/drm_managed.h>
> > > > > > +#include <drm/drm_of.h>
> > > > > >  #include <drm/drm_print.h>
> > > > > >  #include <drm/drm_probe_helper.h>
> > > > > >
> > > > > > @@ -170,6 +173,7 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > > > >  				  struct drm_device *ddev)
> > > > > >  {
> > > > > >  	struct rzg2l_du_device *rcdu;
> > > > > > +	int ret;
> > > > > >
> > > > > >  	rcdu = drmm_kzalloc(ddev, sizeof(*rcdu), GFP_KERNEL);
> > > > > >  	if (!rcdu)
> > > > > > @@ -180,9 +184,28 @@ static int rzg2l_du_instance_init(struct rzg2l_du_device *du,
> > > > > >  	rcdu->mmio = du->mmio;
> > > > > >  	rcdu->ddev = ddev;
> > > > > >
> > > > > > -	return rzg2l_du_modeset_init_du(rcdu);
> > > > > > +	rcdu->index = ddev->mode_config.num_crtc;
> > > > > > +
> > > > > > +	ret = rzg2l_du_modeset_init_du(rcdu);
> > > > > > +	if (ret < 0)
> > > > > > +		return ret;
> > > > > > +
> > > > > > +	if (WARN_ON(drm_crtc_index(&rcdu->crtcs[0].crtc) != rcdu->index))
> > > > > > +		return -EINVAL;
> > > > > > +
> > > > > > +	return 0;
> > > > > >  }
> > > > > >
> > > > > > +static int rzg2l_du_instance_bind(struct device *dev, struct device *master,
> > > > > > +				  void *data)
> > > > > > +{
> > > > > > +	return rzg2l_du_instance_init(dev_get_drvdata(dev), data); }
> > > > > > +
> > > > > > +static const struct component_ops rzg2l_du_instance_ops = {
> > > > > > +	.bind = rzg2l_du_instance_bind, };
> > > > > > +
> > > > > >  /* -----------------------------------------------------------------------------
> > > > > >   * DRM device
> > > > > >   */
> > > > > > @@ -191,7 +214,7 @@ struct rzg2l_du_drm {
> > > > > >  	struct drm_device ddev;
> > > > > >  };
> > > > > >
> > > > > > -static int rzg2l_du_drm_init(struct device *dev)
> > > > > > +static int rzg2l_du_drm_init(struct device *dev, bool
> > > > > > +has_components)
> > > > > >  {
> > > > > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > > > > >  	struct rzg2l_du_drm *rzgdrm;
> > > > > > @@ -213,6 +236,12 @@ static int rzg2l_du_drm_init(struct device *dev)
> > > > > >  	if (ret < 0)
> > > > > >  		goto error;
> > > > > >
> > > > > > +	if (has_components) {
> > > > > > +		ret = component_bind_all(dev, ddev);
> > > > > > +		if (ret < 0)
> > > > > > +			goto error;
> > > > > > +	}
> > > > > > +
> > > > > >  	ret = rzg2l_du_modeset_init_finish(ddev);
> > > > > >  	if (ret < 0)
> > > > > >  		goto error_fini;
> > > > > > @@ -235,6 +264,8 @@ static int rzg2l_du_drm_init(struct device
> > > > > > *dev)
> > > > > >
> > > > > >  error_fini:
> > > > > >  	drm_kms_helper_poll_fini(ddev);
> > > > > > +	if (has_components)
> > > > > > +		component_unbind_all(dev, ddev);
> > > > > >  error:
> > > > > >  	/*
> > > > > >  	 * Don't use dev_err_probe(), as it would overwrite the probe
> > > > > > deferral @@ -246,7 +277,7 @@ static int rzg2l_du_drm_init(struct device *dev)
> > > > > >  	return ret;
> > > > > >  }
> > > > > >
> > > > > > -static void rzg2l_du_drm_fini(struct device *dev)
> > > > > > +static void rzg2l_du_drm_fini(struct device *dev, bool
> > > > > > +has_components)
> > > > > >  {
> > > > > >  	struct rzg2l_du_device *du = dev_get_drvdata(dev);
> > > > > >  	struct drm_device *ddev = du->ddev; @@ -254,6 +285,83 @@
> > > > > > static void rzg2l_du_drm_fini(struct device *dev)
> > > > > >  	drm_dev_unregister(ddev);
> > > > > >  	drm_atomic_helper_shutdown(ddev);
> > > > > >  	drm_kms_helper_poll_fini(ddev);
> > > > > > +
> > > > > > +	if (has_components)
> > > > > > +		component_unbind_all(dev, ddev);
> > > > > > +
> > > > > > +	du->ddev = NULL;
> > > > > > +}
> > > > > > +
> > > > > > +/*
> > > > > > +---------------------------------------------------------------
> > > > > > +--------
> > > > > > +------
> > > > > > + * Component master
> > > > > > + */
> > > > > > +
> > > > > > +static int rzg2l_du_master_bind(struct device *dev) {
> > > > > > +	return rzg2l_du_drm_init(dev, true); }
> > > > > > +
> > > > > > +static void rzg2l_du_master_unbind(struct device *dev) {
> > > > > > +	rzg2l_du_drm_fini(dev, true);
> > > > > > +}
> > > > > > +
> > > > > > +static const struct component_master_ops rzg2l_du_master_ops = {
> > > > > > +	.bind = rzg2l_du_master_bind,
> > > > > > +	.unbind = rzg2l_du_master_unbind, };
> > > > > > +
> > > > > > +static int rzg2l_du_instance_probe(struct rzg2l_du_device *du) {
> > > > > > +	struct component_match *match = NULL;
> > > > > > +	const struct of_device_id *of_id;
> > > > > > +	struct device *dev = du->dev;
> > > > > > +
> > > > > > +	if (!rzg2l_du_has(du, RZG2L_DU_FEATURE_COMPONENT))
> > > > > > +		return rzg2l_du_drm_init(dev, false);
> > > > > > +
> > > > > > +	for_each_available_child_of_node_scoped(dev->of_node->parent, np) {
> > > > > > +		of_id = of_match_node(dev->driver->of_match_table, np);
> > > > > > +		if (!of_id || of_id->data != du->info)
> > > > > > +			continue;
> > > > > > +
> > > > > > +		/* The first available DU instance is the component master. */
> > > > > > +		if (!du->is_master) {
> > > > > > +			if (np != dev->of_node)
> > > > > > +				return component_add(dev, &rzg2l_du_instance_ops);
> > > > > > +
> > > > > > +			du->is_master = true;
> > > > > > +			continue;
> > > > > > +		}
> > > > > > +
> > > > > > +		drm_of_component_match_add(dev, &match, component_compare_of,
> > > > > > +np);
> > > > >
> > > > >
> > > > > The master is chosen purely by DT order. If the first available DU
> > > > > never probes, the second never gets a DRM device. How do you handle this case?
> > > >
> > > > All available instances are part of the component match, so the DRM
> > > > device is only created once all of them have probed, whichever one
> > > > is the master.
> > > >
> > > > This is how the component framework works.
> > > >
> > > > To use a single DU, the other one can be disabled in DT, in this
> > > > case the remaining instance becomes the master and initializes the
> > > > DRM device on its own.
> > >
> > >
> > > Assume both DU's available and run time
> > >
> > > second DU is probed first and master never probed at all.
> > > What is the state of second DU as bind never calls?
> > 
> > 
> > The second DU probes, registers itself with component_add() and stays idle, without touching the
> > hardware.
> > 
> > When the master probes, both instances are bound and the DRM device is created.
> > 
> > If the master never probes, there is no DRM device, because the bind is only triggered once the master
> > has registered the aggregate device with
> > component_master_add_with_match()
> 
> Not sure is it the normal use case? DU0 and DU1 are independent devices
> 
> 1) DU0 or DU1 should work independently irrespective of the probe failure of
>    other device
> 
> 2) When both DU's are probed, then we need to aggregate the device using component
>    framework so that use case like dynamically switching DSI0 to DSI1 can be achieved.

IMHO 1) and 2) can't be achieved together.

CRTCs and planes can't be added to a DRM device after it has been registered.
If DU0 registered the DRM device on its own, DU1 could not join it later.

To have both DUs in one DRM device, as needed for 2), the DRM device must be
created once both instances are present.

That is what the component framework does here.
I'm seeing others, let me say "multi-instance" drivers such as:

	- rockchip_drm_drv.c [1]
	- imx-drm-core.c [2]
	- sun4i_drv.c [3]

Which are working with the same pattern.

IMHO a probe failure is also unlikely in practice: the DU probe only maps the
registers, sets the DMA mask and allocates memory.

The dependencies (VSP, bridges, clocks) are looked up at bind time, where -EPROBE_DEFER
is handled. To use a single DU, the other one can be disabled in the
device tree.

[1] https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/gpu/drm/rockchip/rockchip_drm_drv.c#L145
[2] https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/gpu/drm/imx/ipuv3/imx-drm-core.c#L210
[3] https://elixir.bootlin.com/linux/v7.4-rc1/source/drivers/gpu/drm/sun4i/sun4i_drv.c#L62

Kind regards,
Tommaso

> 
> Cheers,
> Biju
> 
> 

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

end of thread, other threads:[~2026-11-24 14:53 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 12:19 [PATCH v10 00/12] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
2026-11-13 12:19 ` [PATCH v10 01/12] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
2026-11-13 12:19 ` [PATCH v10 02/12] drm: renesas: rz-du: vsp: Keep the planes in the VSP Tommaso Merciai
2026-11-18 14:09   ` Biju Das
2026-11-18 18:08     ` Tommaso Merciai
2026-11-13 12:19 ` [PATCH v10 03/12] drm: renesas: rz-du: Reference the DRM device by pointer Tommaso Merciai
2026-11-23 15:55   ` Biju Das
2026-11-13 12:20 ` [PATCH v10 04/12] drm: renesas: rz-du: Count all registered encoders for the possible clones Tommaso Merciai
2026-11-23 16:16   ` Biju Das
2026-11-13 12:20 ` [PATCH v10 05/12] drm: renesas: rz-du: Split the mode setting initialization Tommaso Merciai
2026-11-23 16:31   ` Biju Das
2026-11-13 12:20 ` [PATCH v10 06/12] drm: renesas: rz-du: Make the CRTC index relative to the DRM device Tommaso Merciai
2026-11-23 16:37   ` Biju Das
2026-11-13 12:20 ` [PATCH v10 07/12] drm: renesas: rz-du: Share the encoder of an output driven by several DUs Tommaso Merciai
2026-11-23 16:44   ` Biju Das
2026-11-13 12:20 ` [PATCH v10 08/12] drm: renesas: rz-du: Separate the DU instance from the DRM device Tommaso Merciai
2026-11-23 16:59   ` Biju Das
2026-11-24  9:20     ` Tommaso Merciai
2026-11-24  9:33       ` Biju Das
2026-11-24 11:59         ` Tommaso Merciai
2026-11-24 12:51           ` Biju Das
2026-11-13 12:20 ` [PATCH v10 09/12] drm: renesas: rz-du: Move the DRM device initialization to helpers Tommaso Merciai
2026-11-13 12:20 ` [PATCH v10 10/12] drm: renesas: rz-du: Support several DU instances in one DRM device Tommaso Merciai
2026-11-24  7:47   ` Biju Das
2026-11-24 11:53     ` Tommaso Merciai
2026-11-24 13:18       ` Biju Das
2026-11-24 13:59         ` Tommaso Merciai
2026-11-24 14:11           ` Biju Das
2026-11-24 14:52             ` Tommaso Merciai
2026-11-13 12:20 ` [PATCH v10 11/12] drm: renesas: rz-du: Add RZ/G3E (R9A09G047) DU support Tommaso Merciai
2026-11-13 12:20 ` [PATCH v10 12/12] arm64: dts: renesas: r9a09g047: Add DU{0,1} nodes Tommaso Merciai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®