agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
544 stars 416 forks source link

Raspberry Pi 7inch Display + KMS are displaying black/white bars #1371

Open ykuzma1 opened 1 month ago

ykuzma1 commented 1 month ago

Description The official Raspberry Pi 7 inch display consistently shows black and white bars after boot when using the KMS graphics driver. The HDMI display does show the correct output however. Pictures attached.

Steps to reproduce the issue:

MACHINE = "raspberrypi4"
DISTRO = "poky"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
ENABLE_UART = "1"
IMAGE_INSTALL:append = " kmscube"
LICENSE_FLAGS_ACCEPTED += "synaptics-killswitch"
bitbake core-image-base

Describe the results you received: The RPi 7in display does initially show the rainbow screen and four raspberry graphics, but then immediately fades out to black and white bars. The HDMI display shows the rainbow and raspberry graphics like the RPi display but boots to a visible console and can launch kmscube successfully.

Describe the results you expected: console and kmscube working on the RPi 7in display.

Additional information you deem important (e.g. issue happens only occasionally):

Additional details (revisions used, host distro, etc.):

Let me know if I can provide any logs or can attempt any other debugging steps because I'm running out of ideas.

PXL_20240924_152128629 MP PXL_20240924_163337655 MP

ykuzma1 commented 1 month ago

I just realized this may be a continuation of closed issue https://github.com/agherzan/meta-raspberrypi/issues/802. Let me know if you'd rather move this discussion there and reopen that issue.

bojanmilevski commented 3 weeks ago

I am experiencing the exact same issue.

Upgrading kernel to 6.6.51 does not help - neither does downgrading to 6.1.77.

bojanmilevski commented 3 weeks ago

After many hours of debugging, I have came to the conclusion that setting INIT_MANAGER = "mdev-busybox" was the root of the problem. Once I changed it to systemd and added kernel-modules to IMAGE_INSTALL in my image recipe, the problem was gone.

I installed weston and was surprised for it to auto-start.

I hope this information is relevant and helpful.

bojanmilevski commented 3 weeks ago

It's important to note that I am on each layer's master branch (poky and meta-raspberrypi).

ykuzma1 commented 3 weeks ago

@bojanmilevski I was unable to get the problem resolved by adding INIT_MANAGER = systemd and IMAGE_INSTALL:append = " kernel-modules". Would you mind sharing the rest of your local.conf?

bojanmilevski commented 3 weeks ago

After having spent a couple more hours, I can confirm that adding dtoverlay=vc4-kms-dsi-7inch to config.txt, as well as the steps above, works.

Another note to mention - I tried switching back to the scarthgap branch on both layers, and can confirm that everything works as normal, so no need to switch to master

ykuzma1 commented 3 weeks ago

@bojanmilevski I can confirm that worked on my end as well! Thank you!!

Here is a minimal working example local.conf:

MACHINE = "raspberrypi4"
DISTRO = "poky"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
ENABLE_UART = "1"
DISTRO_FEATURES += "opengl pam wayland"
INIT_MANAGER = "systemd"
IMAGE_INSTALL:append = " kmscube kernel-modules"
LICENSE_FLAGS_ACCEPTED += "synaptics-killswitch"
RPI_EXTRA_CONFIG = "dtoverlay=vc4-kms-dsi-7inch\n"
ykuzma1 commented 3 weeks ago

Initial testing on a Raspberry Pi 5 continues to not show anything on the RPi display or illuminate the backlight with both KMS and FKMS drivers. Which indicates that may be a different issue altogether. I will do more testing and follow-up with a new issue if necessary.

bojanmilevski commented 3 weeks ago

Sorry, I forgot to mention that I was testing this on a RPi4B with 8GB of memory. I am unable to assist you with the RPi5.

ykuzma1 commented 2 weeks ago

No problem @bojanmilevski. I moved discussion regarding the RPi5 to its own issue tracker #1382. Thanks again for your help on this issue.