jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25447
Joined: Sat Jul 30, 2011 7:41 pm

Re: DPI displays - dpi24 overlay fails on RPi4

Tue Jul 30, 2019 2:01 pm

I was using a 4GB Pi. Not sure it would make the slightest bit of difference though which one was used.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

aBUGSworstnightmare
Posts: 1675
Joined: Tue Jun 30, 2015 1:35 pm

Re: DPI displays - dpi24 overlay fails on RPi4

Wed Jul 31, 2019 5:32 am

Sirs, there is still the same problem for me!
Started with a fresh uSD (10/7/2019 Buster full) on a 2GB RPi4 --> no display --> added the overlay from this thread (the one which was created by PhilE). This allowed me to boot and make update/upgrade/rpi-update.

Then tested with some test-images.
Results: Problem becomes visible when showing grayscale images. My guess is some DPI output is not working on this Raspberry or isn't configured correctly. Will test with the 1GB later today and report too.
Will also test with other displays, also using DPI interface.
IMG_1029.jpg
see the three yellow lines --> picture shows a grey scale gradient, no color
IMG_1029.jpg (63.43 KiB) Viewed 4658 times
IMG_1030.jpg
red line to the left is not part of the image data
IMG_1030.jpg (62.74 KiB) Viewed 4658 times
IMG_1031.jpg
yellow and red lines where should be gray
IMG_1031.jpg (69.51 KiB) Viewed 4658 times
Original test files (BMP images) are here https://drive.google.com/drive/folders/ ... sp=sharing

And the config file used (further reduced it for clearness)

Code: Select all

dtparam=audio=off
enable_uart=off

disable_overscan=1

gpu_mem=208

# --------------------
# Adafruit 5in Kippah on DPI interface
# --------------------
dtoverlay=dpi24
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6f005
dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 6
# --------------------

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=1

[all]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
start_x=1

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: DPI displays - dpi24 overlay fails on RPi4

Wed Jul 31, 2019 8:09 am

The first of those images shows an anomaly at approximately 63, 127 and 191 - there could be one at 255 as well, but the white makes it hard to see/irrelevant. A curious person might try constructing image with steps and gradients, horizontally and vertically, around those values, in each of the colour components independently and in combination, to find a pattern.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25447
Joined: Sat Jul 30, 2011 7:41 pm

Re: DPI displays - dpi24 overlay fails on RPi4

Wed Jul 31, 2019 8:48 am

aBUGSworstnightmare wrote:
Wed Jul 31, 2019 5:32 am
Sirs, there is still the same problem for me!
Started with a fresh uSD (10/7/2019 Buster full) on a 2GB RPi4 --> no display --> added the overlay from this thread (the one which was created by PhilE). This allowed me to boot and make update/upgrade/rpi-update.

Then tested with some test-images.
Results: Problem becomes visible when showing grayscale images. My guess is some DPI output is not working on this Raspberry or isn't configured correctly. Will test with the 1GB later today and report too.
Will also test with other displays, also using DPI interface.

IMG_1029.jpg
IMG_1030.jpg
IMG_1031.jpg

Original test files (BMP images) are here https://drive.google.com/drive/folders/ ... sp=sharing

And the config file used (further reduced it for clearness)

Code: Select all

dtparam=audio=off
enable_uart=off

disable_overscan=1

gpu_mem=208

# --------------------
# Adafruit 5in Kippah on DPI interface
# --------------------
dtoverlay=dpi24
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6f005
dpi_timings=800 0 40 48 88 480 0 13 3 32 0 0 0 60 0 32000000 6
# --------------------

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=1

[all]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
start_x=1

Basically the same as my setup.

To me, that looks like a broken line feeding the display, so a particular signal is not getting through? But you say the same display and interface works on other devices?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

aBUGSworstnightmare
Posts: 1675
Joined: Tue Jun 30, 2015 1:35 pm

Re: DPI displays - dpi24 overlay fails on RPi4

Wed Jul 31, 2019 10:01 am

jamesh wrote: To me, that looks like a broken line feeding the display, so a particular signal is not getting through? But you say the same display and interface works on other devices?
Yes, works correct on a RPi3 and Zero (but will re-check later today when testing with another RPi4). I'm using the same display+kippah and uSD card, just swapping the Pi's.
I will also test with another display (using a LVDS4PI board) and let you know.

And yes, I also have the feeling that one of the 24 RBG signals is missing (or stucked at one logic level); will see how the other display performes.

aBUGSworstnightmare
Posts: 1675
Joined: Tue Jun 30, 2015 1:35 pm

Re: DPI displays - dpi24 overlay fails on RPi4

Wed Jul 31, 2019 3:21 pm

let's close this topic as I don't want to investigate further what's going on.

Recent findings:
- Adafruit 5in + Kippah show the same effect on my other RPi4
- RPI4 + LVDS4PI add-on board is working fine
- Adafruit + Kippah is working fine on RPi3 and Zero

I will stop testing here and consider DPI is working correctly. Don't know if I will ever connect a DPI display to a RPI4, so no need to investigate any further atm.

kevinfishburne
Posts: 3
Joined: Sat Oct 12, 2019 12:33 am

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Sat Oct 12, 2019 4:14 am

FYI I'm having a similar issue. I'm using a RPi4 with a HAT which requires dpi24 to output to a CRT TV (similar to the Gert VGA 666). The HAT works fine with the RPi3. It outputs nothing using the same config on the RPi4. The modified dpi24 overlay shared on Google Drive posted earlier in this thread did output video, but it appears to be missing the red channel. I was testing using the nightly Lakka build. I'm now testing using 2019-09-26-raspbian-buster, and it works like it did with Lakka using the modified dpi overlay (still missing the red channel):

Image

I'm guessing the modified dpi24 overlay was added to Raspbian since it exhibited the same behavior as my manual replacement. These are the settings I appended to Raspbian's config.txt:

Code: Select all

# Generic 24-bit DPI display.
dtoverlay=dpi24
#gpio=0-27=a2,np

# Set default display.
enable_dpi_lcd=1
display_default_lcd=1

# Turn off conflicting peripheral overlays using GPIO pins.
dtparam=i2c_arm=off
dtparam=spi=off
dtparam=i2s=off
dtparam=audio=off
enable_uart=0

# Enable custom dpi timings.
dpi_group=2
dpi_mode=87

# Set custom dpi timings.
#dpi_timings=2048 1 180 202 300 240 1 3 5 14 0 0 0 60 0 42954545 1 #240p - NTSC perfect clock based on SNES/NES timings
dpi_timings=320 1 23 25 39 240 1 4 3 15 0 0 0 60 0 6400000 1

# Disable overscan.
disable_overscan=1
The video mode set by the dpi timings is 320x240. 2400x240 on Lakka exhibited the same behavior. I will update the bug report (https://github.com/raspberrypi/firmware/issues/1197) with this information. I have also contacted the creator of the HAT (RetroTINK), Mike Chi, with this information should he choose to collaborate in resolving it.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Sat Oct 12, 2019 4:06 pm

The launch Pi 4 firmware didn't take into account the fact that the drive strength registers use a different scale on BCM2711, result in drive strengths that were half what they should have been. This was fixed in firmware released on September 17th.

kelroy
Posts: 9
Joined: Wed May 22, 2019 8:17 pm

Re: DPI displays - dpi24 overlay fails on RPi4

Wed Nov 27, 2019 7:56 pm

PhilE wrote:
Tue Jul 16, 2019 10:11 am
The problem with the dpi24 overlays is that it hangs its pinmux changes to the framebuffer "fb" node. Pi 4 relies on the vc4-fkms-v3d overlay being applied which disables the old framebuffer and any associated pinmux settings.

A fix for this is for the dpi24 overlay to hedge its bets and attach to both the "fb" node and the "vc4" node, one of which should be enabled. You can download an updated overlay to try from here: https://drive.google.com/file/d/14vR6iq ... sp=sharing

Install the update with:

Code: Select all

 sudo cp dpi24.dtbo /boot/overlays
Then remove the "gpio=" workaround (if you added it) and reboot. All being well, and provided "dtparam=audio=off" and "enable_uart=off", your display should work.
Just i was with the same problem, with the pi4 driver and lakka, but with your new dpi24.dtbo it works perfect Phile.

Did you have the source code of this device tree?, to learn what change you made?.

Thanks¡¡

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2656
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Thu Nov 28, 2019 9:19 am

This is now the standard version shipping in all firmwares and Raspbian images. The original looked like this:

Code: Select all

/plugin/;

/{
        compatible = "brcm,bcm2835";

        // There is no DPI driver module, but we need a platform device
        // node (that doesn't already use pinctrl) to hang the pinctrl
        // reference on - leds will do

        [email protected] {
                target = <&fb>;
                __overlay__ {
                        pinctrl-names = "default";
                        pinctrl-0 = <&dpi24_pins>;
                };
        };

        [email protected] {
                target = <&gpio>;
                __overlay__ {
                        dpi24_pins: dpi24_pins {
                                brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11
                                             12 13 14 15 16 17 18 19 20
                                             21 22 23 24 25 26 27>;
                                brcm,function = <6>; /* alt2 */
                                brcm,pull = <0>; /* no pull */
                        };
                };
        };
};
The issue reported is that when the vc4 driver is being used, the bcm2708_fb driver is disabled so it's pinctrl requirements are ignored. The updated version solved the problem like this:

Code: Select all

/dts-v1/;
/plugin/;

/{
        compatible = "brcm,bcm2835";

        // There is no DPI driver module, but we need a platform device
        // node (that doesn't already use pinctrl) to hang the pinctrl
        // reference on - leds will do

        [email protected] {
                target = <&fb>;
                __overlay__ {
                        pinctrl-names = "default";
                        pinctrl-0 = <&dpi24_pins>;
                };
        };

        [email protected] {
                target = <&vc4>;
                __overlay__ {
                        pinctrl-names = "default";
                        pinctrl-0 = <&dpi24_pins>;
                };
        };

        [email protected] {
                target = <&gpio>;
                __overlay__ {
                        dpi24_pins: dpi24_pins {
                                brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11
                                             12 13 14 15 16 17 18 19 20
                                             21 22 23 24 25 26 27>;
                                brcm,function = <6>; /* alt2 */
                                brcm,pull = <0>; /* no pull */
                        };
                };
        };
};
The addition of the vc4 dependency in [email protected] covers both bases. Note that this would fail due to pin contention if ever the fb and vc4 nodes were both enabled at the same time, but fortunately this is never the case.

User avatar
7F20
Posts: 51
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: DPI displays - dpi24 overlay fails on RPi4

Sun Dec 08, 2019 5:14 pm

jamesh wrote:
Wed Jul 31, 2019 8:48 am
Basically the same as my setup.

To me, that looks like a broken line feeding the display, so a particular signal is not getting through? But you say the same display and interface works on other devices?
I had an issue where I was getting a similar problem to the OP (the image displayed using dpi24 exhibited weird shimmering color artifacts and/or outlines) After reading up around the internet, I realized that I had set the dpi_output_format incorrectly. It is possible that others may end up with the same issue by setting that wrong, so I'm adding my experience here in case it comes up. (even though it may be different cause than OP)

NewmedFabio
Posts: 5
Joined: Tue Dec 10, 2019 11:04 am

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Wed Dec 11, 2019 11:39 am

Hello,
I'm trying to set up a 7" touch screen that communicate through DPI (parallel RGB) to a Raspberrry CM3+.
I've updated Raspbian to latest version. I've also verified that provided dpi24.dtbo is identical to the one shared by PhilE on this thread.
I'm using the following config.txt file.

Code: Select all

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on

#[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-fkms-v3d
#max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

######################################################################
# Aggiunto da P.A. per gestione LCD 7"
######################################################################

# Ignora l'hotplug del cavo HDMI per evitare un ritardo all'avvio
hdmi_ignore_hotplug=1

# Disabilita le periferiche SPI e I2C nel bank0
#dtparam=spi=off
tparam=i2c1=on
dtparam=i2c_arm=on

# Inizializza la porta seriale per il debug sui pin GPIO32, GPIO33
#force_turbo=1
#dtoverlay=uart1,txd1_pin=32,rxd1_pin=33

# Attivo la periferica I2C per il touchscreen sui pin GPIO44 e GPIO45
#dtparam=i2c1=on
#dtoverlay=i2c1,sda1_pin=44,scl1_pin=45,pin_func=6
dtoverlay=i2c1,pins_44_45
dtoverlay=goodix-7.btbo

# Abilito la porta DPI per interfacciarmi con il Display
dtoverlay=dpi24
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
#Vertical size display
#framebuffer_width=600
#framebuffer_height=1024
#Horizontal size display
#framebuffer_width=1024
#framebuffer_height=600
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x047027
dpi_timings=1024 0 40 48 88 600 0 13 3 32 0 0 0 60 0 32000000 6
#Rotate display 270 degree
#display_lcd_rotate=3

[all]
dtoverlay=vc4-kms-v3d

Everything is working fine with vc4 and Opengl disabled.
Then, If I enable Opengl (Full kms) in rasp-config, display hangs on boot.

It doesn't show four raspberries, it only shows the welcome screen and freezes there. I can remotely log in with ssh and everything else is working fine, only the display seems to be freezed. I've tried also different config.txt options looking for suggestions in other threads but nothing worked.

So my question is:
Is v4c driver compatibile with dpi24 also in CM3+?
Is this a driver problem or a bad config.txt problem?


Thanks for your support, hope this will help also other folks in my situation.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8115
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Wed Dec 11, 2019 12:19 pm

NewmedFabio wrote:
Wed Dec 11, 2019 11:39 am
So my question is:
Is v4c driver compatibile with dpi24 also in CM3+?
Is this a driver problem or a bad config.txt problem?
Seeing as your query relates to CM3, whilst this thread is about Pi4 (see the title), you would have been better off starting a new thread.

vc4-kms-v3d replaces ALL display configuration that is present in config.txt with kernel configuration.
You need to add device tree configuration and a kernel driver to configure your DPI output. https://github.com/raspberrypi/linux/bl ... verlay.dts is a suitable overlay that configures the Adafruit Kippah with their 800x480 panels.

In that case the panel is defined as being a yx700wv03. https://github.com/raspberrypi/linux/bl ... le.c#L1847 to line 1874, and lines 2531-2, then convert that name into a panel mode.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

NewmedFabio
Posts: 5
Joined: Tue Dec 10, 2019 11:04 am

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Wed Dec 11, 2019 2:06 pm

Thank you very much 6by9.
Sorry for the wrong thread error, I've started a new one here:
https://www.raspberrypi.org/forums/view ... 3#p1579303
I will follow your instructions and post results there.


If I may submit a suggestion, please add information about vc4 ignoring config.txt at the beginning of this:
https://www.raspberrypi.org/documentati ... /README.md

Thanks

User avatar
Laguna
Posts: 4
Joined: Mon Jun 17, 2019 11:44 am

Re: DPI displays - dpi24 overlay fails on RPi4 (SOLVED)

Mon Feb 10, 2020 2:40 pm

Might only be a minor problem but can cause some issues.

Return to “Device Tree”