-
Notifications
You must be signed in to change notification settings - Fork 343
failed assertion on rbp4 with multiple monitors #1943
Comments
https://drmdb.emersion.fr/devices/0f4161ba12dc Note, on |
Okay, interesting. On this platform vc4 advertises a primary plane compatible with multiple CRTCs. Need to check whether this is a vc4 bug. |
Apparently not a driver bug according to #dri-devel. So it's a wlroots bug. |
There can be multiple [1]. [1]: swaywm/wlroots#1943
@emersion https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#plane-abstraction
I'm going to argue that this is a driver bug, and is breaking the userspace API. |
Maybe this means "at least one". |
https://drmdb.emersion.fr/devices/37e47e146687 Same problem over here on the rpi4. |
is this a wlroots bug or a sway bug? is there any workaround? is there any other wayland compositor I can try? |
I tried around a bit, but didn't get it to run anymore (despite that I had it running at some point before posting here): https://i.imgur.com/PrRgT3F.png |
Are you on fkms or "real" kms dtb? |
@Ongy I am on fkms, I don't think that the non fake kms dtb is supposed to run on the pi4.. IIRC, when I tried it, it hung while initializing the framebuffer. |
fkms. I tried manjaro and it load fkms by default. Is should say that with single monitor sway runs amazing. I was so happy that bought a second one and then I got the segfault. 🙄 |
I have a patch that works with 2 displays on a RPI4 ... kind of. Instead of always using the first possible CRTC (defined by the least significant bit set in possible_crtcs), my code is trying all possible CRTCs until it finds one that is not already associated with a plane of the considered kind. That seems to work fine at least for the primary planes. However, I encounter a very strange problem with the mouse cursor. When the cursor is in my second screen, a giant cursor is appearing erratically in the first screen. It does not show in screenshots but here is a photo showing a giant cursor (most of the time they are truncated). I also noticed something strange. At one point, I commented out the assignment of My DRM info is https://drmdb.emersion.fr/devices/01cd892b4221 and it is quite similar toTimB87's with a CRTCs list containing 8 values (2 existing CRTCS and 6 non-existing ones). That seems to be the default behavior on recent Linux 5.x kernels. Also my 2 monitors have different resolutions (1920x1200 vs 1920x1080). @emersion How can I enable the wlroots logging faculties when using sway? |
I just noticed something about the giant cursor. It seems that t appears when the cursor image is changing and it always has the shape of the previous small cursor. That is as if the old cursor texture was reused in a 'magnified overlay'. |
|
@emersion Really? Ho! I see... I tried sway -d but without the redirections and I was not seeing any output from wlroot in the console after exiting sway. I assume that this is because the text console is disabled while sway is running. Very confusing! |
I think that I now understand what is going on. I monitored the CRTC planes activity with
And, when using an X11 desktop, I see that the cursor planes are not associated to the CRTC when the cursor is not visible on that screen. However, Sway is behaving differently and keeps an active cursor plane for each CRTC. As far as I can tell the giant cursor is occurring when an cursor plane is fully out-of-bounds and gets a negative coordinate in either X and Y. Simply speaking, the RPi4 driver has a problem with negative cursor coordinates that are bigger than the cursor dimension (e.g. for a 64x64 cursor, a coordinate of -35 is fine but -65 is not). It is worth noting that the X Y coordinates of out-of-bound cursor planes are only updated when the mouse shape is changed. I can probably get rid of most giant cursors by adding a proper out-of-bound check in the wlroot code in charge of that update. I also figured out that a large negative coordinate can be obtained by moving very quickly from one screen to another. The goal is of course to obtain a first out-of-bound cursor position with a negative coordinate bigger than the cursor plane size. That one is probably a bit more difficult to fix in wlroots without disabling out-of-bound cursor planes. Globally speaking, I think that wlroots should use the same approach than the X11 server: The cursor plane should be disabled when the cursor becomes out-of-bound cursors. That probably makes sense for performance reasons. |
It should already do this: Line 1003 in 751a21d
However the rpi driver shouldn't freak out when userspace sends negative coords. This isn't a wlroots bug (because it's perfectly valid to set negative coords), the rpi driver should be fixed. |
Good. For practical reasons, I was experimenting on the current Ubuntu source package based on 0.10.0 and so without that function. I guess that I will have to recompile Sway & co then :-( Hopefully, that should solve my giant cursor problem and if everything looks fine then I will make a pull request. And I agree that the negative coordinate problem is probably a rpi driver bug. I'll report it. Not sure where exactly. Probably the v3d drm driver. |
I tested my improved DRM plane matching on master and that seems to work fine with 2 monitors on RPi4. |
I was probably a bit optimistic when I wrote that everything was working fine with 2 monitors on the RPi4. Fortunately, WLR_NO_HARDWARE_CURSORS=1 can be used to disable DRM cursor planes. |
Since my pull request is likely to be rejected in favor of a resolution in the Raspberry Pi kernels, here is a simple patch.
And if your cursor is behaving strangely then set WLR_NO_HARDWARE_CURSORS=1 |
This isn't necessarily the case [1]. This should fix an assertion failure on Raspberry Pi 4 dual screen. [1]: https://lists.freedesktop.org/archives/dri-devel/2020-August/275142.html Closes: swaywm#1943 Co-authored-by: Simon Ser <contact@emersion.fr>
This isn't necessarily the case [1]. This should fix an assertion failure on Raspberry Pi 4 dual screen. [1]: https://lists.freedesktop.org/archives/dri-devel/2020-August/275142.html Closes: swaywm#1943 Co-authored-by: Simon Ser <contact@emersion.fr>
This isn't necessarily the case [1]. This should fix an assertion failure on Raspberry Pi 4 dual screen. [1]: https://lists.freedesktop.org/archives/dri-devel/2020-August/275142.html Closes: swaywm#1943 Co-authored-by: Simon Ser <contact@emersion.fr>
This isn't necessarily the case [1]. This should fix an assertion failure on Raspberry Pi 4 dual screen. [1]: https://lists.freedesktop.org/archives/dri-devel/2020-August/275142.html Closes: #1943 Co-authored-by: Simon Ser <contact@emersion.fr>
I'm hitting an assertion on a Raspberry Pi 4 with two monitors (archlinuxarm)
Sway Version:
1.2
(also tried buildingsway
andwlroots
fromgit
)Debug Log:
Reproducible with no (default) config file.
The text was updated successfully, but these errors were encountered: