Skip to content

tdo_panel: bcm27xx-gpu: Add dsi panel driver;#7318

Merged
6by9 merged 3 commits intoraspberrypi:rpi-6.18.yfrom
flash-fea:rpi-6.18.y
Apr 22, 2026
Merged

tdo_panel: bcm27xx-gpu: Add dsi panel driver;#7318
6by9 merged 3 commits intoraspberrypi:rpi-6.18.yfrom
flash-fea:rpi-6.18.y

Conversation

@flash-fea
Copy link
Copy Markdown

- Add vc4-kms-dsi-panel-overlay.dts for tdo panel compatiable.
- Simplify add panel-tdo-dsi-v1.c as module to driver tdo panel.
- __overrides__ parameter can be add in config.txt for customers.

@flash-fea flash-fea force-pushed the rpi-6.18.y branch 2 times, most recently from 7a2e2f8 to 840f6f9 Compare April 16, 2026 06:19
@flash-fea
Copy link
Copy Markdown
Author

whether the addition was successful?

@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 16, 2026

The partitioning of the code looks good, and checkpatch is happy.

This isn't my field of expertise so there is limited input I can give regarding the driver itself - perhaps @6by9 has some comments - but there are a few things I have spotted:

  1. The authorship of the code (and therefore the permission to publish it) is a bit vague. The comment at the top of the driver file says Copyright (C) 2024 Waveshare International Limited, but the footer says MODULE_AUTHOR("LK <support@tdo.com>"); and MODULE_DESCRIPTION("TDO DSI panel driver");, none of which seems to match your GitHub user account.
  2. I see a number of dev_err() used for what look like debug output. I do the same myself, but it shouldn't still be around in a production driver. If the information is useful to users, demote it to INFO level or lower, otherwise go for dev_dbg or deletion.

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 16, 2026

Sorry I had all my review comments pending on the 6.12 version. Now posted.
I suspect that they all apply here too.

Largely the same as pelwell has commented with regard pr_err debugging and authorship, but also a couple of other points.
I suspect that you've copied the panel-waveshare-dsi-v2 driver and amended for your panels, but it'd nice to have that confirmed. That may not have been the best base as it isn't a driver that has been reviewed by upstream, but that isn't critical for a Pi specific product.

@flash-fea
Copy link
Copy Markdown
Author

yes,some informations need to change,about two dev_err() only use in debug to find by text easyier,but forget to recover.

@@ -0,0 +1,69 @@
/*
* Device Tree overlay for Waveshare DSI Touchscreens
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs updating

compatible = "tdo,4.0-dsi-tl040wvs17";
status = "okay";
reg = <0>;
reset-gpios = <&gpio 47 1>; // Dummy GPIO , Unused or change
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete, as 6by9 says

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete all? reset-gpios maybe use in future,i see these were added also in other dts.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add it at a later stage via an override if it is needed.

As it stands the driver will claim a totally unrelated GPIO for no particular reason. GPIO 47 isn't necessarily unused or even present on all devices, so could actually cause issues if left in.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some my device's driver need it, as how i write to overlay in use

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For those devices that do require it you can add an additional fragment to configure it which can be enabled by the relevant override.

A similar case is https://github.com/raspberrypi/linux/blob/rpi-6.12.y/arch/arm/boot/dts/overlays/edt-ft5406.dtsi#L11-L16 where we want to add the touchscreen-inverted-x; property on demand, triggered by the invx override

With the driver calling devm_gpiod_get_optional, the driver doesn't need it. It's permitted to call any of the gpiod_ functions with the returned (NULL) handle.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like this?
reset_pin = <&panel>,"reset-gpios:47";
and modify driver for devm_gpiod_get_optional.

Copy link
Copy Markdown
Contributor

@pelwell pelwell Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close:

reset_pin = <&panel>,"reset-gpios:0=",<&gpio>, 
            <&panel>,"reset-gpios:4=47",
            <&panel>,"reset-gpios:8=1";

will create the reset-gpios property if you use the reset_pin parameter, but 6by9 was suggesting that you would build that into a product declaration:

new_panel_needing_reset = <&panel>, "compatible=tdo,new-panel-needing-reset",
            <&panel>,"reset-gpios:0=",<&gpio>,
            <&panel>,"reset-gpios:4=47",
            <&panel>,"reset-gpios:8=1";

But it might be cleaner to have a dormant fragment that gets enabled as needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The driver is already using

ctx->reset = devm_gpiod_get_optional(&dsi->dev, "reset", GPIOD_OUT_LOW);

That means that ctx->reset will not return an error if reset-gpios is missing.

Add an additional fragment along the lines of:

	fragment@10 {
		target = <&panel>;
		reset_gpio_frag: __dormant__ {
			reset-gpios = <&gpio 47 1>;
		};
	};
	__overrides__ {
		reset_pin = <0>, "+10", 
				<&reset_gpio_frag>, "reset-gpios:4";
	};

You can then have dtoverlay=vc4-kms-dsi-tdo-panel,reset_pin=47 to enable the reset gpio and set it to 47 (or whatever other GPIO number you wish to use).

Just looking through the various Pi variants, gpio 47 is used for:

  • Pi1A/B: SD card detect
  • Pi1A+, B+, 2B, 3B, Zero, ZeroW: Activity LED
  • Pi 3B+/A+, CM3, CM4, 02W, CM0 : I2C to SMPS
  • CM1: EMMC_ENABLE_N

This is why I say it can't be claimed generically by the overlay.
(Pi5 appears to use it for 2712_WAKE)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this reset pin is not decided yet,can you give me a suggest? now dts add this->
+fragment@4 {

  •   target = <&panel>;
    
  •   reset_gpio_frag: __dormant__ {
    
  •   	reset-gpios = <&gpio 47 1>;
    
  •   };
    
  • };

dsi0 = <&dsi_frag>, "target:0=",<&dsi0>,
<&i2c_frag>, "target:0=",<&i2c_csi_dsi0>;

  • reset_pin = <0>, "+10",
  •          <&reset_gpio_frag>, "reset-gpios:4";
    

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx->reset = devm_gpiod_get_optional(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->reset))
dev_warn(&dsi->dev, "Couldn't get the reset GPIO\n");

struct drm_display_mode *mode;

mode = drm_mode_duplicate(connector->dev, ctx->desc->mode);
dev_info(&ctx->dsi->dev, "%ux,%ux,%ux\n", ctx->desc->mode->hdisplay,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No user needs to see this - dev_dbg or delete.

struct tdo_panel *ctx;
int ret;

dev_info(&dsi->dev, "dsi panel: %s\n",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is preferred for successful probing to generate minimal output. Perhaps defer this line to after the number of lanes is available and combine the two?

struct tdo_panel *ctx = mipi_dsi_get_drvdata(dsi);

if (ctx->reset) {
dev_info(&dsi->dev, "shutdown\n");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really don't need this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

struct tdo_panel *ctx = mipi_dsi_get_drvdata(dsi);

gpiod_set_value_cansleep(ctx->reset, 0);

like this,is it ok?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to the dev_info()

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 16, 2026

I've just noticed that someone is upstreaming the Waveshare DSI display drivers to mainline at present

V2 displays https://lore.kernel.org/dri-devel/20260413-waveshare-dsi-touch-v3-21-3aeb53022c32@oss.qualcomm.com/

https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/bridge/waveshare-dsi.c for the V1 displays is already merged.
https://lore.kernel.org/dri-devel/20260412-ws-lcd-v3-0-db22c2631828@oss.qualcomm.com/T/ is extending that.

At some point I'll update the overlays and delete the old panel-waveshare-dsi and panel-waveshare-dsi-v2 drivers.

There are a couple of tdo panel drivers already in mainline, so if any of them match these new panels then the configuration really should be added to those drivers rather than this new one.
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/panel/panel-tpo-td028ttec1.c
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/panel/panel-tpo-td043mtea1.c

@flash-fea
Copy link
Copy Markdown
Author

my company need only one driver to use all our mipi panel,it seems to add some after this request finish.

Comment thread arch/arm/boot/dts/overlays/README Outdated
rotation Display rotation {0,90,180,270}
dsi0 Use DSI0 and i2c_csi_dsi0 (rather than
the default DSI1 and i2c_csi_dsi).
reset_pin GPIO pin for RESET (default 25)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true - there is no default value, because you can't enable the reset pin without assigning a value.

rotation = <&panel>, "rotation:0";
dsi0 = <&dsi_frag>, "target:0=",<&dsi0>,
<&i2c_frag>, "target:0=",<&i2c_csi_dsi0>;
reset_pin = <0>, "+10",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number after the "+" is the number of the fragment to enable, which in this case should be 4.

Comment thread drivers/gpu/drm/panel/panel-tdo-dsi-v1.c
@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 17, 2026

my company need only one driver to use all our mipi panel,it seems to add some after this request finish.

You haven't actually answered my questions as to whether you are actually representing TDO as the panel manufacturer, and whether you are creating a product to use this with a Raspberry Pi.

You may prefer having a single driver for all displays, but the mainline Linux folks may disagree and wish the panels to be clustered into similar families or by controller IC.
We have little interest in merging drivers here that aren't for use with a Raspberry Pi.

@flash-fea
Copy link
Copy Markdown
Author

Yes, I work at TDO. The company is currently expanding into the Raspberry Pi market, and in fact, some customers are already using it in a variety of scenarios. Merging into the branch will facilitate future work.

@flash-fea flash-fea force-pushed the rpi-6.18.y branch 2 times, most recently from 7aa28c5 to 2677911 Compare April 21, 2026 07:54
@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 21, 2026

I've split the long README line

@flash-fea
Copy link
Copy Markdown
Author

Was the push successful?

kun_liu added 3 commits April 22, 2026 09:10
panel-tdo-dsi-v1.c as module to driver tdo panel.

Signed-off-by: kun_liu <kun_liu@shtdo.com>
__overrides__ parameter can be add in config.txt for customers.
README describe the dts config info.

Signed-off-by: kun_liu <kun_liu@shtdo.com>
Share panel drivers to bcmxxx_defconfig as module to use in all.

Signed-off-by: kun_liu <kun_liu@shtdo.com>
@pelwell
Copy link
Copy Markdown
Contributor

pelwell commented Apr 22, 2026

I've had a look at the details of the products (or at least the two I can find), and at the driver, and I can't see anything Raspberry Pi-specific in them. As such, there's no incentive for us to host the driver - it would mean taking on the support burden of forward-porting to each new kernel version.

@6by9
Copy link
Copy Markdown
Contributor

6by9 commented Apr 22, 2026

There's been a discussion internally regarding the maintenance burden of additional drivers such as this, and how we handle this in future.

Overlays are always specific to our kernel tree, so those aren't an issue. Those patches all get squashed together, and device tree is considered an ABI that can't be changed once published. Likewise defconfigs get rebuilt with each kernel release.

Accepting drivers to our downstream creates a support burden on us to as the in-kernel APIs do change from time to time. If drivers are upstream then the person making the changes to the in-kernel APIs is responsible for updating all drivers that use those APIs.

However we appreciate that you and other companies can be in the position of wanting to launch products, whilst upstreaming drivers takes a fair amount of time due to the kernel development cycle.
The current feeling is that we'll accept the driver, but with a time limit of the current LTS kernel cycle to get the driver upstreamed, or at least a significant attempt made to get it upstreamed. (LTS kernels come out once per year, generally the last release of the year. It generally takes until March/April until we adopt them as the standard Pi kernel)

If you need assistance in upstreaming drivers, then there are a number of consulting companies that are able to offer services (eg Collabora, Pengutronix, and Linaro). We're not in a position to offer assistance.
Upstream will require a device tree binding doc, and I would suggest that seeking assistance on those is worthwhile to avoid the most common pitfalls.

We appreciate that this may not have been the answer you wanted, but we need to look at the bigger picture.
The same stance will apply to all driver submissions in the future, and we've always previously said that if drivers don't forward port easily that they will be dropped and reported back to the original submitter for updating so this is a relatively small incremental step from that.

If upstreaming isn't feasible, then you may want to look at a DKMS (Dynamic Kernel Module Support) package for the driver so it will get automatically rebuilt on the user's system whenever the kernel gets updated via apt.

Copy link
Copy Markdown
Contributor

@6by9 6by9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing glaringly obviously wrong.

The driver Kconfig does mention supporting backlight control via the backlight class, but no backlight is configured in the overlay. Do the displays you're intending to sell have backlight control?

I suspect there is a question regarding touch overlays as well. TL034WVS03 for one appears to come with the option of a FT6336U touch overlay (at least according to panelook). That can be added later if desired as it's only a dtoverlay change.

@6by9 6by9 merged commit 1d5bb99 into raspberrypi:rpi-6.18.y Apr 22, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants