Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC
@ 2026-09-07  9:29 Tomi Valkeinen
  2026-09-07  9:29 ` [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen, Conor Dooley

Some DSI pipelines have DSC (Display Stream Compression) IP block
between the DU and the DSI. Even if DSC is not needed, the IP must be
enabled for the DSI output to work.

This series adds a basic DSC driver, so that the DSC IP gets enabled in
bypass mode. This enables DisplayPort output on Sparrow Hawk board, as
the DP output comes from DSI and sn65dsi86 bridge, and also White Hawk
board's second mini-DP output.

Original series from Marek.

Note: I see that not every run of kms++'s kmstest gives me a picture on
my monitor. Sometimes the monitor seems to be trying to repeatedly sync,
but fails, and the screen stays black. However, I see this same issue on
WhiteHawk, which uses DSI0 pipeline, without DSC, so I think that is a
separate issue.

 Tomi

Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
Changes in v6:
- Rebased on latest drm-misc-next, fixing the compile issues caused by
  the rebase
- Minor things: commit desc cleanups, indentation change, dropping
  unused include.
- Link to v5: https://patch.msgid.link/20260615-rcar-du-dsc-v5-0-aed1a28610e4@ideasonboard.com

Changes in v5:
- Drop the "renesas,rcar-dsc" compatible, and rename the binding file to renesas,r8a779g0-dsc.yaml
- Check pm_runtime_get_sync() < 0 for error, instead of
  pm_runtime_get_sync() != 0
- Move pm_runtime_enable() before drm_bridge_add(), so that runtime PM
  is ready when we publish the bridge
- Fix "DCS" typo in commit desc
- Rewrite "drm/rcar-du: dsi: Support DSC in the pipeline" again, this
  time solving the DSI/DSC question in rcar_du_encoder_init()
- Link to v4: https://patch.msgid.link/20260615-rcar-du-dsc-v4-0-93096a1b56a3@ideasonboard.com

Changes in v4:
- Add 'renesas,rcar-dsc' compatible, in addition to the SoC specific
  compatible
- Use 'bridge' as the name of the DT node
- Arrange Kconfig and Makefile entries alphabetically
- Rebase on drm-misc-next, and fix the drm_atomic_state rename issue
- Use pm_runtime_get_sync() in .atomic_enable() instead of
  pm_runtime_resume_and_get() to fix the possible runtime PM get/put
  discrepancy
- Drop ioremap and mmio field, as the driver does not touch the
  registers
- Use of_drm_get_bridge_by_endpoint() to get the next bridge
- Rewrite "drm/rcar-du: dsi: Support DSC in the pipeline" to use
  bridge->type to detect the DSI and the DSC
- And some cosmetic fixes pointed out in the review comments
- Link to v3: https://patch.msgid.link/20260515-rcar-du-dsc-v3-0-164157820498@ideasonboard.com

Changes in v3:
- Simplify DSC driver: drop reset control, drop clk handling, use runtime PM
- Split dts changes for r8a779g0 and sparrow-hawk to separate patches
- Add "arm64: dts: renesas: white-hawk: Add second mini-DP output
  support"
- Link to v2: https://patch.msgid.link/20260515-rcar-du-dsc-v2-0-f6b9240a1240@ideasonboard.com

Changes in v2:
- Fixed the dts example in "dt-bindings: display: bridge: Document
  Renesas R-Car V4H DSC bindings"
- Link to v1: https://lore.kernel.org/r/20260514-rcar-du-dsc-v1-0-d65f7a9e9841@ideasonboard.com

---
Geert Uytterhoeven (1):
      arm64: dts: renesas: white-hawk: Add second mini-DP output support

Marek Vasut (4):
      dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings
      drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver
      arm64: dts: renesas: r8a779g0: Add DSC
      arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC

Tomi Valkeinen (1):
      drm/rcar-du: dsi: Support DSC in the pipeline

 .../display/bridge/renesas,r8a779g0-dsc.yaml       |  96 +++++++++++++
 .../arm64/boot/dts/renesas/r8a779g0-white-hawk.dts |  94 +++++++++++++
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi          |  31 ++++-
 .../boot/dts/renesas/r8a779g3-sparrow-hawk.dts     |   5 +
 drivers/gpu/drm/renesas/rcar-du/Kconfig            |  12 ++
 drivers/gpu/drm/renesas/rcar-du/Makefile           |   1 +
 drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c         | 153 +++++++++++++++++++++
 drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c  |  17 ++-
 drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c    |   1 +
 9 files changed, 407 insertions(+), 3 deletions(-)
---
base-commit: a9f09b5ea0c3db1e2d4c0f8d3ebdd612d8aa0366
change-id: 20260514-rcar-du-dsc-45bcf0c2fe86

Best regards,
--  
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>


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

* [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
@ 2026-09-07  9:29 ` Tomi Valkeinen
  2026-09-07  9:29 ` [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen, Conor Dooley

From: Marek Vasut <marek.vasut+renesas@mailbox.org>

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge performs VESA DSC encoding of up to
8k or 400 Mpixel/s.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[tomi.valkeinen: fix the example]
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 .../display/bridge/renesas,r8a779g0-dsc.yaml       | 96 ++++++++++++++++++++++
 1 file changed, 96 insertions(+)

diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,r8a779g0-dsc.yaml b/Documentation/devicetree/bindings/display/bridge/renesas,r8a779g0-dsc.yaml
new file mode 100644
index 000000000000..6ce2444409a2
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/renesas,r8a779g0-dsc.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/renesas,r8a779g0-dsc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas R-Car DSC Display Stream Compression
+
+maintainers:
+  - Marek Vasut <marek.vasut+renesas@mailbox.org>
+
+description: |
+  This binding describes the VESA DSC Display Stream Compression encoder
+  embedded in the Renesas R-Car V4H SoC. The encoder supports all DSC1.1
+  encoding mechanisms, configurable bits-per-pixel, resolution up to 8k.
+
+properties:
+  compatible:
+    const: renesas,r8a779g0-dsc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  ports:
+    $ref: /schemas/graph.yaml#/properties/ports
+
+    properties:
+      port@0:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: R-Car DU input port
+
+      port@1:
+        $ref: /schemas/graph.yaml#/properties/port
+        description: R-Car DSI output port
+
+    required:
+      - port@0
+      - port@1
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - interrupts
+  - power-domains
+  - resets
+  - ports
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/r8a779g0-sysc.h>
+
+    bridge@feb8d000 {
+        compatible = "renesas,r8a779g0-dsc";
+        reg = <0xfeb8d000 0x400>;
+        interrupts = <GIC_SPI 559 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpg CPG_MOD 2819>;
+        power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+        resets = <&cpg 2819>;
+
+        ports {
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            port@0 {
+                reg = <0>;
+                dsc_in_dsi1: endpoint {
+                    remote-endpoint = <&du_out_dsi1>;
+                };
+            };
+
+            port@1 {
+                reg = <1>;
+                dsc_out_dsi1: endpoint {
+                    remote-endpoint = <&dsi1_in>;
+                };
+            };
+        };
+    };
+...

-- 
2.43.0


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

* [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
  2026-09-07  9:29 ` [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
@ 2026-09-07  9:29 ` Tomi Valkeinen
  2026-09-07  9:42   ` sashiko-bot
  2026-09-07  9:29 ` [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen

From: Marek Vasut <marek.vasut+renesas@mailbox.org>

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge performs VESA DSC encoding of up to
8k or 400 Mpixel/s. Add rudimentary driver, which currently acts as a
pass-through bridge and allows DSI1 to be operational on R-Car V4H.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[tomi.valkeinen: use bridge->next_bridge, minor changes]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/renesas/rcar-du/Kconfig    |  12 +++
 drivers/gpu/drm/renesas/rcar-du/Makefile   |   1 +
 drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c | 153 +++++++++++++++++++++++++++++
 3 files changed, 166 insertions(+)

diff --git a/drivers/gpu/drm/renesas/rcar-du/Kconfig b/drivers/gpu/drm/renesas/rcar-du/Kconfig
index 840305fdeb49..80bd770ae0f6 100644
--- a/drivers/gpu/drm/renesas/rcar-du/Kconfig
+++ b/drivers/gpu/drm/renesas/rcar-du/Kconfig
@@ -25,6 +25,18 @@ config DRM_RCAR_CMM
 	def_tristate DRM_RCAR_DU
 	depends on DRM_RCAR_USE_CMM
 
+config DRM_RCAR_USE_DSC
+	bool "R-Car DU DSC Encoder Support"
+	depends on DRM_BRIDGE && OF
+	depends on DRM_RCAR_DU || COMPILE_TEST
+	default DRM_RCAR_DU
+	help
+	  Enable support for the R-Car Display Unit embedded DSC encoder.
+
+config DRM_RCAR_DSC
+	def_tristate DRM_RCAR_DU
+	depends on DRM_RCAR_USE_DSC
+
 config DRM_RCAR_DW_HDMI
 	tristate "R-Car Gen3 and RZ/G2 DU HDMI Encoder Support"
 	depends on DRM && OF
diff --git a/drivers/gpu/drm/renesas/rcar-du/Makefile b/drivers/gpu/drm/renesas/rcar-du/Makefile
index 6f132325c8b7..9ab7a0ac45d8 100644
--- a/drivers/gpu/drm/renesas/rcar-du/Makefile
+++ b/drivers/gpu/drm/renesas/rcar-du/Makefile
@@ -10,6 +10,7 @@ rcar-du-drm-$(CONFIG_DRM_RCAR_VSP)	+= rcar_du_vsp.o
 rcar-du-drm-$(CONFIG_DRM_RCAR_WRITEBACK) += rcar_du_writeback.o
 
 obj-$(CONFIG_DRM_RCAR_CMM)		+= rcar_cmm.o
+obj-$(CONFIG_DRM_RCAR_DSC)		+= rcar_dsc.o
 obj-$(CONFIG_DRM_RCAR_DU)		+= rcar-du-drm.o
 obj-$(CONFIG_DRM_RCAR_DW_HDMI)		+= rcar_dw_hdmi.o
 obj-$(CONFIG_DRM_RCAR_LVDS)		+= rcar_lvds.o
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
new file mode 100644
index 000000000000..1882ae34ce8f
--- /dev/null
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * R-Car DSC Encoder
+ *
+ * Copyright (C) 2025 Marek Vasut <marek.vasut+renesas@mailbox.org>
+ * Copyright (C) 2025 Renesas Electronics Corporation
+ */
+
+#include <linux/container_of.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_bridge.h>
+
+struct rcar_dsc {
+	struct drm_bridge bridge;
+
+	struct device *dev;
+};
+
+static inline struct rcar_dsc *bridge_to_rcar_dsc(struct drm_bridge *bridge)
+{
+	return container_of(bridge, struct rcar_dsc, bridge);
+}
+
+/* -----------------------------------------------------------------------------
+ * Bridge
+ */
+
+static int rcar_dsc_attach(struct drm_bridge *bridge,
+			   struct drm_encoder *encoder,
+			   enum drm_bridge_attach_flags flags)
+{
+	struct rcar_dsc *dsc = bridge_to_rcar_dsc(bridge);
+
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+		return -EINVAL;
+
+	return drm_bridge_attach(encoder, dsc->bridge.next_bridge, bridge,
+				 DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+}
+
+static void rcar_dsc_atomic_enable(struct drm_bridge *bridge,
+				   struct drm_atomic_commit *commit)
+{
+	struct rcar_dsc *dsc = bridge_to_rcar_dsc(bridge);
+
+	WARN_ON(pm_runtime_get_sync(dsc->dev) < 0);
+}
+
+static void rcar_dsc_atomic_disable(struct drm_bridge *bridge,
+				    struct drm_atomic_commit *commit)
+{
+	struct rcar_dsc *dsc = bridge_to_rcar_dsc(bridge);
+
+	pm_runtime_put(dsc->dev);
+}
+
+static enum drm_mode_status
+rcar_dsc_bridge_mode_valid(struct drm_bridge *bridge,
+			   const struct drm_display_info *info,
+			   const struct drm_display_mode *mode)
+{
+	if (mode->hdisplay < 320 || mode->hdisplay > 8190)
+		return MODE_BAD_HVALUE;
+
+	if (mode->vdisplay < 160 || mode->vdisplay > 8190)
+		return MODE_BAD_VVALUE;
+
+	if (mode->clock > 400000) /* Really 400 Mpixel/s */
+		return MODE_CLOCK_HIGH;
+
+	return MODE_OK;
+}
+
+static const struct drm_bridge_funcs rcar_dsc_bridge_ops = {
+	.attach = rcar_dsc_attach,
+	.atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+	.atomic_create_state = drm_atomic_helper_bridge_create_state,
+	.atomic_enable = rcar_dsc_atomic_enable,
+	.atomic_disable = rcar_dsc_atomic_disable,
+	.mode_valid = rcar_dsc_bridge_mode_valid,
+};
+
+/* -----------------------------------------------------------------------------
+ * Probe & Remove
+ */
+
+static int rcar_dsc_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct rcar_dsc *dsc;
+	int ret;
+
+	dsc = devm_drm_bridge_alloc(dev, struct rcar_dsc, bridge,
+				    &rcar_dsc_bridge_ops);
+	if (IS_ERR(dsc))
+		return PTR_ERR(dsc);
+
+	platform_set_drvdata(pdev, dsc);
+
+	dsc->dev = &pdev->dev;
+
+	dsc->bridge.next_bridge = of_drm_get_bridge_by_endpoint(dev->of_node,
+								1, 0);
+	if (IS_ERR(dsc->bridge.next_bridge))
+		return PTR_ERR(dsc->bridge.next_bridge);
+
+	dsc->bridge.of_node = dev->of_node;
+
+	pm_runtime_enable(&pdev->dev);
+
+	ret = devm_drm_bridge_add(dev, &dsc->bridge);
+	if (ret)
+		goto err_runtime_disable;
+
+	return 0;
+
+err_runtime_disable:
+	pm_runtime_disable(&pdev->dev);
+
+	return ret;
+}
+
+static void rcar_dsc_remove(struct platform_device *pdev)
+{
+	pm_runtime_disable(&pdev->dev);
+}
+
+static const struct of_device_id rcar_dsc_of_table[] = {
+	{ .compatible = "renesas,r8a779g0-dsc" },
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, rcar_dsc_of_table);
+
+static struct platform_driver rcar_dsc_platform_driver = {
+	.probe          = rcar_dsc_probe,
+	.remove		= rcar_dsc_remove,
+	.driver         = {
+		.name   = "rcar-dsc",
+		.of_match_table = rcar_dsc_of_table,
+	},
+};
+
+module_platform_driver(rcar_dsc_platform_driver);
+
+MODULE_DESCRIPTION("Renesas R-Car DSC Encoder Driver");
+MODULE_LICENSE("GPL");

-- 
2.43.0


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

* [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
  2026-09-07  9:29 ` [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
  2026-09-07  9:29 ` [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
@ 2026-09-07  9:29 ` Tomi Valkeinen
  2026-09-07  9:44   ` sashiko-bot
  2026-09-07  9:29 ` [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC Tomi Valkeinen
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen

Enabling DSI clocks on rcar-du needs some tricks as the DU dot clock is
provided by the DSI. Thus, we call rcar_mipi_dsi_pclk_enable() from the
crtc, when enabling the crtc.

With DSC in the pipeline, between the DU and the DSI, the above call
path is broken as the crtc tries to call rcar_mipi_dsi_pclk_enable() on
the DSC.

To solve this problem, make sure we store the DSI bridge to the
rcdu->dsi[] array, instead of the first bridge in the DSI pipeline
(which can be DSC), by checking the bridge's bridge->type.

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c | 17 +++++++++++++++--
 drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c   |  1 +
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
index d8e7e9877ba8..3f98eae9b6ac 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
@@ -90,9 +90,22 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
 				drm_bridge_get(bridge);
 
 		if (output == RCAR_DU_OUTPUT_DSI0 ||
-		    output == RCAR_DU_OUTPUT_DSI1)
+		    output == RCAR_DU_OUTPUT_DSI1) {
+			struct drm_bridge *dsi_bridge;
+
+			/*
+			 * When we have a DSC block between the DU and the DSI,
+			 * the "bridge" points to the DSC. Detect the DSC by looking
+			 * at the bridge type, and skip the DSC if the bridge is not
+			 * the DSI bridge.
+			 */
+
+			dsi_bridge = bridge->type == DRM_MODE_CONNECTOR_DSI ?
+				     bridge : bridge->next_bridge;
+
 			rcdu->dsi[output - RCAR_DU_OUTPUT_DSI0] =
-				drm_bridge_get(bridge);
+				drm_bridge_get(dsi_bridge);
+		}
 	}
 
 	/*
diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
index 6e46d6d99f3c..af4edb207486 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c
@@ -957,6 +957,7 @@ static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host,
 
 	/* Initialize the DRM bridge. */
 	dsi->bridge.of_node = dsi->dev->of_node;
+	dsi->bridge.type = DRM_MODE_CONNECTOR_DSI;
 	drm_bridge_add(&dsi->bridge);
 
 	return 0;

-- 
2.43.0


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

* [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
                   ` (2 preceding siblings ...)
  2026-09-07  9:29 ` [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
@ 2026-09-07  9:29 ` Tomi Valkeinen
  2026-09-08 12:11   ` Geert Uytterhoeven
  2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen

From: Marek Vasut <marek.vasut+renesas@mailbox.org>

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge is placed between DU and DSI1 units.

The current dtsi file does not represent the DSC at all, and thus the
pipeline for DSI1 has not been functional.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[tomi.valkeinen: separated the sparrowhawk changes]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
index 8a291447b904..285dd88e060c 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
@@ -2315,6 +2315,35 @@ du_out_dsi0: endpoint {
 				port@1 {
 					reg = <1>;
 					du_out_dsi1: endpoint {
+						remote-endpoint = <&dsc_in_dsi1>;
+					};
+				};
+			};
+		};
+
+		dsc: bridge@feb8d000 {
+			compatible = "renesas,r8a779g0-dsc";
+			reg = <0 0xfeb8d000 0 0x400>;
+			interrupts = <GIC_SPI 559 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 2819>;
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 2819>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+					dsc_in_dsi1: endpoint {
+						remote-endpoint = <&du_out_dsi1>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					dsc_out_dsi1: endpoint {
 						remote-endpoint = <&dsi1_in>;
 					};
 				};
@@ -2551,7 +2580,7 @@ ports {
 				port@0 {
 					reg = <0>;
 					dsi1_in: endpoint {
-						remote-endpoint = <&du_out_dsi1>;
+						remote-endpoint = <&dsc_out_dsi1>;
 					};
 				};
 

-- 
2.43.0


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

* [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
                   ` (3 preceding siblings ...)
  2026-09-07  9:29 ` [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC Tomi Valkeinen
@ 2026-09-07  9:29 ` Tomi Valkeinen
  2026-09-07  9:43   ` sashiko-bot
  2026-09-08 12:16   ` Geert Uytterhoeven
  2026-09-07  9:29 ` [PATCH v6 6/6] arm64: dts: renesas: white-hawk: Add second mini-DP output support Tomi Valkeinen
  2026-09-11  7:07 ` [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
  6 siblings, 2 replies; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen

From: Marek Vasut <marek.vasut+renesas@mailbox.org>

DisplayPort on the Sparrow Hawk board uses sn65dsi86 bridge, which in
turn gets the video stream from the SoC's DSI1 port. DSI1 pipeline has a
DSC block in between the DU and the DSI1. However, there was no DSC
driver in Linux and also the DSC was not defined in the dts files, and
thus the DisplayPort output did not work.

Now that we have DSC defined in the SoC dts file (r8a779g0.dtsi), we can
enable DSC for sparrowhawk.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[tomi.valkeinen: separated the sparrow hawk changes from the soc changes]
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts b/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts
index af680290ce81..0a5ebe0460ca 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts
@@ -288,6 +288,11 @@ channel4 {
 	};
 };
 
+/* Page 27 / DSI to Display */
+&dsc {
+	status = "okay";
+};
+
 /* Page 27 / DSI to Display */
 &dsi1 {
 	status = "okay";

-- 
2.43.0


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

* [PATCH v6 6/6] arm64: dts: renesas: white-hawk: Add second mini-DP output support
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
                   ` (4 preceding siblings ...)
  2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
@ 2026-09-07  9:29 ` Tomi Valkeinen
  2026-09-11  7:07 ` [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
  6 siblings, 0 replies; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-07  9:29 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Tomi Valkeinen

From: Geert Uytterhoeven <geert+renesas@glider.be>

Add support for the mini-DisplayPort connector on the White Hawk
BreakOut board. This connector is driven by a TI SN65DSI86 DSI to eDP
bridge, which in turn gets the pixel data from the second DSI channel on
the R-Car V4H SoC. Note that this port is not present on the White Hawk
Single development board.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
[tomi.valkeinen: added status=okay for dsc]
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
---
 .../arm64/boot/dts/renesas/r8a779g0-white-hawk.dts | 94 ++++++++++++++++++++++
 1 file changed, 94 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk.dts b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk.dts
index 784d4e8b204c..89d60b83ac4f 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk.dts
@@ -12,4 +12,98 @@
 / {
 	model = "Renesas White Hawk CPU and Breakout boards based on r8a779g0";
 	compatible = "renesas,white-hawk-breakout", "renesas,white-hawk-cpu", "renesas,r8a779g0";
+
+	sn65dsi86_refclk2: clk-x16 {
+		compatible = "fixed-clock";
+		#clock-cells = <0>;
+		clock-frequency = <38400000>;
+	};
+
+	mini-dp-con2 {
+		compatible = "dp-connector";
+		label = "CN15";
+		type = "mini";
+
+		port {
+			mini_dp_con_in2: endpoint {
+				remote-endpoint = <&sn65dsi86_out2>;
+			};
+		};
+	};
+};
+
+&dsc {
+	status = "okay";
+};
+
+&dsi1 {
+	status = "okay";
+
+	ports {
+		port@1 {
+			dsi1_out: endpoint {
+				remote-endpoint = <&sn65dsi86_in2>;
+				data-lanes = <1 2 3 4>;
+			};
+		};
+	};
+};
+
+&i2c4 {
+	pinctrl-0 = <&i2c4_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+	clock-frequency = <400000>;
+
+	bridge@2c {
+		pinctrl-0 = <&irq1_pins>;
+		pinctrl-names = "default";
+
+		compatible = "ti,sn65dsi86";
+		reg = <0x2c>;
+
+		clocks = <&sn65dsi86_refclk2>;
+		clock-names = "refclk";
+
+		interrupts-extended = <&intc_ex 1 IRQ_TYPE_LEVEL_HIGH>;
+
+		enable-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+
+		vccio-supply = <&reg_1p8v>;
+		vpll-supply = <&reg_1p8v>;
+		vcca-supply = <&reg_1p2v>;
+		vcc-supply = <&reg_1p2v>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+				sn65dsi86_in2: endpoint {
+					remote-endpoint = <&dsi1_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+				sn65dsi86_out2: endpoint {
+					remote-endpoint = <&mini_dp_con_in2>;
+				};
+			};
+		};
+	};
+};
+
+&pfc {
+	i2c4_pins: i2c4 {
+		groups = "i2c4";
+		function = "i2c4";
+	};
+
+	irq1_pins: irq1 {
+		groups = "intc_ex_irq1_a";
+		function = "intc_ex";
+	};
 };

-- 
2.43.0


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

* Re: [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver
  2026-09-07  9:29 ` [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
@ 2026-09-07  9:42   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-09-07  9:42 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: dri-devel, linux-clk, robh, conor+dt, devicetree, wsa+renesas

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Lifecycle teardown order inversion between manual PM runtime disable and devres bridge removal.
--

commit a2a78077050a0efecae114552f483f67a6423d4c
Author: Marek Vasut <marek.vasut+renesas@mailbox.org>

drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge performs VESA DSC encoding of up to
8k or 400 Mpixel/s. Add rudimentary driver, which currently acts as a
pass-through bridge and allows DSI1 to be operational on R-Car V4H.

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
> new file mode 100644
> index 0000000000000..1882ae34ce8f5
> --- /dev/null
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
[ ... ]
> +static void rcar_dsc_atomic_enable(struct drm_bridge *bridge,
> +				   struct drm_atomic_commit *commit)
> +{
> +	struct rcar_dsc *dsc = bridge_to_rcar_dsc(bridge);
> +
> +	WARN_ON(pm_runtime_get_sync(dsc->dev) < 0);
> +}
[ ... ]
> +static int rcar_dsc_probe(struct platform_device *pdev)
> +{
[ ... ]
> +	pm_runtime_enable(&pdev->dev);
> +
> +	ret = devm_drm_bridge_add(dev, &dsc->bridge);
> +	if (ret)
> +		goto err_runtime_disable;
> +
> +	return 0;
> +
> +err_runtime_disable:
> +	pm_runtime_disable(&pdev->dev);
> +
> +	return ret;
> +}
> +
> +static void rcar_dsc_remove(struct platform_device *pdev)
> +{
> +	pm_runtime_disable(&pdev->dev);
> +}

[Severity: High]
Does this create a lifecycle teardown order inversion during driver unbind?

When the driver is unbound, the driver core executes the manual
rcar_dsc_remove() callback first, which calls pm_runtime_disable(). Only
afterwards does the devres infrastructure execute drm_bridge_remove()
(registered via devm_drm_bridge_add() in rcar_dsc_probe()), removing the
bridge from the system.

During this window, the DRM bridge remains active and accessible to the DRM
core after its power management has been disabled. If an atomic commit occurs
during this time, rcar_dsc_atomic_enable() will invoke pm_runtime_get_sync(),
which will fail since PM runtime is disabled. This triggers a WARN_ON and
leaves the hardware unpowered.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-rcar-du-dsc-v6-0-f8ef711a7494@ideasonboard.com?part=2

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

* Re: [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC
  2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
@ 2026-09-07  9:43   ` sashiko-bot
  2026-09-08 12:16   ` Geert Uytterhoeven
  1 sibling, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-09-07  9:43 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: wsa+renesas, linux-clk, devicetree, robh, conor+dt, dri-devel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The DRM bridge reference obtained via of_drm_get_bridge_by_endpoint() is leaked on error paths and during driver removal.
--

commit a2a78077050a0efecae114552f483f67a6423d4c
Author: Marek Vasut <marek.vasut+renesas@mailbox.org>

drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver

The Renesas DSC Display Stream Compression is a bridge embedded in the
Renesas R-Car V4H SoC. The bridge performs VESA DSC encoding of up to
8k or 400 Mpixel/s. Add rudimentary driver, which currently acts as a
pass-through bridge and allows DSI1 to be operational on R-Car V4H.

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
> new file mode 100644
> index 0000000000000..1882ae34ce8f5
> --- /dev/null
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_dsc.c
[ ... ]
> +static int rcar_dsc_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct rcar_dsc *dsc;
> +	int ret;
> +
> +	dsc = devm_drm_bridge_alloc(dev, struct rcar_dsc, bridge,
> +				    &rcar_dsc_bridge_ops);
> +	if (IS_ERR(dsc))
> +		return PTR_ERR(dsc);
> +
> +	platform_set_drvdata(pdev, dsc);
> +
> +	dsc->dev = &pdev->dev;
> +
> +	dsc->bridge.next_bridge = of_drm_get_bridge_by_endpoint(dev->of_node,
> +								1, 0);

[Severity: Medium]
Does this code leak the DRM bridge reference obtained via
of_drm_get_bridge_by_endpoint()?

If devm_drm_bridge_add() fails later in rcar_dsc_probe(), the cleanup path
fails to drop this bridge reference.

This means the memory for the downstream bridge object will never be freed.

Since driver probe errors and unbinds are cold paths that require root
privileges or hardware faults to trigger, this leaks the bridge reference
on a cold path.

> +	if (IS_ERR(dsc->bridge.next_bridge))
> +		return PTR_ERR(dsc->bridge.next_bridge);
> +
> +	dsc->bridge.of_node = dev->of_node;
> +
> +	pm_runtime_enable(&pdev->dev);
> +
> +	ret = devm_drm_bridge_add(dev, &dsc->bridge);
> +	if (ret)
> +		goto err_runtime_disable;
> +
> +	return 0;
> +
> +err_runtime_disable:
> +	pm_runtime_disable(&pdev->dev);
> +
> +	return ret;
> +}
> +
> +static void rcar_dsc_remove(struct platform_device *pdev)
> +{
> +	pm_runtime_disable(&pdev->dev);

[Severity: Medium]
Could this leak the DRM bridge reference during driver removal?

Since the reference acquired in rcar_dsc_probe() isn't dropped here,
unbinding the device will leave the struct drm_bridge kref leaked.

> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-rcar-du-dsc-v6-0-f8ef711a7494@ideasonboard.com?part=5

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

* Re: [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline
  2026-09-07  9:29 ` [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
@ 2026-09-07  9:44   ` sashiko-bot
  0 siblings, 0 replies; 13+ messages in thread
From: sashiko-bot @ 2026-09-07  9:44 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: wsa+renesas, linux-clk, robh, devicetree, conor+dt, dri-devel

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [High] Missing validation of the assumed DSI bridge pointer and type can lead to a NULL pointer dereference or type confusion in rcar_mipi_dsi_pclk_enable().

Pre-existing issues:
- [High] The function rcar_mipi_dsi_pclk_enable calls sleeping functions but is executed from the CRTC atomic_enable callback, violating atomic context rules.
--

commit daca709dc803d35328aef5637d1cd674b65a8f0a
Author: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Subject: drm/rcar-du: dsi: Support DSC in the pipeline

This patch modifies the DU encoder initialization to support a DSC block 
between the DU and the DSI. It ensures the DSI bridge is correctly identified 
and stored in the rcdu->dsi[] array by checking the bridge type.

> Enabling DSI clocks on rcar-du needs some tricks as the DU dot clock is
> provided by the DSI. Thus, we call rcar_mipi_dsi_pclk_enable() from the
> crtc, when enabling the crtc.

[Severity: High]
This is a pre-existing issue, but the call path mentioned here executes in
an atomic context and appears to call sleeping functions.

When the display hardware is enabled via a non-blocking modeset, the
rcar_du_crtc_atomic_enable() callback runs in atomic context. It calls
rcar_mipi_dsi_pclk_enable(), which sequentially calls clk_prepare_enable()
(which takes a mutex via the clk API) and rcar_mipi_dsi_startup() which
performs a direct sleep:

drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c:rcar_mipi_dsi_startup()
    usleep_range(400, 500);

Does this violate the atomic context rules by calling sleeping functions
(mutexes and usleep_range) during the atomic CRTC enable callback?

> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c
[ ... ]
> @@ -90,9 +90,22 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
>  				drm_bridge_get(bridge);
>  
>  		if (output == RCAR_DU_OUTPUT_DSI0 ||
> -		    output == RCAR_DU_OUTPUT_DSI1)
> +		    output == RCAR_DU_OUTPUT_DSI1) {
> +			struct drm_bridge *dsi_bridge;
> +
> +			/*
> +			 * When we have a DSC block between the DU and the DSI,
> +			 * the "bridge" points to the DSC. Detect the DSC by looking
> +			 * at the bridge type, and skip the DSC if the bridge is not
> +			 * the DSI bridge.
> +			 */
> +
> +			dsi_bridge = bridge->type == DRM_MODE_CONNECTOR_DSI ?
> +				     bridge : bridge->next_bridge;
> +
>  			rcdu->dsi[output - RCAR_DU_OUTPUT_DSI0] =
> -				drm_bridge_get(bridge);
> +				drm_bridge_get(dsi_bridge);

[Severity: High]
If the bridge is not a DSI bridge (e.g., it is a DSC block), this grabs
bridge->next_bridge without validating if it is non-NULL or if it actually
represents an rcar_mipi_dsi bridge.

If the device tree configures an intermediate bridge before DSI that does not
have a next_bridge set, or if it points to a non-DSI bridge,
bridge->next_bridge will evaluate to NULL or the wrong bridge. This unchecked
value is then saved to rcdu->dsi[].

Later, on the modeset path, rcar_du_crtc_atomic_enable() passes this pointer
to rcar_mipi_dsi_pclk_enable(), which directly dereferences bridge->encoder
and casts it to struct rcar_mipi_dsi:

drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c:rcar_mipi_dsi_pclk_enable()
    struct rcar_mipi_dsi *dsi = bridge_to_rcar_mipi_dsi(bridge);
    ...
    connector = drm_atomic_get_new_connector_for_encoder(state,
                                                         bridge->encoder);

Could this lead to a NULL pointer dereference or type confusion if an
unsupported bridge topology is loaded?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-rcar-du-dsc-v6-0-f8ef711a7494@ideasonboard.com?part=3

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

* Re: [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC
  2026-09-07  9:29 ` [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC Tomi Valkeinen
@ 2026-09-08 12:11   ` Geert Uytterhoeven
  0 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-09-08 12:11 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Michael Turquette, Stephen Boyd, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Magnus Damm, Marek Vasut, Laurent Pinchart, Kieran Bingham,
	Philipp Zabel, linux-renesas-soc, linux-clk, linux-kernel,
	dri-devel, devicetree

On Mon, 7 Sept 2026 at 11:30, Tomi Valkeinen
<tomi.valkeinen+renesas@ideasonboard.com> wrote:
> From: Marek Vasut <marek.vasut+renesas@mailbox.org>
>
> The Renesas DSC Display Stream Compression is a bridge embedded in the
> Renesas R-Car V4H SoC. The bridge is placed between DU and DSI1 units.
>
> The current dtsi file does not represent the DSC at all, and thus the
> pipeline for DSI1 has not been functional.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> [tomi.valkeinen: separated the sparrowhawk changes]
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v7.4, pending acceptance of the
DT bindings.

Gr{oetje,eeting}s,

                        Geert

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

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

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

* Re: [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC
  2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
  2026-09-07  9:43   ` sashiko-bot
@ 2026-09-08 12:16   ` Geert Uytterhoeven
  1 sibling, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2026-09-08 12:16 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Michael Turquette, Stephen Boyd, Andrzej Hajda, Neil Armstrong,
	Robert Foss, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Magnus Damm, Marek Vasut, Laurent Pinchart, Kieran Bingham,
	Philipp Zabel, linux-renesas-soc, linux-clk, linux-kernel,
	dri-devel, devicetree

On Mon, 7 Sept 2026 at 11:30, Tomi Valkeinen
<tomi.valkeinen+renesas@ideasonboard.com> wrote:
> From: Marek Vasut <marek.vasut+renesas@mailbox.org>
>
> DisplayPort on the Sparrow Hawk board uses sn65dsi86 bridge, which in
> turn gets the video stream from the SoC's DSI1 port. DSI1 pipeline has a
> DSC block in between the DU and the DSI1. However, there was no DSC
> driver in Linux and also the DSC was not defined in the dts files, and
> thus the DisplayPort output did not work.
>
> Now that we have DSC defined in the SoC dts file (r8a779g0.dtsi), we can
> enable DSC for sparrowhawk.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> [tomi.valkeinen: separated the sparrow hawk changes from the soc changes]
> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v7.4, pending acceptance of the
DSC DT bindings.

Gr{oetje,eeting}s,

                        Geert

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

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

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

* Re: [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC
  2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
                   ` (5 preceding siblings ...)
  2026-09-07  9:29 ` [PATCH v6 6/6] arm64: dts: renesas: white-hawk: Add second mini-DP output support Tomi Valkeinen
@ 2026-09-11  7:07 ` Tomi Valkeinen
  6 siblings, 0 replies; 13+ messages in thread
From: Tomi Valkeinen @ 2026-09-11  7:07 UTC (permalink / raw)
  To: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
	Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, Marek Vasut,
	Laurent Pinchart, Kieran Bingham, Philipp Zabel
  Cc: linux-renesas-soc, linux-clk, linux-kernel, dri-devel, devicetree,
	Conor Dooley

Hi,

On 07/09/2026 12:29, Tomi Valkeinen wrote:
> Some DSI pipelines have DSC (Display Stream Compression) IP block
> between the DU and the DSI. Even if DSC is not needed, the IP must be
> enabled for the DSI output to work.
> 
> This series adds a basic DSC driver, so that the DSC IP gets enabled in
> bypass mode. This enables DisplayPort output on Sparrow Hawk board, as
> the DP output comes from DSI and sn65dsi86 bridge, and also White Hawk
> board's second mini-DP output.
> 
> Original series from Marek.
> 
> Note: I see that not every run of kms++'s kmstest gives me a picture on
> my monitor. Sometimes the monitor seems to be trying to repeatedly sync,
> but fails, and the screen stays black. However, I see this same issue on
> WhiteHawk, which uses DSI0 pipeline, without DSC, so I think that is a
> separate issue.

Pushed the first three patches to drm-misc-next. I'll leave the dts ones 
to Geert.

  Tomi


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

end of thread, other threads:[~2026-09-11  7:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07  9:29 [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen
2026-09-07  9:29 ` [PATCH v6 1/6] dt-bindings: display: bridge: Document Renesas R-Car V4H DSC bindings Tomi Valkeinen
2026-09-07  9:29 ` [PATCH v6 2/6] drm/rcar-du: dsc: Add rudimentary Renesas R-Car V4H DSC driver Tomi Valkeinen
2026-09-07  9:42   ` sashiko-bot
2026-09-07  9:29 ` [PATCH v6 3/6] drm/rcar-du: dsi: Support DSC in the pipeline Tomi Valkeinen
2026-09-07  9:44   ` sashiko-bot
2026-09-07  9:29 ` [PATCH v6 4/6] arm64: dts: renesas: r8a779g0: Add DSC Tomi Valkeinen
2026-09-08 12:11   ` Geert Uytterhoeven
2026-09-07  9:29 ` [PATCH v6 5/6] arm64: dts: renesas: sparrow-hawk: Enable DisplayPort by adding DSC Tomi Valkeinen
2026-09-07  9:43   ` sashiko-bot
2026-09-08 12:16   ` Geert Uytterhoeven
2026-09-07  9:29 ` [PATCH v6 6/6] arm64: dts: renesas: white-hawk: Add second mini-DP output support Tomi Valkeinen
2026-09-11  7:07 ` [PATCH v6 0/6] drm/rcar-du: Add support for DSI pipelines with DSC Tomi Valkeinen

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