-
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
Garbled screen when running an OpenGLESv2 app on X11 and fkms without compositor with 5.4 kernel #3665
Comments
Can you provide the output of Sorry, I'm not going to decode that code for how/where you get the pixels from. Is that totally from reverse engineering, or have you based that on some doc? |
The output from vcgencmd dispmanx_list: The output from sudo cat /sys/kernel/debug/dri/1/state:
|
It is totally from looking at the screen and trying to understand how the bits are mixed up. The gist is that all pixels are there, they are just in the wrong location. |
Does this happen at all display resolutions e.g 1024x768 ? |
Thanks. There was a patch for mesa that made sure that it chose an appropriate output format for the rendering pipe - I wondering if something in that path has gone wrong, but don't know enough of how that is configured. Trying to clone your repo fails - it looks like it's set as a private repo. |
I just tried without credentials with |
It happens at 1920x1080 and 1280x720 and I just checked 1024x768 and it happens there as well. |
Original post
Gitlab != Github |
You are absolutely right. I am very sorry.
When using an OpenGL app on X11 with fkms, I would expect two planes at the HVS level with both planes showing up in |
What second plane are you expecting? Within X you'll have the desktop (as primary) and cursor planes active. If your app takes over fullscreen, then X is replaced in using the primary plane. |
You are probably right. I took mesa from git, commented out the line |
When removing |
Oh poot! Where did that come from? No, none of the rendering pipeline supports UIF, only the 3D block (which uses it nearly exclusively). None of the DRM components should be advertising it as a format. As to how it worked on 4.19 I have no idea. I suspect it is to do with this being advertised through 3D can render to linear buffers with minimal performance overhead, so it should be fine. The only niggle is when reconsuming the current frame to create the next as it has to convert the current frame to UIF first. Thanks for investigating this - I'll create a PR in a few minutes. |
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. raspberrypi#3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…mat_mod_supported See: raspberrypi/linux#3665 kernel: ARM: dts: Add UART skip-init properties for U-boot See: raspberrypi/linux#3731 See: https://lists.denx.de/pipermail/u-boot/2017-April/285606.html
…mat_mod_supported See: raspberrypi/linux#3665 kernel: ARM: dts: Add UART skip-init properties for U-boot See: raspberrypi/linux#3731 See: https://lists.denx.de/pipermail/u-boot/2017-April/285606.html
rpi-update kernel should now have this fix |
I can confirm that after |
Ok this is weird but I am experiencing this garbled screen issue with the vc4-kms-v3d driver as well. It is happening on RetroArch when I turn vsync off and using X11. Not sure if it happens in DRM too, I will have to check later. This happened on a clean install of RPiOS 32bit that was fully updated via apt. I have a Pi 4 4GB. |
vc4-kms-v3d on Pi4 is still in the early stages - expect issues. |
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. raspberrypi#3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. raspberrypi#3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. raspberrypi#3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. raspberrypi#3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
Hi, folks. I've run into my Xorg.log being aggressively spammed with messages like:
and analyzed that the log spam has introduced by the fix of this issue. Filed a bug for Mesa. Please join the discussion. Could you please tell if you also experiencing logs spamming? |
P.S.: also it seems the fix breaks rainbow square logo to be shown on boot of Raspberry Pi |
Yes, I see the exact same sequence of messages at each page flip at a rate of 10Kbyte/s in /var/log/Xorg.0.log |
Breaks in what way? |
Double checked again and definitely I was wrong about rainbow square logo is broken with the commit. |
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
…_supported FKMS was listing UIF in the supported modifiers from format_mod_supported when actually the pipeline doesn't support it. X was then choosing to use it, and that then failed to render. Remove references to UIF. #3665 Signed-off-by: Dave Stevenson <[email protected]>
@6by9 @popcornmix @itoral @infapi00 @txenoo This issue is still reproducible with a fullscreen OpenGL (vsync enabled) application using X11, with or without the compositor enabled, using 5.10.7 kernel + the KMS video and audio driver (vc4-kms-v3d), and the latest MESA drivers built from upstream that include Vulkan on the Pi4. Disabling vsync in the OpenGL application will fix this issue. I've been using vkQuake3 to reproduce the issue this morning but I've seen this exact issue happen in RetroArch as well when using the OpenGL renderer. I built vkQuake3 with the following - This garbled screen issue does not occur with Vulkan at all. |
@bluestang2006 are you sure you are seeing this issue? I suspect you are seeing an unrelated issue and should probably create a new issue. |
Let me clarify:
KMS/DRM is not affected by this. This is exclusive to X11 and the dtoverlay=vc4-kms-v3d driver, at least from what I've seen thus far.
If this needs to be opened up as a separate issue, I am happy to do so. My initial thought was that these issues were related because of the screen behavior. Once the firmware appears in rpi-update I will try it out. |
With the latest kernel, this issue still persists as described in my last post. |
I've had a look. I can reproduce with neverball when set to full screen with vsync disabled. kms has a slightly different code path to fkms, but it doesn't have the original bug of fkms. However
|
2 things:
|
Describe the bug
This has been discussed in raspberrypi/firmware#1382 in a follow up to an unrelated camera issue. I now have more precise steps to reproduce the problem. It happens only when using kernel 5.4 (it does happen with the latest 32bit image when you rpi-update to the 5.4 kernel) and fkms and X11 without lightdm (or with lightdm but with the compositor disabled) with a fullscreen Xwindow and with vsync enabled (via eglSwapInterval (display, 1)).
To reproduce
Start from the 64bit image from https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2020-05-28/2020-05-27-raspios-buster-arm64.zip
Boot the image, it will boot to the desktop.
In a terminal or via ssh enter (this fixes the raspberrypi-dev package):
At this point you should probably reboot.
In a terminal or via ssh enter:
EDIT: fixed the link to the git repository above
The application will show a red rectangle on a background that cycles between green and blue.
In a terminal or via ssh enter (this will disable lightdm):
sudo systemctl set-default multi-user.target
Reboot. The pi will now boot to a console.
In the console or via ssh enter:
sudo xinit &
This will start plain X11 without a desktop manager and it will open an xterm.
In xterm or via ssh enter:
The application will show a garbled red rectangle.
Edit opengltest.c and change
eglSwapInterval (mEGLDisplay, 1);
toeglSwapInterval (mEGLDisplay, 0);
(this will disable vsync).In xterm or via ssh enter:
Now the rectangle is ok again.
Expected behaviour
I expect a red rectangle on a background that cycles between green and blue.
Actual behaviour
The red rectangle is garbled
System
Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
Which model of Raspberry Pi?
Pi4B 8GB
Which OS and version (
cat /etc/rpi-issue
)?Raspberry Pi reference 2020-05-27 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 825107f04027269db77426046f5085475b1ea22f, stage4
Which firmware version (
vcgencmd version
)?Jun 1 2020 13:23:40 Copyright (c) 2012 Broadcom version 6379679d1ec6a8c746d7e77e015f5b56b939976f (clean) (release) (start)
Which kernel version (
uname -a
)?Linux hjdevpi 5.4.44-v7l+ £1320 SMP Wed Jun 3 16:13:10 BST 2020 armv7l GNU/Linux
Logs
Additional context
The problem occurs with both 32bits and 64 bits versions of Raspberry Pi OS.
The problem occurs only for kernel 5.4, not for kernel 4.19.
The problem occurs when using fkms.
The problem occurs when using openglesv2, with egl, with X11, but only when xcompmgr is disabled.
The problem occurs only when vsync is enabled with eglSwapInterval (mEGLDisplay, 1) and not when it is disabled with eglSwapInterval (mEGLDisplay, 0).
The problem occurs only for a fullscreen window.
The 'garbling' is an 'invertible' operation. When I display a full screen picture that has been pre-processed with the following code, it looks ok on the screen.
The text was updated successfully, but these errors were encountered: