-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add panel-dsi for device-tree side configuration of generic DSI panels #5640
Conversation
items: | ||
- {} | ||
- const: panel-dsi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referencing https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/display/panel/panel-simple-dsi.yaml#L58-L60, you ought to be supporting a reg property to set the DSI virtual channel.
drivers/gpu/drm/panel/panel-simple.c
Outdated
@@ -500,6 +500,7 @@ static int panel_dpi_probe(struct device *dev, | |||
return 0; | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Random whitespace change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still present
May I ask which bridge device this is needed/intended for?
for a MIPI-to-LVDS bridge one needs to enable 'Generic LVDS panel driver' in order to use "panel-lvds" compatible from DT
Bridge input timing will have to be calculated by the driver based on the required output (in most cases) and other parameters (i.e. no data-lanes can be configured via overrides). so, what is the real target here? Having the possibility for adding 'dumb panels' (panels which just require a suitable timing on the DSI interface)? But that would not be in-line with
Would be glad if you can share some more details so others might be able to support. |
@aBUGSworstnightmare-rpi "Native" panels without a bridge IC are also a target. The wish is really only to be able to define what one can define in a panel_desc_dsi but doing that at runtime without needing to get a patch merged or distribute a kernel fork. |
Hmm .. still don't get that! You can't fire this display up with a panel-simple-dsi compatible; you will have to use panel-dpi-cm. That's pretty much the same for all native DSI displays which autoload TCON register settings from NVM; one still has to send 0x51/0x53/0x55 before you can switch the display on (0x29) and exit sleep mode (0x11) for normal operation. |
Native DSI can be either command mode or video mode. Whilst I wouldn't advocate it, the Waveshare DSI panels could be considered native DSI panels because the MCU handles all the initialisation. The regulator and backlight side could be handled by a regulator driver similar to rpi_panel_attiny_regulator, which leaves the panel side as a simple DSI device. That is a valid use case in my book. I would advocate that bridge chips are configured from Linux rather than hidden behind an MCU. At least that way there is visibility over what the hardware is actually doing, and if a compatibility issue is observed with a future chip then it can be addressed. Most bridge chip drivers should be configured automatically by the upstream panel device, so other than a bit of DT it adds no overhead. |
@aBUGSworstnightmare-rpi see the panels in the @6by9 generally agree with the sentiment about bridges! It gets a bit more complicated in some specific dev board style applications as I found out as the needs break with some assumptions in existing drivers or guidelines of how drivers should behave. That is a very niche thing though where I feel re-using generic infrastructure might be the nicer approach. |
(subscribing myself by commenting) |
That works - there's also a Subscribe button in the controls on the right at the top of the page (it probably says Unsubscribe now). |
Can you stop force-pushing your branch unless you are actively changing your code? GitHub is pretty good at rebasing when we want to merge, and every update invalidates the previous build check results. |
sorry, there were commits that were not supposed to go into this branch that I wanted to roll back. Not going to happen again. |
Just wanted to add that I tested this PR on the CM4 with a custom carrier I'm working on, and it works great! I no longer have to patch |
@pelwell ive also had much success with fun displays connecting through the ICN6211 (with a microcontroller doing the i2c/spi configuration during power-up) - can you approve the workflow so it could get reviewed before the next kernel release is made? :) |
Is this actually ready? I see that the Draft status has been removed (GitHub doesn't give notifications about that, so a comment is always a good idea), but some of the comments on the PR have been acknowledged but not acted on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, still unaddressed issues.
There needs to be 2 commits - one device tree binding, and one driver change. The third "fixup" patch touches both binding and driver.
Checkpatch complaint as there is no commit description.
How about a 3rd commit that adds an overlay using this, along similar lines to https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts or vc4-kms-dpi-panel-overlay.dts
For those adding panels using this driver change, I would like to see it done in a similar way to https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts, where there is one overlay that uses an override to select the relevant panel. The timing and config can be put in that overlay.
drivers/gpu/drm/panel/panel-simple.c
Outdated
@@ -500,6 +500,7 @@ static int panel_dpi_probe(struct device *dev, | |||
return 0; | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still present
Thanks for the input @6by9 ! For the requested overlay, you mean this as a practical example for how to use this? |
With a very few exceptions, individual commits should never cross subsystem boundaries. For mainline it causes grief over which tree it should be committed through. We also don't want your development history here - you've been asked to make changes as the original driver has issues, therefore please amend the existing commits as they've gone nowhere except your local branch.
Yes please. |
Sorry I just realized that my added comments where part of making a review and did not show up publicly as I hadn't submitted the review until now. |
d4f55d4
to
9561831
Compare
Sorry for the force push but not aware of any other way to make a clean history rewrite/amend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force pushing is the correct way to update the branch backing a PR.
Thank you - the general implementation is far cleaner.
A number of checkpatch errors.
Please give a full description in the commit text. Titles should always start with the subsystem (do git log
on the file if in doubt, and copy all the other commits).
I was hoping that the overlay would actually be compiled and useful, with similar overrides to https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
Ah yes sorry about the missing description you mentioned that before, will run checkpatch on the actual patch. I only ran it on the source files. @ Overlay, my bad I understood that way different. More as a template for new overlays, not to be used as is. |
@6by9 do you have a suggestion for how to represent the mode stringarray with overrides? |
We can do arrays of cells, but not arrays of strings. Exactly what change do you want the overlay to make? |
So just set MODE_VIDEO and have done with it. If we add support for the extra flags, then a vc4-kms-dsi-panel-overlay.dts overlay would allow those who wish to define their panel by name can do support that level of configuration, but the generic overlay won't support it. Overlays don't go upstream, so it's not an issue for that. |
That's fair enough, good with me. I don't see a big need for more than video_mode either. Most other options are usually just optimizations anyway. |
@6by9 Please see updated commits. checkpatch should be happy except for license header which does not seem to be wanted for overlays. The only thing unaddressed is the location of the data-lanes property. See my comments on the last review. |
If you don't need it in the overlay, don't enable it. i2c0mux will claim GPIOs 0&1 which may be used for other purposes. Your overlay would be incompatible with that for no good reason.
data-lanes is a standard property, and it goes in the endpoint as covered by https://www.kernel.org/doc/Documentation/devicetree/bindings/media/video-interfaces.yaml If you have a bridge or similar DSI device, then you have an input port and an output port, each with their embedded endpoint. The number of lanes is property of the port/endpoint, not the overall device. |
That is a fair point, will revert.
Okay yea, the disconnect to the other bus properties feels a bit odd but fair enough if there is precedence for having lanes defined in the endpoint. Will revise. |
Pushed the change. I'm a bit uncertain if the bindings are defined correctly this way but given that there should only ever be a single endpoint this feels like the correct approach to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All overlays must have an entry in the README file documenting the overlay and the associated overrides. In this case most of it can be copied from vc4-kms-dpi-generic.
Icing on the cake would have been to include configuration of a backlight node (as vc4-kms-dpi-generic does), but I'm not going to worry about that one now.
rgb565 = <&panel>, "dsi-color-format=RGB565"; | ||
rgb666p = <&panel>, "dsi-color-format=RGB666_PACKED"; | ||
rgb666 = <&panel>, "dsi-color-format=RGB666"; | ||
rgb888 = <&panel>, "dsi-color-format=RGB888"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed as this is the default already present in the panel definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with having parameters that select values that are also the defaults. It can take some of the guesswork out of reading a config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was sort of my thinking, a lot of people who would use the generic overlay might never see the dts file and just follow a guide. Being explicit in the parameters seems like it would avoid potential confusion.
I'm with you for the backlight but I'm not sure what the best options for that are. Unlike for dpi you are not guaranteed to have a connection to the 40pin header and you might not wanna touch that with a default if you don't know if there isn't likely some form of HAT on there. Have pushed the requested changes except for leaving RGB888 in as an option. If there is disagreement let me know. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile and weird rebase fixes required.
For vc4-kms-dpi-generic the backlight is disabled by default, so you could have done the same here. If the panel implementation has suitable backlight control then the wiring is sorted via overrides.
(For those designing hardware, an I2C controlled backlight makes most sense - TI look to have a number of options in the LP855x range).
Leave it for now - this has rumbled on long enough.
Equivalent to panel-dpi for configuring a simple DSI panel with device tree side timings and bus settings. Motiviation is the same as for panel-dpi of wanting to support new simple panels without needing to patch the kernel. Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
Bindings for the panel-dsi specific additions to panel-simple. Allow for DSI specific bus settings and panel timing to be define in devicetree. Very similar to panel-dpi. Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
oh yea sorry, divergent feature branch, looks clean to me now. Makefile fixed. And yea agree, I2C backlight probably the best for now and what we've been using. |
arch/arm/boot/dts/overlays/README
Outdated
This is the default | ||
two-lane Use two DSI lanes for data transmission | ||
three-lane Use three DSI lanes for data transmission | ||
Only supported on Pi5+ and CM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pi5+ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in for Pi5 and "going forward" assuming that a Pi6 would keep with the 4 channels.
Nothing obviously wrong other than the Pi5+ comment. CI pipeline running, so will just check whether that picks anything up, but otherwise I think I'm happy. Thanks for following through on this. |
Glad to hear and thanks for the guidance! E: Hm why is the dtoverlaycheck unhappy about the Readme? Don't quite understand the error output. |
dtoverlaycheck ensures:
If you could update the overlay to use hyphens, correct the alphabetical order, and drop the erroneous |
Analog to the generic panel-dpi overlay to use panel-dsi with dtparam to not require a panel specific overlay for simple use cases that do not require setting more niche DSI modes. Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
oh yea, thats what I get for typing it out.. |
Yay - thanks for persevering and getting this over the line. |
kernel: overlays: ADS1115: allow specification of the i2c bus See: raspberrypi/linux#5762 kernel: Add panel-dsi for device-tree side configuration of generic DSI panels See: raspberrypi/linux#5640 kernel: Revert: regmap: Ensure range selector registers are updated after cache sync See: raspberrypi/linux#5763 kernel: ASoC: Adds support for TAS575x to the pcm512x driver kernel: ASoC: pcm512x: Adds bindings for TAS575x devices
kernel: overlays: ADS1115: allow specification of the i2c bus See: raspberrypi/linux#5762 kernel: Add panel-dsi for device-tree side configuration of generic DSI panels See: raspberrypi/linux#5640 kernel: Revert: regmap: Ensure range selector registers are updated after cache sync See: raspberrypi/linux#5763 kernel: ASoC: Adds support for TAS575x to the pcm512x driver kernel: ASoC: pcm512x: Adds bindings for TAS575x devices
This adds an analog to the already existing panel-dpi to panel-simple which allows for timing configuration in device-tree for simple DSI panels.
In addition this also allows configuration of the DSI parameters in device tree.
I tried to be as consistent as possible with how panel-dpi was implemented.
Code was tested with a 840x480 panel driven by an externally configured bridge IC.
This addition was discussed with @6by9 over in raspberrypi/firmware#1819 (comment)
The main motivation is with not needing to run custom kernels for simple DSI devices that require nothing but an entry in panel-simple for the timings and DSI config flags.
This becomes very cumbersome when a large amount of displays need to be maintained. Essentially the exact same reasoning that the panel-dpi patch had for the initial implementation for this type of feature in panel-simple but expanding it to also be possible for DSI panels.
Any feedback would be welcome.