Skip to content

vc4-kms-dpi overlay updates #4860

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

Merged
merged 3 commits into from
Feb 1, 2022
Merged

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Jan 31, 2022

Cherry-picks 2 commits back from rpi-5.15.y.

Splits out all the common parts of the vc4-kms-dpi overlays.

6by9 added 2 commits January 31, 2022 17:41
Adds the option of a PWM controlled backlight on a generic
DPI display.

Signed-off-by: Dave Stevenson <[email protected]>
Both the base node and override set these parameters to 0,
so it made no difference. The base node should have been 1.

Signed-off-by: Dave Stevenson <[email protected]>
@6by9
Copy link
Contributor Author

6by9 commented Jan 31, 2022

Mods to support #4853.
I need to verify that these still work.

@aBUGSworstnightmare-rpi Could you verify that dtoverlay=vc4-kms-dpi-panel,at056tn53v1 still works for your panel too?

@6by9
Copy link
Contributor Author

6by9 commented Jan 31, 2022

Updated to move the Adafruit Kippah 7inch display into vc4-kms-dpi-panel, and deprecate vc4-kms-kippah-7inch.

@6by9 6by9 force-pushed the rpi-5.10.y-dpi branch 2 times, most recently from 16b6eb6 to a6aa70c Compare January 31, 2022 18:57
@aBUGSworstnightmare-rpi
Copy link
Contributor

aBUGSworstnightmare-rpi commented Feb 1, 2022 via email

@aBUGSworstnightmare-rpi
Copy link
Contributor

aBUGSworstnightmare-rpi commented Feb 1, 2022

@6by9 Tested Innolux 5.6in with GPIO-backlight. Adding

dtoverlay=vc4-kms-dpi-panel
dtparam=at056tn53v1,backlight-gpio=19

to config.txt gives below —> GPIO BL confirmed working.

pi@test1:~ $ sudo vcdbg log msg…
006747.398: brfs: File read: /mfs/sd/overlays/vc4-kms-v3d-pi4.dtbo
006811.768: Loaded overlay 'vc4-kms-v3d'
006811.781: dtparam: noaudio=true
006812.900: dtparam: ant2=true
007019.521: brfs: File read: 3823 bytes
007034.703: brfs: File read: /mfs/sd/overlays/vc4-kms-dpi-panel.dtbo
007062.568: Loaded overlay 'vc4-kms-dpi-panel'
007062.599: dtparam: at056tn53v1=true
007063.452: dtparam: backlight-gpio=19
007130.576: brfs: File read: 4287 bytes
…
pi@test1:~ $ 

Tested Innolux 5.6in with PWM-backlight. Adding

dtoverlay=vc4-kms-dpi-panel,at056tn53v1
dtparam=backlight-pwm=1,backlight-pwm-chan=1,backlight-pwm-gpio=19

To config.txt gives below

pi@test1:~ $ sudo vcdbg log msg
…
007031.759: brfs: File read: /mfs/sd/overlays/vc4-kms-dpi-panel.dtbo
007059.670: Loaded overlay 'vc4-kms-dpi-panel'
007059.683: dtparam: at056tn53v1=true
007060.564: dtparam: backlight-pwm=1
007061.895: dtparam: backlight-pwm-chan=1
007062.510: dtparam: backlight-pwm-gpio=19
007157.705: brfs: File read: 4287 bytes
…
pi@test1:~ $ raspi-gpio get
BANK0 (GPIO 0 to 27):
…
GPIO 19: level=1 fsel=2 alt=5 func=PWM0_1 pull=DOWN
..
pi@test1:~ $ 

GPIO19 is configured for PWM operation with channel1, but has a pull-down active. Shouldn’t that be no-pull for proper operation?
Change of Fragment 107 as shown below

	fragment@107 {
		target = <&gpio>;
		__dormant__ {
			pwm_pins: pwm_pins {
				brcm,pins = <18>;
				brcm,function = <2>; /* Alt5 */
				brcm,pull = <0>;
			};
		};
	};

Backlight is working though, tested as outlined below.

pi@test1:~ $ sudo -i

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

root@test1:~# echo 0  > /sys/class/backlight/backlight/brightness
-bash: /sys/class/backlight/backlight/brightness: No such file or directory
root@test1:~# echo 0  > /sys/class/backlight/backlight_pwm/brightness
root@test1:~# echo 3  > /sys/class/backlight/backlight_pwm/brightness
root@test1:~# echo 16  > /sys/class/backlight/backlight_pwm/brightness
-bash: echo: write error: Invalid argument
root@test1:~# echo 15  > /sys/class/backlight/backlight_pwm/brightness
root@test1:~# echo 10  > /sys/class/backlight/backlight_pwm/brightness
root@test1:~# 

@6by9
Copy link
Contributor Author

6by9 commented Feb 1, 2022

@aBUGSworstnightmare-rpi Thanks for testing. That sounds good and working as intended.
If you don't mind, then I'm going to mark vc4-kms-dpi-at056tn53v1 as deprecated, and to use vc4-kms-dpi-panel,at056tn53v1 instead.

Pulls are largely irrelevant for any pin defined as an output or alt function which drives the pin.
As you say, adding brcm,pull = <0>; to the pwm_pins node of vc4-kms-dpi.dtsi should solve it anyway.

I tested with the Adafruit Kippah 7inch panel, and that was fine too, so other than fixing up my copy/paste error, I think we're good to go.

@pelwell Just checking you are happy with this approach of one fragment per panel to set the compatible, rather than setting it explicitly from the override line?

@aBUGSworstnightmare-rpi
Copy link
Contributor

Feel free doing so! Makes things more simple.
Although I need to admit that novice users might be struggling with how to configure the overrides for PWM (as one needs to know that PWM on GPIO19 is channel 1 of the BRCM PWM module).

@6by9
Copy link
Contributor Author

6by9 commented Feb 1, 2022

There's nothing stopping a panel override also configuring the backlight properties as well. Adafruit's Kippah has none, and vc4-kms-dpi-at056tn53v1 didn't define one either.

Untested, but make your override

at056tn53v1 = <0>, "+0+90",
	  <0>, "+104+105+106+107+108",
	  <&backlight_pwm>, "pwms:4=1",
	  <&pwm_pins>, "brcm,pins:0=19";

and it should configure panel and backlight in one hit.

@pelwell
Copy link
Contributor

pelwell commented Feb 1, 2022

Just checking you are happy with this approach of one fragment per panel to set the compatible, rather than setting it explicitly from the override line?

This is fine. I'm not sure you could override a multi-string property like the compatibles here without going to a hex byte string approach, which is just horrible.

What I'm not so keen on is deprecating the old overlays immediately in a way that means it ceases to work. I'm thinking particularly about the kippah overlay. I've realised that it shouldn't be hard to extend the firmware so that a rename in overlay_map.dtb could take a few parameters. It wouldn't cope with change parameters, but I imagine that the specific overlay to parameter of a generic overlay is actually relatively common conversion.

@aBUGSworstnightmare-rpi
Copy link
Contributor

There's nothing stopping a panel override also configuring the backlight properties as well. Adafruit's Kippah has none, and vc4-kms-dpi-at056tn53v1 didn't define one either.

When I did the pull-request for 'vc4-kms-dpi-at056tn53v1-overlay.dts' backlight PWM was not enabled in the default kernel. So - in order to avoid issues - no PWM backlight node was added to the overlay.

@6by9
Copy link
Contributor Author

6by9 commented Feb 1, 2022

What I'm not so keen on is deprecating the old overlays immediately in a way that means it ceases to work. I'm thinking particularly about the kippah overlay. I've realised that it shouldn't be hard to extend the firmware so that a rename in overlay_map.dtb could take a few parameters. It wouldn't cope with change parameters, but I imagine that the specific overlay to parameter of a generic overlay is actually relatively common conversion.

OK, I'll drop the deprecation the old Kippah overlay for now. If we get a mechanism to rename in future then that would be great.
As aBUGSworstnightmare-rpi is the only one using at056tn53v1, and he's OK with deprecating it, I'll do that one.

@pelwell
Copy link
Contributor

pelwell commented Feb 1, 2022

Cool - that's what I was going to suggest.

Removes all the common panel, dpi, and backlight configuration
from the individual vc4-kms-dpi-* files into vc4-kms-dpi.dtsi.

Creates a new vc4-kms-dpi-panel-overlay.dts for preconfigured
panels, with overrides to enable the different panel configurations.

Deprecates vc4-kms-dpi-at056tn53v1 as superceded by vc4-kms-dpi-panel.
vc4-kms-kippah-7inch not deprecated for now as it is likely to be
in wider use than at056tn53v1.

Signed-off-by: Dave Stevenson <[email protected]>
@6by9
Copy link
Contributor Author

6by9 commented Feb 1, 2022

OK, tested again with vc4-kms-kippah-7inch and vc4-kms-dpi-panel,kippah-7inch, and both work.

rotate and backlight for at056tn53v1 can be added at a later date.

@pelwell pelwell merged commit e6dd932 into raspberrypi:rpi-5.10.y Feb 1, 2022
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 2, 2022
kernel: Patching lan78xx for SOF_TIMESTAMPING_TX_SOFTWARE support
See: raspberrypi/linux#4856

kernel: i2c: bcm2835: Make clock-stretch timeout configurable
See: raspberrypi/linux#4855

kernel: drm/vc4: Add DRM 210101010 RGB formats for hvs5.
See: raspberrypi/linux#4859

kernel: vc4-kms-dpi overlay updates
See: raspberrypi/linux#4860

kernel: Add Support for the Geekworm MZP280 DPI Display
See: raspberrypi/linux#4853

kernel: DRM: Clean up handling of panel orientation
See: raspberrypi/linux#4862

kernel: Add support for the MAX30102 heart rate and blood oxygen sensor
See: raspberrypi/linux#4535

firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param
See: raspberrypi/linux#4669

userland: Handle overlay parameters embedded in overlay_map.dtb
See: raspberrypi/linux#4860
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Feb 2, 2022
kernel: Patching lan78xx for SOF_TIMESTAMPING_TX_SOFTWARE support
See: raspberrypi/linux#4856

kernel: i2c: bcm2835: Make clock-stretch timeout configurable
See: raspberrypi/linux#4855

kernel: drm/vc4: Add DRM 210101010 RGB formats for hvs5.
See: raspberrypi/linux#4859

kernel: vc4-kms-dpi overlay updates
See: raspberrypi/linux#4860

kernel: Add Support for the Geekworm MZP280 DPI Display
See: raspberrypi/linux#4853

kernel: DRM: Clean up handling of panel orientation
See: raspberrypi/linux#4862

kernel: Add support for the MAX30102 heart rate and blood oxygen sensor
See: raspberrypi/linux#4535

firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param
See: raspberrypi/linux#4669

userland: Handle overlay parameters embedded in overlay_map.dtb
See: raspberrypi/linux#4860
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Mar 1, 2022
kernel: overlays:fixes probing of Hifiberry DAC2 HD
See: raspberrypi/linux#4904

kernel: overlays: Add overlays for WaveShare 2-Channel Isolated CAN FD HAT
See: raspberrypi/linux#4907

kernel: configs: Add CONFIG_TINYDRM_HX8357D=m
kernel: overlays: Add drm parameter to pitft35-resistive
See: https://forums.raspberrypi.com/viewtopic.php?t=330088

kernel: ARM: dts: Add GPIO line names for downstream RPis
See: raspberrypi/linux#2760

firmware: board_info: Handle misprogrammed 3B rev 1.2s

firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param

firmware: Handle overlay parameters embedded in overlay_map.dtb
See: raspberrypi/linux#4860

firmware: firmware: Add HDMI_PORTS trait

firmware: arm_dt: Fix rpi-poe overlay parameters
See: #1689

firmware: jpeghw: Skip APP0 AVI1 headers, regardless of length
See: https://forums.raspberrypi.com/viewtopic.php?p=1975448

firmware: camera_subsystem: Report ignored interfaces due to libcamera
See: #1679

firmware: Export os_prefix, overlay_prefix, rsts and boot-mode on all models

firmware: vcfw/hdmi_i2c: Initialise all instances from hdmi_i2c_init
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Mar 1, 2022
kernel: overlays:fixes probing of Hifiberry DAC2 HD
See: raspberrypi/linux#4904

kernel: overlays: Add overlays for WaveShare 2-Channel Isolated CAN FD HAT
See: raspberrypi/linux#4907

kernel: configs: Add CONFIG_TINYDRM_HX8357D=m
kernel: overlays: Add drm parameter to pitft35-resistive
See: https://forums.raspberrypi.com/viewtopic.php?t=330088

kernel: ARM: dts: Add GPIO line names for downstream RPis
See: raspberrypi/linux#2760

firmware: board_info: Handle misprogrammed 3B rev 1.2s

firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param

firmware: Handle overlay parameters embedded in overlay_map.dtb
See: raspberrypi/linux#4860

firmware: firmware: Add HDMI_PORTS trait

firmware: arm_dt: Fix rpi-poe overlay parameters
See: raspberrypi/firmware#1689

firmware: jpeghw: Skip APP0 AVI1 headers, regardless of length
See: https://forums.raspberrypi.com/viewtopic.php?p=1975448

firmware: camera_subsystem: Report ignored interfaces due to libcamera
See: raspberrypi/firmware#1679

firmware: Export os_prefix, overlay_prefix, rsts and boot-mode on all models

firmware: vcfw/hdmi_i2c: Initialise all instances from hdmi_i2c_init
@pelwell
Copy link
Contributor

pelwell commented Mar 2, 2022

The most recent rpi-update firmware adds support for "rename with added parameters", making it possible to soft-deprecate the old vc4-kms-kippah-7inch overlay.

mkreisl added a commit to xbianonpi/xbian-package-firmware that referenced this pull request Jul 1, 2023
- firmware: board_info: Handle misprogrammed 3B rev 1.2s

- firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param

- firmware: Handle overlay parameters embedded in overlay_map.dtb
  See: raspberrypi/linux#4860

- firmware: firmware: Add HDMI_PORTS trait

- firmware: arm_dt: Fix rpi-poe overlay parameters
  See: #1689

- firmware: jpeghw: Skip APP0 AVI1 headers, regardless of length
  See: https://forums.raspberrypi.com/viewtopic.php?p=1975448

- firmware: camera_subsystem: Report ignored interfaces due to libcamera
- See: #1679

- firmware: Export os_prefix, overlay_prefix, rsts and boot-mode on all models

- firmware: vcfw/hdmi_i2c: Initialise all instances from hdmi_i2c_init

- firmware: dtoverlay: Add support for string escape sequences
  See: https://forums.raspberrypi.com/viewtopic.php?t=330792

- firmware: isp: R and B order must be swapped when reading VC_IMAGE_RGBA32 into the ISP
  See: http://git/vc4/vc4/-/merge_requests/1430

- firmware: dtoverlay: Fix path rebasing and exports

- firmware: dtoverlay: Fix clang warnings

- firmware: arm_loader_dvfs: Make arm only see its own boosts, fixed and min clocks

- firmware: arm_loader: Support longer file paths
  See: #1720

- firmware: arm_loader_dvfs: Support CLOCK_HDMI as boostable clock
  See: raspberrypi/linux#5016

- firmware: dtblob: Use a cached alias to reduce boot time

- firmware: hdmi: Reduce the number of EDID retries if hotplug is not detected

- firmware: variants: Add mjpg_encode to the standard firmware image

- firmware: vcgencmd display_power and camera_auto_detect fixes

- firmware: arm_loader_dvfs: Only add clocks to boostable list when they have been boosted
  See: #1726

- firmware: arm_dt: Try upstream DTB files if downstream absent

- firmware: arm_loader: Delay the USB controller switchover

- firmware: Fix for vc_image YUYV family to YUV422 planar conversion function

- firmware: arm_loader_dvfs: Only add clocks to boostable list when they have been boosted
  See: #1726

- firmware: arm_dt: Try upstream DTB files if downstream absent

- firmware: arm_loader: Delay the USB controller switchover

- firmware: Fix for vc_image YUYV family to YUV422 planar conversion function

- firmware: arm_dt: camera_auto_detect cam0 flag needs to look at Unicam instance, not port

- firmware: platform: over-voltage Zero 2 W by two pips
  See: #1723

- firmware: hello_pi: Fix some build issues
  See: #1728

- firmware: video_decode: Stop decode on a colourspace change
  See: raspberrypi/linux#5059

- firmware: video_encode: Fix subsample image alignment assert

- firmware: tc358762_DSI: Don't start the PV and DSI before the HVS

- firmware: arm-dt: Export log buffer addresses to /proc/chosen/log

- firmware: arm_loader: Fix GET_CLOCKS to not overwrite client buffer
  See: #1688

- firmware: arm_loader: Declare program_sdhost_use_dma

- firmware: arm_loader: initramfs over NVME fix
  See: #1731

- firmware: Disable BT flow control pins for Pi3 rev1.3

- firmware: power: Fix failover to secondary PMIC interface functions
  See: https://forums.raspberrypi.com/viewtopic.php?t=338429

- firmware: arm_loader: Correct GPIO expander initial state via SET_GPIO_CONFIG
  See: raspberrypi/linux#5107

- firmware: platform: Set min_frequency for HDMI SM clock on Pi0-3

- firmware: arm_loader: Never set warranty bit
  See: #1741

- firmware: vcfw: camera_subsystem: Fix loop counter for powering up devices
  See: https://forums.raspberrypi.com/viewtopic.php?t=338917

- firmware: ldconfig: Add [cm4s] conditional

- firmware: Fix USB boot
  See: #1744

- firmware: video decode/MJPEG fixes
  See: http://git/vc4/vc4/-/merge_requests/1548

- firmware: power: Restore VEC and PIXEL clocks after HDMI domain power cycle
  See: raspberrypi/linux#4962

- firmware: isp: Workaround for very unpleasant artifacts in the sharpening block

- firmware: arm_loader: Raise maximum gzipped kernel size

- firmware: arm-loader: Indicate tryboot status via /proc/device-tree/chosen/bootloader/tryboot

- firmware: arm_loader: Increase TFTP block size to 1468 bytes
  See: raspberrypi/rpi-eeprom#375

- firmware: Add kernel= logging

- firmware: camera_auto_detect changes
  See: #1750

- firmware: board_info: Fix Pi 400 PHY addresses
  See: #1754

- firmware: il: isp: Correct order buffers were returned in

- firmware: isp: Run ISP without hi-res output buffer

- firmware: arm_dt: Export the bootloader EEPROM RSA public key via device-tree

- firmware: Add tryboot A_B mode

- firmware: ldconfig: Add all, none, tryboot section support to autoboot.txt for start.elf

- firmware: arm-dt: bootloader: Pass the original partition number when booting a ramdisk

- firmware: arm_loader: HAT EEPROM support for GPIO bank 1
  See: #1756

- firmware: arm_loader: Add vcmailbox support for 256bit OTP customer device key
  See: raspberrypi/usbboot#163

- firmware: il: video_encode: MJPEG is not conditional on being RASPBERRYPI_FULL

- firmware: arm_loader: Improvements to Compute Module audio
  See: https://forums.raspberrypi.com/viewtopic.php?p=2052680

- firmware: arm_loader: Fix GPIO bank 1 support
  See: #1756

- firmware: arm_loader: PWM1 is not available on GPIO 45

- firmware: power: Always read the uncached voltage for AIN and USB_PD
  See: https://forums.raspberrypi.com/viewtopic.php?p=2059832#p2059832

- firmware: Use new SDHCI controller instead of legacy arasan
  See: #1763

- firmware: Add D flag to video= cmdline option when hotplug is forced

- firmware: Actually rebuild firmware described in previous commit

- firmware: hdmi_2711: Make some clock setup unconditional so booting without hdmi setup is possible

- firmware: arm_dispmanx: Correct support for NV21, and add support for YV16
  See: #1767

- firmware: arm_dispmanx: Fix FKMS to adopt pre-multiplied alpha
  See: #1773

- firmware: il isp: Correct histogram masks for updated group 2 regions

- firmware: video_decode: Convert the active lines, not the padded buffer

- firmware: bootloader: Raise CMA cap to 512MB on a 64-bit Pi4

- firmware: bootloader: Prefer 64-bit kernels on Pi 4s
  See: https://forums.raspberrypi.com/viewtopic.php?p=2088935#p2088935

- firmware: platform: clocks: Replace m2mc with hdmi for state machine clock on 2711

- firmware: bootloader: Fix automatic 64bit selection on Pi3s
  See: https://forums.raspberrypi.com/viewtopic.php?p=2089764#p2089764

- firmware: Handle 64-bitness of named kernels
  See: #1792

- firmware: gencmd: Add a fallback to mailbox interface if vchiq is not available

- firmware: arm_loader: Set local-bd-address if 6 zeroes found

- firmware: arm_loader: Really check for a zero local-bd-address
  See: raspberrypi/linux#5437

- firmware: arm_dt: Don't overwrite existing i2c aliases
  See: raspberrypi/linux#5428

- firmware: arm_loader: Reduce CMA warning severity
  See: #1807
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