raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/
Other
11.07k stars 4.97k forks source link

Bookworm lite with official 7" display display regression #6082

Open maru-sama opened 6 months ago

maru-sama commented 6 months ago

Describe the bug

Similar to #6078 after upgrading the kernel from 6.1.0-rpi8 to 6.6.20 the display on the official touchscreen display does not look as good as before. It looks like the display is using bgr instead of rgb and you see colored pixels around text. Reverting back to a 6.1 kernel keeping everything else the same fixes the issue

As with the other bug the following error is shown during boot with the 6.6.20 kernel

[ 10.256352] vc4-drm gpu: bound fe700000.dsi (ops vc4_dsi_ops [vc4])
[ 11.460987] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[ 11.460998] vc4_dsi fe700000.dsi: instat: 0x00000000
[ 11.461005] [drm:vc4_dsi_host_transfer [vc4]] ERROR DSI transfer failed, resetting: -110
[ 11.676979] tc358762 fe700000.dsi.0: error initializing bridge (-110)

This does not happen with the 6.1 kernel.

Steps to reproduce the behaviour

Install the 6.6.20 kernel and reboot.

Device (s)

Raspberry Pi 4 Mod. B

System

Raspberry Pi reference 2016-03-18 Generated using Pi-gen, https://github.com/RPi-Distro/Pi-gen, stage2

Feb 29 2024 12:24:53 Copyright (c) 2012 Broadcom version f4e2138c2adc8f3a92a3a65939e458f11d7298ba (clean) (release) (start)

Logs

No response

Additional context

No response

maru-sama commented 6 months ago

I tried taking a picture but you do not see the issue there, since the camera is not picking up the wrong colored pixels. The middle line of a lowercase "m" shows redish pixels on one side for example.

maru-sama commented 6 months ago

If I take screenshot from the console directly via cat /dev/fb0 it also looks correct, while it looks wrong on the display.

Drexel2k commented 5 months ago

I have the same problem with the touch display on my Raspberry 4 B. Since the last update I have very often the problem, that the display turns white before or after the rainbow screen or after the Raspberry splash screen. The Raspberry still boots up and works, I have a Radio app to autostart and the radio starts playing.

I am pretty sure it has to do with one of the latest Raspberry OS updates or drivers, because it happens since I updated to 2024-03-15-raspios-bookworm-arm64. I reinstalled the Raspberry with 2023-12-05-raspios-bookworm-arm64 and the problem was gone. Upgrade to 2024-03-15-raspios-bookworm-arm64 again and the problem is there again on first boot.

After the Raspberry splash screen I can also see for a short moment the following messages:

[ 4.447114] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[ 4.447129] vc4_dsi fe700000.dsi: instat: 0x00000000
[ 4.447140] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[ 4.663103] tc358762 fe700000.dsi.0: error initializing bridge (-110)

I don't have this messages with 2023-12-05-raspios-bookworm-arm64.

I can also try it with 2024-03-12-raspios-bookworm-arm64 this week, because I am waiting for an USB stick delivery which want to use as boot device then.

Drexel2k commented 5 months ago

Have a look here: https://forums.raspberrypi.com/viewtopic.php?p=2210680

There is also a workaround to install pre release firmware with sudo rpi-update, at least that seemed to fix it for me.

maru-sama commented 5 months ago

I currently cannota look at the screen but I still see the error messages in the logs after updating and running with the new firmware and kernel..

[    0.044515] platform fe101000.cprman: Fixed dependency cycle(s) with /soc/dsi@7e700000
[    0.046978] platform fe101000.cprman: Fixed dependency cycle(s) with /soc/dsi@7e700000
[    0.047089] platform fe700000.dsi: Fixed dependency cycle(s) with /soc/dsi@7e700000/bridge@0
[    0.047140] platform fe700000.dsi: Fixed dependency cycle(s) with /soc/cprman@7e101000
[   10.377284] vc4_dsi fe700000.dsi: Fixed dependency cycle(s) with /soc/dsi@7e700000/bridge@0
[   10.377433] platform 100000001.panel_disp: Fixed dependency cycle(s) with /soc/dsi@7e700000/bridge@0
[   10.377536] mipi-dsi fe700000.dsi.0: Fixed dependency cycle(s) with /soc/dsi@7e700000
[   10.377638] mipi-dsi fe700000.dsi.0: Fixed dependency cycle(s) with /panel_disp@1
[   10.972445] vc4-drm gpu: bound fe700000.dsi (ops vc4_dsi_ops [vc4])
[   13.676899] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[   13.676914] vc4_dsi fe700000.dsi: instat: 0x00000000
[   13.676924] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[   13.796897] tc358762 fe700000.dsi.0: error initializing bridge (-110)
Drexel2k commented 5 months ago

OK the problem is not fully gone for me, today I got a white screen during boot again. But it is reduced drastically in comparison to before I've done sudo rpi-update...

spockfish commented 5 months ago

I can confirm I'm seeing this on a Pi 3 as well.

panther-sh commented 5 months ago

I have exactly the same problem on a Pi 4 B with the official 7" touchscreen and the latest Raspberry Pi OS (bookworm 64-bit, March 15th 2024).

dylanhillier commented 5 months ago

I'm also experiencing what i believe to be the same issue described here. I have a Pi 4B, official 7" display. Running: Linux raspberrypi 6.6.28 I also noticed if i try to rotate the screen lcd_rotate=2, the screen is correctly rotated for half the boot sequence, then the screen flashes and goes back to the original orientation and sometimes the screen goes white then fades to black.

The error i get is the same as mentioned above:

[   11.396109] input: 10-0038 generic ft5x06 (00) as /devices/platform/soc/fe205000.i2c/i2c-22/i2c-10/10-0038/input/input4
[   21.470803] vc4_dsi fe700000.dsi: transfer interrupt wait timeout after 10s
[   21.470823] vc4_dsi fe700000.dsi: instat: 0x00000000
[   21.470836] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[   21.578810] tc358762 fe700000.dsi.0: error initializing bridge (-110)
[   21.582128] Console: switching to colour frame buffer device 100x30
[   21.595604] vc4-drm gpu: [drm] fb0: vc4drmfb frame buffer device

You will however note that my error message is a bit different: [ 21.470803] vc4_dsi fe700000.dsi: transfer interrupt wait timeout after 10s

This is because i tried to fix the problem by building a custom kernel/modules with a 10s timeout to see if it was just the timeout too short. This makes no difference at all. I.E, the interrupt is not firing.

6by9 commented 5 months ago

There have been a number of improvements to the DSI and 7inch panel support merged via #6094.

Normal warnings apply over using rpi-update, but retesting using the latest kernel obtained via sudo rpi-update rpi-6.6.y would be appreciated.

dylanhillier commented 5 months ago

Thanks 6by9, i have upgraded and it would appear i no longer see the *ERROR* DSI transfer failed, resetting: -110 issue as shown below. However, i am still unable to rotate my official 7" DSI screen. Any insight into how to get it to work correctly would very much appreciated.

uname -a
Linux raspberrypi 6.6.29-v8+ #1 SMP PREEMPT Wed May  1 10:09:17 UTC 2024 aarch64 GNU/Linux
vcgencmd version
Apr 17 2024 17:27:09
Copyright (c) 2012 Broadcom
version 86ccc427f35fdc604edc511881cdf579df945fb4 (clean) (release) (start)
dmesg | egrep -i "(vc4|dsi|error)"
[    0.048363] platform fe101000.cprman: Fixed dependency cycle(s) with /soc/dsi@7e700000
[    0.051005] platform fe101000.cprman: Fixed dependency cycle(s) with /soc/dsi@7e700000
[    0.051089] platform fe700000.dsi: Fixed dependency cycle(s) with /soc/dsi@7e700000/bridge@0
[    0.051120] platform fe700000.dsi: Fixed dependency cycle(s) with /soc/cprman@7e101000
[    9.319113] vc4_dsi fe700000.dsi: Fixed dependency cycle(s) with /soc/dsi@7e700000/bridge@0
[    9.319269] platform 100000001.panel_disp: Fixed dependency cycle(s) with /soc/dsi@7e700000/bridge@0
[    9.319398] mipi-dsi fe700000.dsi.0: Fixed dependency cycle(s) with /soc/dsi@7e700000
[    9.319528] mipi-dsi fe700000.dsi.0: Fixed dependency cycle(s) with /panel_disp@1
[   10.371109] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[   10.384233] rc rc0: vc4-hdmi-0 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[   10.384444] input: vc4-hdmi-0 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input13
[   10.391156] input: vc4-hdmi-0 HDMI Jack as /devices/platform/soc/fef00700.hdmi/sound/card1/input14
[   10.399600] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops [vc4])
[   10.458976] rc rc1: vc4-hdmi-1 as /devices/platform/soc/fef05700.hdmi/rc/rc1
[   10.459270] input: vc4-hdmi-1 as /devices/platform/soc/fef05700.hdmi/rc/rc1/input15
[   10.558151] input: vc4-hdmi-1 HDMI Jack as /devices/platform/soc/fef05700.hdmi/sound/card2/input16
[   10.736178] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops [vc4])
[   10.737332] vc4-drm gpu: bound fe700000.dsi (ops vc4_dsi_ops [vc4])
[   10.737687] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops [vc4])
[   10.737974] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.738289] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.738548] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.738987] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.742487] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops [vc4])
[   10.765356] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 1
[   11.179407] vc4-drm gpu: [drm] fb0: vc4drmfb frame buffer device
maru-sama commented 5 months ago

@dylanhillier To rotate the screen you have do it via the cmdline.

video=DSI-1:800x480-16@60,rotate=180
dylanhillier commented 5 months ago

OMFG the penny just dropped re-screen rotation. Thanks maru-sama for sharing your working config. I have seen quite a few online but none ever worked for me.

I had been using:

/boot/firmware/cmdline.txt

console=serial0,115200 console=tty1 root=PARTUUID=f39a1659-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=GB
video=DSI-1:800x480-16@60,rotate=180

I thought the parser for the config.txt was the same as the one for cmdline.txt which lead me to believe i can just put key-value pairs on new lines and things would be sweet. :(

Turns out if you put them all on the same line it works..lol.

/boot/firmware/cmdline.txt

console=serial0,115200 console=tty1 root=PARTUUID=f39a1659-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles cfg80211.ieee80211_regdom=GB video=DSI-1:800x480-16@60,rotate=180

Although, i am still seeing some funny business:

  1. on initial boot: a. the first line of text printed is the wrong way around. b. The pi splash screen is upside down and the loading text is also upside down. c. When the plash disappears the terminal is the correct way around (rotated 180d). d. With the pi splash disabled on boot, half the boot sequence is unrotated, and the other half is rotated.

If i add the overlay to invert the touchscreen x and y, when i startx where i touch is correct but the mouse pointer is still non-inverted.

My /boot/firmware/config.txt for reference:

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

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

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

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

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
# display_auto_detect=1  <<--- disabled to allow touch screen to be inverted.

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Enable rotation of the touch input
dtoverlay=vc4-kms-dsi-7inch,invx,invy

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
# disable_fw_kms_setup=1   <------ disabled to allow video= settings from cmdline.txt to rotate display.

# Run in 64-bit mode
arm_64bit=1

# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]
maru-sama commented 5 months ago

Hello,

I can confirm that the latest test version works fine. No error messages and the display is also ok.

rafael2k commented 4 months ago

Which kernel version is known to work? I still get this issue of the display sometimes not being properly initialized with kernel 6.6.

rafael2k commented 4 months ago

Here with Raspberry Pi 4 (in the Pi 5 I don't see the issue), I have the problem: 6.6.28+rpt-rpi-v8

rafael2k commented 4 months ago

Even when the display does work, I get the following message:

[    3.871128] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[    3.871146] vc4_dsi fe700000.dsi: instat: 0x00000000
[    3.871158] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[    4.087113] tc358762 fe700000.dsi.0: error initializing bridge (-110)
rafael2k commented 4 months ago

When the display does not work, I get:

[    2.516500] Console: switching to colour dummy device 80x25
[    2.554588] vc4-drm gpu: bound fe400000.hvs (ops vc4_hvs_ops [vc4])
[    2.556416] Registered IR keymap rc-cec
[    2.556621] rc rc0: vc4-hdmi-0 as /devices/platform/soc/fef00700.hdmi/rc/rc0
[    2.556816] input: vc4-hdmi-0 as /devices/platform/soc/fef00700.hdmi/rc/rc0/input0
[    2.557963] vc4_hdmi fef00700.hdmi: 'dmas' DT property is missing or empty, no HDMI audio
[    2.558016] vc4-drm gpu: bound fef00700.hdmi (ops vc4_hdmi_ops [vc4])
[    2.562232] Registered IR keymap rc-cec
[    2.562436] rc rc1: vc4-hdmi-1 as /devices/platform/soc/fef05700.hdmi/rc/rc1
[    2.562631] input: vc4-hdmi-1 as /devices/platform/soc/fef05700.hdmi/rc/rc1/input1
[    2.563156] vc4_hdmi fef05700.hdmi: 'dmas' DT property is missing or empty, no HDMI audio
[    2.563201] vc4-drm gpu: bound fef05700.hdmi (ops vc4_hdmi_ops [vc4])
[    2.564326] vc4-drm gpu: bound fe700000.dsi (ops vc4_dsi_ops [vc4])
[    2.564745] vc4-drm gpu: bound fe004000.txp (ops vc4_txp_ops [vc4])
[    2.565093] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops [vc4])
[    2.567770] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops [vc4])
[    2.568199] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops [vc4])
[    2.568415] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops [vc4])
[    2.568735] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops [vc4])
[    2.573399] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 1
[    3.870689] vc4_dsi fe700000.dsi: transfer interrupt wait timeout
[    3.870705] vc4_dsi fe700000.dsi: instat: 0x00000000
[    3.870715] [drm:vc4_dsi_host_transfer [vc4]] *ERROR* DSI transfer failed, resetting: -110
[    4.086689] tc358762 fe700000.dsi.0: error initializing bridge (-110)
[    4.089361] Console: switching to colour frame buffer device 100x30
[    4.138737] vc4-drm gpu: [drm] fb0: vc4drmfb frame buffer device
rafael2k commented 4 months ago

So, it seems kernel 6.6.30-v8+ fixes the issue for me. Could anyone help me find the commit which fixed the regression (and may be the regression itself)?

6by9 commented 4 months ago

6094

rafael2k commented 4 months ago

Thanks! I'll pin 6.6.30 in the production systems I have.