Skip to contentSkip to conversation

drm/panel: Support Retroid Pocket 6 panel

PATCH Superseded Aaron Kling 4 participants 13 messages Aug 14 – Aug 26

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/panel: Support Retroid Pocket 6 panel

This panel uses a Visionox VTDR6130 DDIC. There is an existing driver for this ddic, however it is currently hardcoded for a panel used on several Qualcomm devkits. This series sets up the driver to support multiple panels, then adds the RP6 panel. It also adds support for rotation as the RP6 panel is mounted sideways.

This depends on the Retroid Pocket dt series [0] for the vendor prefix patch. That series depends on the AYN dt series [1] to apply cleanly.

[0] https://lore.kernel.org/linux-arm-msm/[email protected]/
[1] https://lore.kernel.org/linux-arm-msm/[email protected]/

---
Aaron Kling (4):
dt-bindings: display: visionox,vtdr6130: Add Retroid Pocket 6 panel drm/panel: visionox-vtdr6130: Add panel orientation support drm/panel: visionox-vtdr6130: Modularize panel config drm/panel: visionox-vtdr6130: Add Retroid Pocket 6 panel

 .../bindings/display/panel/visionox,vtdr6130.yaml  |   8 +-
 drivers/gpu/drm/panel/panel-visionox-vtdr6130.c    | 225 ++++++++++++++++++---
 2 files changed, 201 insertions(+), 32 deletions(-)

---
base-commit: 4477a78374a57c3809b172ad30cceabda48c47c6
change-id: 20260318-rp6-panel-861840540616
prerequisite-change-id: 20260217-ayn-qcs8550-16c07b63de26:v9
prerequisite-patch-id: 17ba304f7a8a08cc78f98e198db9c51f4786a22c
prerequisite-patch-id: 21873631f5dcdb9bbbdb5c20c3f5e9816cc405f9
prerequisite-patch-id: bf7b5dea0097cbbdf04929a4246d1fc65c607ea8
prerequisite-patch-id: d7f546eddc96a4f31a1e681abddbc96bd68abb32
prerequisite-patch-id: d40d784ad8efbb1204c024408be2067725a06cf2
prerequisite-patch-id: 25bbd55199a8250a912ef542b31f43dd5ccdbc90
prerequisite-change-id: 20260808-rp-qcs8550-85c84760f6f3:v1
prerequisite-patch-id: 17ba304f7a8a08cc78f98e198db9c51f4786a22c
prerequisite-patch-id: 21873631f5dcdb9bbbdb5c20c3f5e9816cc405f9
prerequisite-patch-id: bf7b5dea0097cbbdf04929a4246d1fc65c607ea8
prerequisite-patch-id: d7f546eddc96a4f31a1e681abddbc96bd68abb32
prerequisite-patch-id: d40d784ad8efbb1204c024408be2067725a06cf2
prerequisite-patch-id: 25bbd55199a8250a912ef542b31f43dd5ccdbc90
prerequisite-patch-id: c79dacb2a8ca1298387bc9bc4a543de97c670a50
prerequisite-patch-id: 9c058fb9b13442f5434b8aaa2f1907eff1b43684
prerequisite-patch-id: c13130099b60aa7c412181e99070718eb2c68ecd
prerequisite-patch-id: d0dad3c4fa9c4b98e6cc53bbd0874df9113ab5f6

Best regards,

Signature · 1 line
Aaron Kling <[email protected]>
#1 lore raw

PATCH 1/4 dt-bindings: display: visionox,vtdr6130: Add Retroid Pocket 6 panel

The vtdr6130 is a display driver integrated circuit, a common chip used for various panels. One such panel is used in the Retroid Pocket 6.

The RP6 panel only lists the regulators vddio and vci, so drop vdd as a required property. The panel is rotated 270 degrees to natural, so also add rotation as an allowed property.

---
 .../devicetree/bindings/display/panel/visionox,vtdr6130.yaml      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml +6 -2
index c99f4146f1bb0..682f30dc9ee43 100644
@@ -14,7 +14,11 @@ allOf:
 
 properties:
   compatible:
-    const: visionox,vtdr6130
+    oneOf:
+      - const: visionox,vtdr6130
+      - items:
+          - const: retroidpocket,rp6-panel
+          - const: visionox,vtdr6130
 
   reg:
     maxItems: 1
@@ -25,13 +29,13 @@ properties:
   vdd-supply: true
   port: true
   reset-gpios: true
+  rotation: true
 
 required:
   - compatible
   - reg
   - vddio-supply
   - vci-supply
-  - vdd-supply
   - reset-gpios
   - port
 
Signature · 1 line
2.54.0
#2 lore raw

Re: [PATCH 1/4] dt-bindings: display: visionox,vtdr6130: Add Retroid Pocket 6 panel

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [Medium] The display driver unconditionally requests the `vdd` supply, causing probe warnings and…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] The display driver unconditionally requests the vdd supply, causing probe warnings and unnecessary reliance on dummy regulators when vdd-supply is omitted in the device tree.
- [Low] Relaxation of schema constraints for the original visionox,vtdr6130 compatible string by dropping vdd-supply globally instead of using a conditional block.
- [Low] The new vendor prefix retroidpocket is undocumented.
--

--- Patch [1]: [PATCH 1/4] dt-bindings: display: visionox,vtdr6130: Add Retroid Pocket 6 panel --- commit f69298db59942a4fe08895f95f545561dd02eb42
Author: Aaron Kling <[email protected]>

dt-bindings: display: visionox,vtdr6130: Add Retroid Pocket 6 panel

The vtdr6130 is a display driver integrated circuit, a common chip used for various panels. One such panel is used in the Retroid Pocket 6. The RP6 panel only lists the regulators vddio and vci, so drop vdd as a required property.

Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml allOf: · line 20

Quoted 13 lines
Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml +4 -1
index c99f4146f1bb0..682f30dc9ee43 100644
@@ -14,7 +14,11 @@ allOf:
 
 properties:
   compatible:
-    const: visionox,vtdr6130
+    oneOf:
+      - const: visionox,vtdr6130
+      - items:
+          - const: retroidpocket,rp6-panel
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[Severity: Low]
Is the retroidpocket vendor prefix documented in the vendor-prefixes schema? If it is not recognized, dt_binding_check will output a warning or error.

Quoted 4 lines
Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml +1 -0
+          - const: visionox,vtdr6130
 
   reg:
     maxItems: 1

[ ... ]

Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml properties: · line 34

Quoted 12 lines
Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml +1 -1
@@ -25,13 +29,13 @@ properties:
   vdd-supply: true
   port: true
   reset-gpios: true
+  rotation: true
 
 required:
   - compatible
   - reg
   - vddio-supply
   - vci-supply
-  - vdd-supply
    ^^^^^^^^^^^^

[Severity: Low]
Does dropping vdd-supply globally allow invalid device trees for the original visionox,vtdr6130 compatible to pass validation if they omit this property?

Could this be handled using an allOf if/then conditional block that keeps vdd-supply required for visionox,vtdr6130 but optional for the new variant?

[Severity: Medium]
Will the driver unconditionally request the vdd supply, even when it is omitted for the retroidpocket,rp6-panel variant?

Looking at visionox_vtdr6130_probe() in panel-visionox-vtdr6130.c:

	ret = devm_regulator_bulk_get_const(&dsi->dev,
					    ARRAY_SIZE(visionox_vtdr6130_supplies),
					    visionox_vtdr6130_supplies,
					    &ctx->supplies);

Since visionox_vtdr6130_supplies includes vdd, might this cause the driver to trigger a kernel warning during boot and unnecessarily rely on the regulator framework dummy fallback when the supply is missing?

Quoted 2 lines
Documentation/devicetree/bindings/display/panel/visionox,vtdr6130.yaml +0 -0
   - reset-gpios
   - port
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Reviewed-by on v1 1/4
#3 lore raw

Re: [PATCH 1/4] dt-bindings: display: visionox,vtdr6130: Add Retroid Pocket 6 panel

In reply to Aaron Kling
Quoted 11 lines · Aaron Kling

The vtdr6130 is a display driver integrated circuit, a common chip used for various panels. One such panel is used in the Retroid Pocket 6.

The RP6 panel only lists the regulators vddio and vci, so drop vdd as a required property. The panel is rotated 270 degrees to natural, so also add rotation as an allowed property.

---
 .../devicetree/bindings/display/panel/visionox,vtdr6130.yaml      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Best regards,
Krzysztof

#4 lore raw

PATCH 2/4 drm/panel: visionox-vtdr6130: Add panel orientation support

In reply to Aaron Kling

Fetch orientation from the device tree if provided.

---
 drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +16 -0
index 6733e0e1d0612..b66d6c7128c75 100644
@@ -11,6 +11,7 @@
 #include <drm/display/drm_dsc.h>
 #include <drm/display/drm_dsc_helper.h>
 #include <drm/drm_mipi_dsi.h>
+#include <drm/drm_of.h>
 #include <drm/drm_modes.h>
 #include <drm/drm_panel.h>
 
@@ -22,6 +23,7 @@ struct visionox_vtdr6130 {
 	struct mipi_dsi_device *dsi;
 	struct gpio_desc *reset_gpio;
 	struct regulator_bulk_data *supplies;
+	enum drm_panel_orientation orientation;
 };
 
 static const struct regulator_bulk_data visionox_vtdr6130_supplies[] = {
@@ -218,10 +220,18 @@ static int visionox_vtdr6130_get_modes(struct drm_panel *panel,
 	return 1;
 }
 
+static enum drm_panel_orientation visionox_vtdr6130_get_orientation(struct drm_panel *panel)
+{
+	struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel);
+
+	return ctx->orientation;
+}
+
 static const struct drm_panel_funcs visionox_vtdr6130_panel_funcs = {
 	.prepare = visionox_vtdr6130_prepare,
 	.unprepare = visionox_vtdr6130_unprepare,
 	.get_modes = visionox_vtdr6130_get_modes,
+	.get_orientation = visionox_vtdr6130_get_orientation,
 };
 
 static int visionox_vtdr6130_bl_update_status(struct backlight_device *bl)
@@ -293,6 +303,12 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
 			  MIPI_DSI_CLOCK_NON_CONTINUOUS;
 	ctx->panel.prepare_prev_first = true;
 
+	ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
+	if (ret < 0) {
+		dev_err(dev, "Failed to get orientation %d\n", ret);
+		return ret;
+	}
+
 	ctx->panel.backlight = visionox_vtdr6130_create_backlight(dsi);
 	if (IS_ERR(ctx->panel.backlight))
 		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),
Signature · 1 line
2.54.0
maintainer Reviewed-by on v1 2/4
#5 lore raw

Re: [PATCH 2/4] drm/panel: visionox-vtdr6130: Add panel orientation support

Quoted 52 lines · On 8/14/26 20:17, Aaron Kling via B4 Relay wrote:

From: Aaron Kling <[email protected]>

Fetch orientation from the device tree if provided.

---
  drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +10 -0
index 6733e0e1d0612..b66d6c7128c75 100644
@@ -11,6 +11,7 @@
  #include <drm/display/drm_dsc.h>
  #include <drm/display/drm_dsc_helper.h>
  #include <drm/drm_mipi_dsi.h>
+#include <drm/drm_of.h>
  #include <drm/drm_modes.h>
  #include <drm/drm_panel.h>
 
@@ -22,6 +23,7 @@ struct visionox_vtdr6130 {
  	struct mipi_dsi_device *dsi;
  	struct gpio_desc *reset_gpio;
  	struct regulator_bulk_data *supplies;
+	enum drm_panel_orientation orientation;
  };
 
  static const struct regulator_bulk_data visionox_vtdr6130_supplies[] = {
@@ -218,10 +220,18 @@ static int visionox_vtdr6130_get_modes(struct drm_panel *panel,
  	return 1;
  }
 
+static enum drm_panel_orientation visionox_vtdr6130_get_orientation(struct drm_panel *panel)
+{
+	struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel);
+
+	return ctx->orientation;
+}
+
  static const struct drm_panel_funcs visionox_vtdr6130_panel_funcs = {
  	.prepare = visionox_vtdr6130_prepare,
  	.unprepare = visionox_vtdr6130_unprepare,
  	.get_modes = visionox_vtdr6130_get_modes,
+	.get_orientation = visionox_vtdr6130_get_orientation,
  };
 
  static int visionox_vtdr6130_bl_update_status(struct backlight_device *bl)
@@ -293,6 +303,12 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
  			  MIPI_DSI_CLOCK_NON_CONTINUOUS;
  	ctx->panel.prepare_prev_first = true;

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi) · line 314

Quoted 10 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +6 -0
 
+	ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
+	if (ret < 0) {
+		dev_err(dev, "Failed to get orientation %d\n", ret);
+		return ret;
+	}
+
  	ctx->panel.backlight = visionox_vtdr6130_create_backlight(dsi);
  	if (IS_ERR(ctx->panel.backlight))
  		return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight),

Thanks,
Neil

#6 lore raw

PATCH 3/4 drm/panel: visionox-vtdr6130: Modularize panel config

In reply to Aaron Kling

The vtdr6130 is a DDIC, a common chip that is used by multiple panels. Prepare the driver for more panels.

---
 drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 95 +++++++++++++++++--------
 1 file changed, 65 insertions(+), 30 deletions(-)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +65 -30
index b66d6c7128c75..805c9846c2a0b 100644
@@ -19,11 +19,28 @@
 
 struct visionox_vtdr6130 {
 	struct drm_panel panel;
-	struct drm_dsc_config dsc;
+	struct drm_connector *connector;
 	struct mipi_dsi_device *dsi;
 	struct gpio_desc *reset_gpio;
 	struct regulator_bulk_data *supplies;
 	enum drm_panel_orientation orientation;
+	struct visionox_vtdr6130_desc *desc;
+};
+
+struct visionox_vtdr6130_desc {
+	unsigned int width_mm;
+	unsigned int height_mm;
+
+	unsigned int bpc;
+	unsigned int lanes;
+	unsigned long mode_flags;
+	enum mipi_dsi_pixel_format format;
+
+	const struct drm_display_mode *modes;
+	unsigned int num_modes;
+	int (*init_sequence)(struct visionox_vtdr6130 *ctx);
+
+	struct drm_dsc_config dsc;
 };
 
 static const struct regulator_bulk_data visionox_vtdr6130_supplies[] = {
@@ -162,7 +179,7 @@ static int visionox_vtdr6130_prepare(struct drm_panel *panel)
 
 	visionox_vtdr6130_reset(ctx);
 
-	ret = visionox_vtdr6130_on(ctx);
+	ret = ctx->desc->init_sequence(ctx);
 	if (ret < 0) {
 		gpiod_set_value_cansleep(ctx->reset_gpio, 1);
 		regulator_bulk_disable(ARRAY_SIZE(visionox_vtdr6130_supplies),
@@ -187,34 +204,58 @@ static int visionox_vtdr6130_unprepare(struct drm_panel *panel)
 	return 0;
 }
 
-static const struct drm_display_mode visionox_vtdr6130_mode = {
-	.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
-	.hdisplay = 1080,
-	.hsync_start = 1080 + 20,
-	.hsync_end = 1080 + 20 + 2,
-	.htotal = 1080 + 20 + 2 + 20,
-	.vdisplay = 2400,
-	.vsync_start = 2400 + 20,
-	.vsync_end = 2400 + 20 + 2,
-	.vtotal = 2400 + 20 + 2 + 18,
+static const struct drm_display_mode visionox_vtdr6130_modes[] = {
+	{
+		.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
+		.hdisplay = 1080,
+		.hsync_start = 1080 + 20,
+		.hsync_end = 1080 + 20 + 2,
+		.htotal = 1080 + 20 + 2 + 20,
+		.vdisplay = 2400,
+		.vsync_start = 2400 + 20,
+		.vsync_end = 2400 + 20 + 2,
+		.vtotal = 2400 + 20 + 2 + 18,
+	},
+};
+
+static struct visionox_vtdr6130_desc visionox_vtdr6130_panel_desc = {
+	.modes = visionox_vtdr6130_modes,
+	.num_modes = ARRAY_SIZE(visionox_vtdr6130_modes),
 	.width_mm = 71,
 	.height_mm = 157,
+	.bpc = 8,
+	.lanes = 4,
+	.format = MIPI_DSI_FMT_RGB888,
+	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |
+		      MIPI_DSI_CLOCK_NON_CONTINUOUS,
+	.init_sequence = visionox_vtdr6130_on,
+	.dsc = {
+		.dsc_version_major = 0x1,
+		.dsc_version_minor = 0x2,
+		.slice_height = 40,
+		.slice_width = 540,
+		.slice_count = 2,
+		.bits_per_component = 8,
+		.bits_per_pixel = 8 << 4,
+		.block_pred_enable = true,
+	},
 };
 
 static int visionox_vtdr6130_get_modes(struct drm_panel *panel,
 				       struct drm_connector *connector)
 {
+	struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel);
 	struct drm_display_mode *mode;
 
-	mode = drm_mode_duplicate(connector->dev, &visionox_vtdr6130_mode);
+	mode = drm_mode_duplicate(connector->dev, ctx->desc->modes);
 	if (!mode)
 		return -ENOMEM;
 
 	drm_mode_set_name(mode);
 
 	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
-	connector->display_info.width_mm = mode->width_mm;
-	connector->display_info.height_mm = mode->height_mm;
+	connector->display_info.width_mm = ctx->desc->width_mm;
+	connector->display_info.height_mm = ctx->desc->height_mm;
 	drm_mode_probed_add(connector, mode);
 
 	return 1;
@@ -284,23 +325,17 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
 		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
 				     "Failed to get reset-gpios\n");
 
+	ctx->desc = (struct visionox_vtdr6130_desc *)of_device_get_match_data(dev);
+	if (!ctx->desc)
+		return -ENODEV;
+
 	ctx->dsi = dsi;
 	mipi_dsi_set_drvdata(dsi, ctx);
 
-	ctx->dsc.dsc_version_major = 0x1;
-	ctx->dsc.dsc_version_minor = 0x2;
-	ctx->dsc.slice_height = 40;
-	ctx->dsc.slice_width = 540;
-	ctx->dsc.slice_count = 2;
-	ctx->dsc.bits_per_component = 8;
-	ctx->dsc.bits_per_pixel = 8 << 4;
-	ctx->dsc.block_pred_enable = true;
-
-	dsi->dsc = &ctx->dsc;
-	dsi->lanes = 4;
-	dsi->format = MIPI_DSI_FMT_RGB888;
-	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |
-			  MIPI_DSI_CLOCK_NON_CONTINUOUS;
+	dsi->dsc = &ctx->desc->dsc;
+	dsi->lanes = ctx->desc->lanes;
+	dsi->format = ctx->desc->format;
+	dsi->mode_flags = ctx->desc->mode_flags;
 	ctx->panel.prepare_prev_first = true;
 
 	ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
@@ -322,7 +357,7 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
 }
 
 static const struct of_device_id visionox_vtdr6130_of_match[] = {
-	{ .compatible = "visionox,vtdr6130" },
+	{ .compatible = "visionox,vtdr6130", .data = &visionox_vtdr6130_panel_desc },
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, visionox_vtdr6130_of_match);
Signature · 1 line
2.54.0
#7 lore raw

Re: [PATCH 3/4] drm/panel: visionox-vtdr6130: Modularize panel config

Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider: - [Medium] Incomplete multi-mode support: `num_modes` is ignored in `visionox_vtdr6130_get_modes`.…

Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
- [Medium] Incomplete multi-mode support: num_modes is ignored in visionox_vtdr6130_get_modes.
- [Medium] Physical dimensions (width_mm and height_mm) are no longer populated on the duplicated drm_display_mode.
- [Medium] Casting the return value of of_device_get_match_data() discards const, leaving the descriptor and its function pointers in writable memory.
- [Low] Newly added fields connector and bpc are completely unused.
- [Low] Missing NULL check for the optional init_sequence function pointer.
- [Low] The panel descriptor provides a custom init_sequence but lacks a corresponding off_sequence.
--

--- Patch [3]: [PATCH 3/4] drm/panel: visionox-vtdr6130: Modularize panel config --- commit 4c3c6a745daceb0c973dc23c581b4254bee31bfc
Author: Aaron Kling <[email protected]>

drm/panel: visionox-vtdr6130: Modularize panel config

This commit modularizes the visionox-vtdr6130 panel driver by introducing a descriptor structure to hold panel-specific configurations. This prepares the driver to support multiple panels sharing the same display driver IC.

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c line 22

Quoted 9 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -1
@@ -19,11 +19,28 @@
 
 struct visionox_vtdr6130 {
 	struct drm_panel panel;
-	struct drm_dsc_config dsc;
+	struct drm_connector *connector;

[Severity: Low]
Is this connector field used anywhere else in the driver? It appears to be declared but never utilized.

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c line 34

Quoted 12 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +8 -0
 	struct mipi_dsi_device *dsi;
 	struct gpio_desc *reset_gpio;
 	struct regulator_bulk_data *supplies;
 	enum drm_panel_orientation orientation;
+	struct visionox_vtdr6130_desc *desc;
+};
+
+struct visionox_vtdr6130_desc {
+	unsigned int width_mm;
+	unsigned int height_mm;
+
+	unsigned int bpc;

[Severity: Low]
Similar to the connector field above, is this bpc field intended for a future patch? It is defined and initialized later but doesn't seem to be used in the current code.

Quoted 10 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +9 -0
+	unsigned int lanes;
+	unsigned long mode_flags;
+	enum mipi_dsi_pixel_format format;
+
+	const struct drm_display_mode *modes;
+	unsigned int num_modes;
+	int (*init_sequence)(struct visionox_vtdr6130 *ctx);
+
+	struct drm_dsc_config dsc;
 };

[ ... ]

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_prepare(struct drm_panel *panel) · line 182

Quoted 6 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -1
@@ -162,7 +179,7 @@ static int visionox_vtdr6130_prepare(struct drm_panel *panel)
 
 	visionox_vtdr6130_reset(ctx);
 
-	ret = visionox_vtdr6130_on(ctx);
+	ret = ctx->desc->init_sequence(ctx);

[Severity: Low]
Could this cause a null pointer dereference if a future panel omits the init_sequence callback?

Should there be a check before calling it, similar to:

	if (ctx->desc->init_sequence)
		ret = ctx->desc->init_sequence(ctx);

[Severity: Low]
This isn't a bug, but should the power-off sequence be abstracted as well?

Currently, visionox_vtdr6130_prepare() uses the abstracted init_sequence(), but visionox_vtdr6130_unprepare() still relies on a hardcoded call to visionox_vtdr6130_off().

[ ... ]

Quoted 2 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +0 -2
-static const struct drm_display_mode visionox_vtdr6130_mode = {
-	.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,

[ ... ]

Quoted 6 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +3 -3
-	.vtotal = 2400 + 20 + 2 + 18,
-	.width_mm = 71,
-	.height_mm = 157,
+static const struct drm_display_mode visionox_vtdr6130_modes[] = {
+	{
+		.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,

[ ... ]

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 219

Quoted 3 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +3 -0
+		.vtotal = 2400 + 20 + 2 + 18,
+	},
+};

[Severity: Medium]
Because width_mm and height_mm were moved out of the drm_display_mode struct definition and into the descriptor, will the duplicated mode end up with 0 for its physical dimensions?

Userspace compositors might rely on these values inside the mode object to calculate DPI.

Quoted 1 line

+static struct visionox_vtdr6130_desc visionox_vtdr6130_panel_desc = {

[Severity: Medium]
Should this descriptor be declared as const?

Since it contains a function pointer (init_sequence), keeping it in writable memory provides a potential target for control-flow hijacking.

Quoted 2 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +2 -0
+	.modes = visionox_vtdr6130_modes,
+	.num_modes = ARRAY_SIZE(visionox_vtdr6130_modes),

[ ... ]

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 250

Quoted 8 lines

static int visionox_vtdr6130_get_modes(struct drm_panel *panel,

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +2 -1
 				       struct drm_connector *connector)
 {
+	struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel);
 	struct drm_display_mode *mode;
 
-	mode = drm_mode_duplicate(connector->dev, &visionox_vtdr6130_mode);
+	mode = drm_mode_duplicate(connector->dev, ctx->desc->modes);

[Severity: Medium]
Does this logic fully support multiple modes?

It looks like it only duplicates the first mode in the ctx->desc->modes array, completely ignoring the ctx->desc->num_modes field. If a future panel adds multiple modes, only the first one would be exposed to userspace here.

[ ... ]

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi) · line 328

Quoted 5 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -0
@@ -284,23 +325,17 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
 		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
 				     "Failed to get reset-gpios\n");
 
+	ctx->desc = (struct visionox_vtdr6130_desc *)of_device_get_match_data(dev);

[Severity: Medium]
Does casting the return value of of_device_get_match_data() discard the const qualifier?

This API returns a const void *, which matches the suggestion to make the descriptor struct const above.

Quoted 2 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +2 -0
+	if (!ctx->desc)
+		return -ENODEV;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
maintainer
#8 lore raw

Re: [PATCH 3/4] drm/panel: visionox-vtdr6130: Modularize panel config

In reply to Aaron Kling
Quoted 15 lines · On 8/14/26 20:17, Aaron Kling via B4 Relay wrote:

From: Aaron Kling <[email protected]>

The vtdr6130 is a DDIC, a common chip that is used by multiple panels. Prepare the driver for more panels.

---
  drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 95 +++++++++++++++++--------
  1 file changed, 65 insertions(+), 30 deletions(-)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +0 -0
index b66d6c7128c75..805c9846c2a0b 100644

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c line 22

Quoted 5 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -1
@@ -19,11 +19,28 @@
 
  struct visionox_vtdr6130 {
  	struct drm_panel panel;
-	struct drm_dsc_config dsc;
+	struct drm_connector *connector;

Why ? connector is unused in this patch.

Quoted 56 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +27 -11
  	struct mipi_dsi_device *dsi;
  	struct gpio_desc *reset_gpio;
  	struct regulator_bulk_data *supplies;
  	enum drm_panel_orientation orientation;
+	struct visionox_vtdr6130_desc *desc;
+};
+
+struct visionox_vtdr6130_desc {
+	unsigned int width_mm;
+	unsigned int height_mm;
+
+	unsigned int bpc;
+	unsigned int lanes;
+	unsigned long mode_flags;
+	enum mipi_dsi_pixel_format format;
+
+	const struct drm_display_mode *modes;
+	unsigned int num_modes;
+	int (*init_sequence)(struct visionox_vtdr6130 *ctx);
+
+	struct drm_dsc_config dsc;
  };
 
  static const struct regulator_bulk_data visionox_vtdr6130_supplies[] = {
@@ -162,7 +179,7 @@ static int visionox_vtdr6130_prepare(struct drm_panel *panel)
 
  	visionox_vtdr6130_reset(ctx);
 
-	ret = visionox_vtdr6130_on(ctx);
+	ret = ctx->desc->init_sequence(ctx);
  	if (ret < 0) {
  		gpiod_set_value_cansleep(ctx->reset_gpio, 1);
  		regulator_bulk_disable(ARRAY_SIZE(visionox_vtdr6130_supplies),
@@ -187,34 +204,58 @@ static int visionox_vtdr6130_unprepare(struct drm_panel *panel)
  	return 0;
  }
 
-static const struct drm_display_mode visionox_vtdr6130_mode = {
-	.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
-	.hdisplay = 1080,
-	.hsync_start = 1080 + 20,
-	.hsync_end = 1080 + 20 + 2,
-	.htotal = 1080 + 20 + 2 + 20,
-	.vdisplay = 2400,
-	.vsync_start = 2400 + 20,
-	.vsync_end = 2400 + 20 + 2,
-	.vtotal = 2400 + 20 + 2 + 18,
+static const struct drm_display_mode visionox_vtdr6130_modes[] = {
+	{
+		.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
+		.hdisplay = 1080,
+		.hsync_start = 1080 + 20,
+		.hsync_end = 1080 + 20 + 2,
+		.htotal = 1080 + 20 + 2 + 20,
+		.vdisplay = 2400,
+		.vsync_start = 2400 + 20,

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 225

Quoted 10 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +8 -0
+		.vsync_end = 2400 + 20 + 2,
+		.vtotal = 2400 + 20 + 2 + 18,
+	},
+};
+
+static struct visionox_vtdr6130_desc visionox_vtdr6130_panel_desc = {
+	.modes = visionox_vtdr6130_modes,
+	.num_modes = ARRAY_SIZE(visionox_vtdr6130_modes),
  	.width_mm = 71,
  	.height_mm = 157,

Why did you move the width/height out of the mode ?

Leave it in the mode, since you don't even use the same mode for the Retroid 6 panel

Quoted 26 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +18 -1
+	.bpc = 8,
+	.lanes = 4,
+	.format = MIPI_DSI_FMT_RGB888,
+	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |
+		      MIPI_DSI_CLOCK_NON_CONTINUOUS,
+	.init_sequence = visionox_vtdr6130_on,
+	.dsc = {
+		.dsc_version_major = 0x1,
+		.dsc_version_minor = 0x2,
+		.slice_height = 40,
+		.slice_width = 540,
+		.slice_count = 2,
+		.bits_per_component = 8,
+		.bits_per_pixel = 8 << 4,
+		.block_pred_enable = true,
+	},
  };
 
  static int visionox_vtdr6130_get_modes(struct drm_panel *panel,
  				       struct drm_connector *connector)
  {
+	struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel);
  	struct drm_display_mode *mode;
 
-	mode = drm_mode_duplicate(connector->dev, &visionox_vtdr6130_mode);
+	mode = drm_mode_duplicate(connector->dev, ctx->desc->modes);

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 258

Quoted 10 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +2 -2
  	if (!mode)
  		return -ENOMEM;
 
  	drm_mode_set_name(mode);
 
  	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
-	connector->display_info.width_mm = mode->width_mm;
-	connector->display_info.height_mm = mode->height_mm;
+	connector->display_info.width_mm = ctx->desc->width_mm;
+	connector->display_info.height_mm = ctx->desc->height_mm;

Drop this change, take them from the mode.

Quoted 37 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +8 -14
  	drm_mode_probed_add(connector, mode);
 
  	return 1;
@@ -284,23 +325,17 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
  		return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
  				     "Failed to get reset-gpios\n");
 
+	ctx->desc = (struct visionox_vtdr6130_desc *)of_device_get_match_data(dev);
+	if (!ctx->desc)
+		return -ENODEV;
+
  	ctx->dsi = dsi;
  	mipi_dsi_set_drvdata(dsi, ctx);
 
-	ctx->dsc.dsc_version_major = 0x1;
-	ctx->dsc.dsc_version_minor = 0x2;
-	ctx->dsc.slice_height = 40;
-	ctx->dsc.slice_width = 540;
-	ctx->dsc.slice_count = 2;
-	ctx->dsc.bits_per_component = 8;
-	ctx->dsc.bits_per_pixel = 8 << 4;
-	ctx->dsc.block_pred_enable = true;
-
-	dsi->dsc = &ctx->dsc;
-	dsi->lanes = 4;
-	dsi->format = MIPI_DSI_FMT_RGB888;
-	dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |
-			  MIPI_DSI_CLOCK_NON_CONTINUOUS;
+	dsi->dsc = &ctx->desc->dsc;
+	dsi->lanes = ctx->desc->lanes;
+	dsi->format = ctx->desc->format;
+	dsi->mode_flags = ctx->desc->mode_flags;
  	ctx->panel.prepare_prev_first = true;
 
  	ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi) · line 363

Quoted 8 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -1
@@ -322,7 +357,7 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
  }
 
  static const struct of_device_id visionox_vtdr6130_of_match[] = {
-	{ .compatible = "visionox,vtdr6130" },
+	{ .compatible = "visionox,vtdr6130", .data = &visionox_vtdr6130_panel_desc },
  	{ /* sentinel */ }
  };
  MODULE_DEVICE_TABLE(of, visionox_vtdr6130_of_match);

Thanks,
Neil

#9 lore raw

Re: [PATCH 3/4] drm/panel: visionox-vtdr6130: Modularize panel config

Quoted 18 lines · Neil Armstrong
Quoted 16 lines · On 8/14/26 20:17, Aaron Kling via B4 Relay wrote:

From: Aaron Kling <[email protected]>

The vtdr6130 is a DDIC, a common chip that is used by multiple panels. Prepare the driver for more panels.

---
  drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 95 +++++++++++++++++--------
  1 file changed, 65 insertions(+), 30 deletions(-)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +0 -0
index b66d6c7128c75..805c9846c2a0b 100644
@@ -19,11 +19,28 @@
 
Quoted 6 lines

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c line 22

Quoted 4 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -1
  struct visionox_vtdr6130 {
      struct drm_panel panel;
-     struct drm_dsc_config dsc;
+     struct drm_connector *connector;

Why ? connector is unused in this patch.

I forgot to strip this when removing multiple mode support. Will fix.

Quoted 69 lines
Quoted 56 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +27 -11
      struct mipi_dsi_device *dsi;
      struct gpio_desc *reset_gpio;
      struct regulator_bulk_data *supplies;
      enum drm_panel_orientation orientation;
+     struct visionox_vtdr6130_desc *desc;
+};
+
+struct visionox_vtdr6130_desc {
+     unsigned int width_mm;
+     unsigned int height_mm;
+
+     unsigned int bpc;
+     unsigned int lanes;
+     unsigned long mode_flags;
+     enum mipi_dsi_pixel_format format;
+
+     const struct drm_display_mode *modes;
+     unsigned int num_modes;
+     int (*init_sequence)(struct visionox_vtdr6130 *ctx);
+
+     struct drm_dsc_config dsc;
  };
 
  static const struct regulator_bulk_data visionox_vtdr6130_supplies[] = {
@@ -162,7 +179,7 @@ static int visionox_vtdr6130_prepare(struct drm_panel *panel)
 
      visionox_vtdr6130_reset(ctx);
 
-     ret = visionox_vtdr6130_on(ctx);
+     ret = ctx->desc->init_sequence(ctx);
      if (ret < 0) {
              gpiod_set_value_cansleep(ctx->reset_gpio, 1);
              regulator_bulk_disable(ARRAY_SIZE(visionox_vtdr6130_supplies),
@@ -187,34 +204,58 @@ static int visionox_vtdr6130_unprepare(struct drm_panel *panel)
      return 0;
  }
 
-static const struct drm_display_mode visionox_vtdr6130_mode = {
-     .clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
-     .hdisplay = 1080,
-     .hsync_start = 1080 + 20,
-     .hsync_end = 1080 + 20 + 2,
-     .htotal = 1080 + 20 + 2 + 20,
-     .vdisplay = 2400,
-     .vsync_start = 2400 + 20,
-     .vsync_end = 2400 + 20 + 2,
-     .vtotal = 2400 + 20 + 2 + 18,
+static const struct drm_display_mode visionox_vtdr6130_modes[] = {
+     {
+             .clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
+             .hdisplay = 1080,
+             .hsync_start = 1080 + 20,
+             .hsync_end = 1080 + 20 + 2,
+             .htotal = 1080 + 20 + 2 + 20,
+             .vdisplay = 2400,
+             .vsync_start = 2400 + 20,

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 225

Quoted 10 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +8 -0
+             .vsync_end = 2400 + 20 + 2,
+             .vtotal = 2400 + 20 + 2 + 18,
+     },
+};
+
+static struct visionox_vtdr6130_desc visionox_vtdr6130_panel_desc = {
+     .modes = visionox_vtdr6130_modes,
+     .num_modes = ARRAY_SIZE(visionox_vtdr6130_modes),
      .width_mm = 71,
      .height_mm = 157,

Why did you move the width/height out of the mode ?

Quoted 1 line

Leave it in the mode, since you don't even use the same mode for the Retroid 6 panel

It was moved to support multiple modes, because duplicating the dimensions across modes is wasteful. This can be deferred to when multiple modes are supported.

But on that note, has anything happened with implementing the atomic changes which were going to be a better way to handle multiple modes? If not, is the handling you asked to be removed from the icna35xx change [0] still a hard block? Because that does work now to support multiple modes and I'm currently carrying downstream changes across several panel drivers to support those. And I'd really like to eliminate as many downstream changes as I can.

Quoted 31 lines
Quoted 31 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +18 -1
+     .bpc = 8,
+     .lanes = 4,
+     .format = MIPI_DSI_FMT_RGB888,
+     .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |
+                   MIPI_DSI_CLOCK_NON_CONTINUOUS,
+     .init_sequence = visionox_vtdr6130_on,
+     .dsc = {
+             .dsc_version_major = 0x1,
+             .dsc_version_minor = 0x2,
+             .slice_height = 40,
+             .slice_width = 540,
+             .slice_count = 2,
+             .bits_per_component = 8,
+             .bits_per_pixel = 8 << 4,
+             .block_pred_enable = true,
+     },
  };
 
  static int visionox_vtdr6130_get_modes(struct drm_panel *panel,
                                     struct drm_connector *connector)
  {
+     struct visionox_vtdr6130 *ctx = to_visionox_vtdr6130(panel);
      struct drm_display_mode *mode;
 
-     mode = drm_mode_duplicate(connector->dev, &visionox_vtdr6130_mode);
+     mode = drm_mode_duplicate(connector->dev, ctx->desc->modes);
      if (!mode)
              return -ENOMEM;
 
      drm_mode_set_name(mode);
 
Quoted 7 lines

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 258

Quoted 5 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +2 -2
      mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
-     connector->display_info.width_mm = mode->width_mm;
-     connector->display_info.height_mm = mode->height_mm;
+     connector->display_info.width_mm = ctx->desc->width_mm;
+     connector->display_info.height_mm = ctx->desc->height_mm;

Drop this change, take them from the mode.

Ack.

Quoted 38 lines
Quoted 38 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +8 -14
      drm_mode_probed_add(connector, mode);
 
      return 1;
@@ -284,23 +325,17 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
              return dev_err_probe(dev, PTR_ERR(ctx->reset_gpio),
                                   "Failed to get reset-gpios\n");
 
+     ctx->desc = (struct visionox_vtdr6130_desc *)of_device_get_match_data(dev);
+     if (!ctx->desc)
+             return -ENODEV;
+
      ctx->dsi = dsi;
      mipi_dsi_set_drvdata(dsi, ctx);
 
-     ctx->dsc.dsc_version_major = 0x1;
-     ctx->dsc.dsc_version_minor = 0x2;
-     ctx->dsc.slice_height = 40;
-     ctx->dsc.slice_width = 540;
-     ctx->dsc.slice_count = 2;
-     ctx->dsc.bits_per_component = 8;
-     ctx->dsc.bits_per_pixel = 8 << 4;
-     ctx->dsc.block_pred_enable = true;
-
-     dsi->dsc = &ctx->dsc;
-     dsi->lanes = 4;
-     dsi->format = MIPI_DSI_FMT_RGB888;
-     dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_NO_EOT_PACKET |
-                       MIPI_DSI_CLOCK_NON_CONTINUOUS;
+     dsi->dsc = &ctx->desc->dsc;
+     dsi->lanes = ctx->desc->lanes;
+     dsi->format = ctx->desc->format;
+     dsi->mode_flags = ctx->desc->mode_flags;
      ctx->panel.prepare_prev_first = true;
 
      ret = drm_of_get_panel_orientation(dev->of_node, &ctx->orientation);
@@ -322,7 +357,7 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
  }
 
Quoted 11 lines

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi) · line 363

Quoted 7 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +1 -1
  static const struct of_device_id visionox_vtdr6130_of_match[] = {
-     { .compatible = "visionox,vtdr6130" },
+     { .compatible = "visionox,vtdr6130", .data = &visionox_vtdr6130_panel_desc },
      { /* sentinel */ }
  };
  MODULE_DEVICE_TABLE(of, visionox_vtdr6130_of_match);

Thanks,
Neil

Aaron

[0] https://lore.kernel.org/dri-devel/[email protected]/

#10 lore raw

PATCH 4/4 drm/panel: visionox-vtdr6130: Add Retroid Pocket 6 panel

In reply to Aaron Kling

Add support for the 1080x1920 panel used in the Retroid Pocket 6.

---
 drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 114 ++++++++++++++++++++++++
 1 file changed, 114 insertions(+)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +114 -0
index 805c9846c2a0b..5c826f95ec478 100644
@@ -64,6 +64,82 @@ static void visionox_vtdr6130_reset(struct visionox_vtdr6130 *ctx)
 	usleep_range(10000, 11000);
 }
 
+static int retroidpocket_rp6_on(struct visionox_vtdr6130 *ctx)
+{
+	struct mipi_dsi_device *dsi = ctx->dsi;
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+	struct drm_dsc_picture_parameter_set pps;
+
+	dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x03, 0x01);
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx,
+				     MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
+	mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, 0xff07);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x02);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x02);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x59, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6c, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6d, 0x00);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x70, 0x11, 0x00, 0x00, 0x89,
+				     0x30, 0x80, 0x07, 0x80, 0x04, 0x38, 0x00,
+				     0x14, 0x02, 0x1c, 0x02, 0x1c, 0x02, 0x00,
+				     0x02, 0x25, 0x00, 0x20, 0x01, 0xd5, 0x00,
+				     0x07, 0x00, 0x0d, 0x05, 0x7a, 0x05, 0x16,
+				     0x18, 0x00, 0x10, 0xf0, 0x03, 0x0c, 0x20,
+				     0x00, 0x06, 0x0b, 0x0b, 0x33, 0x0e, 0x1c,
+				     0x2a, 0x38, 0x46, 0x54, 0x62, 0x69, 0x70,
+				     0x77, 0x79, 0x7b, 0x7d, 0x7e, 0x01, 0x02,
+				     0x01, 0x00, 0x09, 0x40, 0x09, 0xbe, 0x19,
+				     0xfc, 0x19, 0xfa, 0x19, 0xf8, 0x1a, 0x38,
+				     0x1a, 0x78, 0x1a, 0xb6, 0x2a, 0xb6, 0x2a,
+				     0xf4, 0x2a, 0xf4, 0x4b, 0x34, 0x63, 0x74,
+				     0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xaa, 0x10);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb1, 0x02, 0x15, 0x00, 0x14,
+				     0x00, 0x20, 0x00, 0x02, 0x16, 0x00, 0x14,
+				     0x07, 0xb4, 0x00, 0x02, 0x16, 0x00, 0x14,
+				     0x00, 0x10, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xaa, 0x14);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb2, 0x03, 0x33);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb4, 0x0a, 0x72, 0x00, 0x00,
+				     0x0a, 0x72, 0x00, 0x00, 0x0a, 0x72, 0x00,
+				     0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb5, 0x00, 0x1e, 0x1e, 0x1e,
+				     0x1e, 0x1e, 0x1e, 0x06, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x00, 0x00, 0x08, 0x1e,
+				     0x1e, 0x1e);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbc, 0x10, 0x00, 0x00, 0x08,
+				     0x11, 0x1e, 0x7c, 0x1e, 0x7c, 0x1e, 0x7c);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbe, 0x10, 0x10, 0x00, 0x0c,
+				     0x22, 0x1e, 0x62, 0x1e, 0x62, 0x1e, 0x62);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x80);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x65, 0x13);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfd, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x81);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf9, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x83);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x65, 0x04);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf8, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xaa, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x00);
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 150);
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 50);
+
+	drm_dsc_pps_payload_pack(&pps, dsi->dsc);
+	mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+
+	return dsi_ctx.accum_err;
+}
+
 static int visionox_vtdr6130_on(struct visionox_vtdr6130 *ctx)
 {
 	struct mipi_dsi_device *dsi = ctx->dsi;
@@ -204,6 +280,43 @@ static int visionox_vtdr6130_unprepare(struct drm_panel *panel)
 	return 0;
 }
 
+static const struct drm_display_mode retroidpocket_rp6_modes[] = {
+	{
+		.clock = (1080 + 22 + 2 + 16) * (1920 + 16 + 2 + 20) * 120 / 1000,
+		.hdisplay = 1080,
+		.hsync_start = 1080 + 22,
+		.hsync_end = 1080 + 22 + 2,
+		.htotal = 1080 + 22 + 2 + 16,
+		.vdisplay = 1920,
+		.vsync_start = 1920 + 16,
+		.vsync_end = 1920 + 16 + 2,
+		.vtotal = 1920 + 16 + 2 + 20,
+	},
+};
+
+static struct visionox_vtdr6130_desc retroidpocket_rp6_panel_desc = {
+	.modes = retroidpocket_rp6_modes,
+	.num_modes = ARRAY_SIZE(retroidpocket_rp6_modes),
+	.width_mm = 69,
+	.height_mm = 122,
+	.bpc = 8,
+	.lanes = 4,
+	.format = MIPI_DSI_FMT_RGB888,
+	.mode_flags = MIPI_DSI_MODE_NO_EOT_PACKET |
+		      MIPI_DSI_CLOCK_NON_CONTINUOUS,
+	.init_sequence = retroidpocket_rp6_on,
+	.dsc = {
+		.dsc_version_major = 0x1,
+		.dsc_version_minor = 0x1,
+		.slice_height = 12,
+		.slice_width = 540,
+		.slice_count = 2,
+		.bits_per_component = 8,
+		.bits_per_pixel = 8 << 4,
+		.block_pred_enable = true,
+	},
+};
+
 static const struct drm_display_mode visionox_vtdr6130_modes[] = {
 	{
 		.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
@@ -357,6 +470,7 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
 }
 
 static const struct of_device_id visionox_vtdr6130_of_match[] = {
+	{ .compatible = "retroidpocket,rp6-panel", .data = &retroidpocket_rp6_panel_desc },
 	{ .compatible = "visionox,vtdr6130", .data = &visionox_vtdr6130_panel_desc },
 	{ /* sentinel */ }
 };
Signature · 1 line
2.54.0
#11 lore raw

Re: [PATCH 4/4] drm/panel: visionox-vtdr6130: Add Retroid Pocket 6 panel

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The panel initialization sequence uses a byte-swapped magic number (`0xff07`) to set display…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The panel initialization sequence uses a byte-swapped magic number (0xff07) to set display brightness, exploiting the little-endian behavior of mipi_dsi_dcs_set_display_brightness_multi to send a big-endian sequence. --

--- Patch [4]: [PATCH 4/4] drm/panel: visionox-vtdr6130: Add Retroid Pocket 6 panel --- commit 2ba31f55071d4cfd213a7bfcbe0e2720a74312ac
Author: Aaron Kling <[email protected]>

drm/panel: visionox-vtdr6130: Add Retroid Pocket 6 panel

This commit adds support for the 1080x1920 panel used in the Retroid Pocket 6 handheld console.

Quoted 4 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +0 -0
index 805c9846c2a0b..5c826f95ec478 100644

[ ... ]

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static void visionox_vtdr6130_reset(struct visionox_vtdr6130 *ctx) · line 79

Quoted 13 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +13 -0
+static int retroidpocket_rp6_on(struct visionox_vtdr6130 *ctx)
+{
+	struct mipi_dsi_device *dsi = ctx->dsi;
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+	struct drm_dsc_picture_parameter_set pps;
+
+	dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x03, 0x01);
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx,
+				     MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
+	mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, 0xff07);

[Severity: Medium]
Is this intentionally passing a byte-swapped magic number (0xff07) to compensate for mipi_dsi_dcs_set_display_brightness_multi() sending the brightness value LSB-first?

The DCS specification requires the brightness parameter to be MSB-first. By passing 0xff07, it appears this code intentionally sends 0x07 followed by 0xff so the panel receives 0x07ff (2047) MSB-first.

If the core helper is ever corrected to comply with the DCS specification, this sequence will send 0xff followed by 0x07, which the panel will interpret as 0xff07 (65287), drastically exceeding the intended brightness.

Should this instead send the raw bytes explicitly using mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_DISPLAY_BRIGHTNESS, 0x07, 0xff) to avoid depending on the helper's current endianness behavior?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
maintainer Reviewed-by on v1 4/4
#12 lore raw

Re: [PATCH 4/4] drm/panel: visionox-vtdr6130: Add Retroid Pocket 6 panel

In reply to Aaron Kling
Quoted 109 lines · On 8/14/26 20:17, Aaron Kling via B4 Relay wrote:

From: Aaron Kling <[email protected]>

Add support for the 1080x1920 panel used in the Retroid Pocket 6.

---
  drivers/gpu/drm/panel/panel-visionox-vtdr6130.c | 114 ++++++++++++++++++++++++
  1 file changed, 114 insertions(+)
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +85 -0
index 805c9846c2a0b..5c826f95ec478 100644
@@ -64,6 +64,82 @@ static void visionox_vtdr6130_reset(struct visionox_vtdr6130 *ctx)
  	usleep_range(10000, 11000);
  }
 
+static int retroidpocket_rp6_on(struct visionox_vtdr6130 *ctx)
+{
+	struct mipi_dsi_device *dsi = ctx->dsi;
+	struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
+	struct drm_dsc_picture_parameter_set pps;
+
+	dsi->mode_flags |= MIPI_DSI_MODE_LPM;
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x03, 0x01);
+	mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx,
+				     MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
+	mipi_dsi_dcs_set_display_brightness_multi(&dsi_ctx, 0xff07);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x02);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_SET_ADDRESS_MODE, 0x02);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x59, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6c, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6d, 0x00);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x70, 0x11, 0x00, 0x00, 0x89,
+				     0x30, 0x80, 0x07, 0x80, 0x04, 0x38, 0x00,
+				     0x14, 0x02, 0x1c, 0x02, 0x1c, 0x02, 0x00,
+				     0x02, 0x25, 0x00, 0x20, 0x01, 0xd5, 0x00,
+				     0x07, 0x00, 0x0d, 0x05, 0x7a, 0x05, 0x16,
+				     0x18, 0x00, 0x10, 0xf0, 0x03, 0x0c, 0x20,
+				     0x00, 0x06, 0x0b, 0x0b, 0x33, 0x0e, 0x1c,
+				     0x2a, 0x38, 0x46, 0x54, 0x62, 0x69, 0x70,
+				     0x77, 0x79, 0x7b, 0x7d, 0x7e, 0x01, 0x02,
+				     0x01, 0x00, 0x09, 0x40, 0x09, 0xbe, 0x19,
+				     0xfc, 0x19, 0xfa, 0x19, 0xf8, 0x1a, 0x38,
+				     0x1a, 0x78, 0x1a, 0xb6, 0x2a, 0xb6, 0x2a,
+				     0xf4, 0x2a, 0xf4, 0x4b, 0x34, 0x63, 0x74,
+				     0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
+
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xaa, 0x10);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb1, 0x02, 0x15, 0x00, 0x14,
+				     0x00, 0x20, 0x00, 0x02, 0x16, 0x00, 0x14,
+				     0x07, 0xb4, 0x00, 0x02, 0x16, 0x00, 0x14,
+				     0x00, 0x10, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xaa, 0x14);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb2, 0x03, 0x33);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb4, 0x0a, 0x72, 0x00, 0x00,
+				     0x0a, 0x72, 0x00, 0x00, 0x0a, 0x72, 0x00,
+				     0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb5, 0x00, 0x1e, 0x1e, 0x1e,
+				     0x1e, 0x1e, 0x1e, 0x06, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb9, 0x00, 0x00, 0x08, 0x1e,
+				     0x1e, 0x1e);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbc, 0x10, 0x00, 0x00, 0x08,
+				     0x11, 0x1e, 0x7c, 0x1e, 0x7c, 0x1e, 0x7c);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xbe, 0x10, 0x10, 0x00, 0x0c,
+				     0x22, 0x1e, 0x62, 0x1e, 0x62, 0x1e, 0x62);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x80);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x65, 0x13);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfd, 0x01);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x81);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf9, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x83);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x65, 0x04);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf8, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xaa, 0x00);
+	mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0x5a, 0x00);
+
+	mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 150);
+
+	mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
+	mipi_dsi_msleep(&dsi_ctx, 50);
+
+	drm_dsc_pps_payload_pack(&pps, dsi->dsc);
+	mipi_dsi_picture_parameter_set_multi(&dsi_ctx, &pps);
+	mipi_dsi_compression_mode_multi(&dsi_ctx, true);
+
+	return dsi_ctx.accum_err;
+}
+
  static int visionox_vtdr6130_on(struct visionox_vtdr6130 *ctx)
  {
  	struct mipi_dsi_device *dsi = ctx->dsi;
@@ -204,6 +280,43 @@ static int visionox_vtdr6130_unprepare(struct drm_panel *panel)
  	return 0;
  }
 
+static const struct drm_display_mode retroidpocket_rp6_modes[] = {
+	{
+		.clock = (1080 + 22 + 2 + 16) * (1920 + 16 + 2 + 20) * 120 / 1000,
+		.hdisplay = 1080,
+		.hsync_start = 1080 + 22,
+		.hsync_end = 1080 + 22 + 2,
+		.htotal = 1080 + 22 + 2 + 16,
+		.vdisplay = 1920,
+		.vsync_start = 1920 + 16,

drivers/gpu/drm/panel/panel-visionox-vtdr6130.c static int visionox_vtdr6130_unprepare(struct drm_panel *panel) · line 301

Quoted 10 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +10 -0
+		.vsync_end = 1920 + 16 + 2,
+		.vtotal = 1920 + 16 + 2 + 20,
+	},
+};
+
+static struct visionox_vtdr6130_desc retroidpocket_rp6_panel_desc = {
+	.modes = retroidpocket_rp6_modes,
+	.num_modes = ARRAY_SIZE(retroidpocket_rp6_modes),
+	.width_mm = 69,
+	.height_mm = 122,

With the dimension in the mode:

Thanks,
Neil

Quoted 30 lines
drivers/gpu/drm/panel/panel-visionox-vtdr6130.c +19 -0
+	.bpc = 8,
+	.lanes = 4,
+	.format = MIPI_DSI_FMT_RGB888,
+	.mode_flags = MIPI_DSI_MODE_NO_EOT_PACKET |
+		      MIPI_DSI_CLOCK_NON_CONTINUOUS,
+	.init_sequence = retroidpocket_rp6_on,
+	.dsc = {
+		.dsc_version_major = 0x1,
+		.dsc_version_minor = 0x1,
+		.slice_height = 12,
+		.slice_width = 540,
+		.slice_count = 2,
+		.bits_per_component = 8,
+		.bits_per_pixel = 8 << 4,
+		.block_pred_enable = true,
+	},
+};
+
  static const struct drm_display_mode visionox_vtdr6130_modes[] = {
  	{
  		.clock = (1080 + 20 + 2 + 20) * (2400 + 20 + 2 + 18) * 144 / 1000,
@@ -357,6 +470,7 @@ static int visionox_vtdr6130_probe(struct mipi_dsi_device *dsi)
  }
 
  static const struct of_device_id visionox_vtdr6130_of_match[] = {
+	{ .compatible = "retroidpocket,rp6-panel", .data = &retroidpocket_rp6_panel_desc },
  	{ .compatible = "visionox,vtdr6130", .data = &visionox_vtdr6130_panel_desc },
  	{ /* sentinel */ }
  };