Skip to content
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

wayland/core: move to new impl #6268

Merged
merged 2 commits into from
Jun 8, 2024
Merged

wayland/core: move to new impl #6268

merged 2 commits into from
Jun 8, 2024

Conversation

vaxerski
Copy link
Member

@vaxerski vaxerski commented May 27, 2024

It's the final countdown!

This MR moves the last parts of wayland over to Hyprland. After this is done, I'll focus on some cleanups for 1-2 weeks, then get onto the last bits of wlroots to be rewritten (backend)

TODO:

  • wl_shm
  • wl_compositor
  • wl_buffer
  • wl_subcompositor
  • wp_viewporter
  • mesa drm
  • linux_dmabuf
  • Testing
  • Nix
  • Meson

Bugs:

  • shm seems to update oddly? (only tested with qt)
  • shm issues with release timings
  • foot won't show up
  • rendering bugs: chromium
  • ff/gtk won't open
  • fuzzel crashes
  • ff dt issues
  • linux_dmabuf buffers won't pass through egl
  • add more error checking for linux_dma
  • dmabuf vram memory issues while resizing e.g. kitty
  • viewporter issues in chromium

@vaxerski vaxerski force-pushed the wayland-rewrite branch 2 times, most recently from 73f828b to dc9fe87 Compare May 27, 2024 20:41
@rtgiskard
Copy link
Contributor

Maybe add cpp modules?

@vaxerski
Copy link
Member Author

no

@vaxerski vaxerski force-pushed the wayland-rewrite branch 4 times, most recently from d56e433 to f6c8126 Compare May 28, 2024 20:43
@The-Briel-Deal
Copy link
Contributor

The-Briel-Deal commented May 29, 2024

Hey Vaxry, feel free to do whatever you like but is there a reason for the frequent force pushes on these large PR's? I love force pushes as much as the next guy but it makes it very hard to bisect for a bug when there is no commit history and its a 5000 line pr?

I've been trying to fix #6159 for a few days now and some sort of commit history on this wlroots rewrite pr (which was where gamescope broke) would help so much. Reflogs last in git for 90 days by default, is there any chance you could zip/tar your .git/logs folder so that I have something to bisect through to figure out what caused the issue?

Thanks for your hard work Vaxry! This issue has just been really bothering me for the last week and I really wanna get it fixed.

@vaxerski
Copy link
Member Author

vaxerski commented May 29, 2024

the reason is I rebase instead of squash when merging for these and thus want to keep commits to a few

is there any chance you could zip/tar your .git/logs folder so that I have something to bisect through to figure out what caused the issue?

I don't have access to my desktop rn. You can always manually click on a few commits and g reset --hard. They are not gone

@vaxerski
Copy link
Member Author

If anyone wants to help, you can already test this MR, most stuff should work (outside of the unticked bugs above)

with firefox, it would be nice if someone could find what differs in the WAYLAND_DEBUG output between hyprland main (or sway) and this rewrite. I can't seem to get kdiff to work on my laptop and doing it by eye is painful

if any other bugs arose from this MR, let me know, I'll try to repro and fix.

@vaxerski
Copy link
Member Author

20240527_123436.jpg

cheers from the mountains fam :)

@Honkazel
Copy link

If anyone wants to help, you can already test this MR

image
It doesn't even build

@vaxerski
Copy link
Member Author

hyprwayland-scanner-git needed

@Honkazel
Copy link

hyprwayland-scanner-git needed

FAILED: CMakeFiles/Hyprland.dir/src/render/Renderer.cpp.o 
/usr/bin/c++ -DHAS_EXECINFO -DHyprland_EXPORTS -DUSES_SYSTEMD -DWLR_USE_UNSTABLE -I/home/goose/srcmk/Hyprland/. -I/home/goose/srcmk/Hyprland/src -I/home/goose/srcmk/Hyprland/subprojects/wlroots-hyprland/include -I/home/goose/srcmk/Hyprland/subprojects/wlroots-hyprland/build/include -I/home/goose/srcmk/Hyprland/subprojects/udis86 -I/home/goose/srcmk/Hyprland/protocols -I/home/goose/srcmk/Hyprland/subprojects/udis86/libudis86 -isystem /usr/include/uuid -isystem /usr/include/pango-1.0 -isystem /usr/include/cairo -isystem /usr/include/glib-2.0 -isystem /usr/lib64/glib-2.0/include -isystem /usr/include/harfbuzz -isystem /usr/include/freetype2 -isystem /usr/include/pixman-1 -isystem /usr/include/libdrm -isystem /usr/include/libxml2 -isystem /usr/include/libpng16 -isystem /usr/include/libmount -isystem /usr/include/blkid -isystem /usr/include/sysprof-6 -isystem /usr/include/fribidi -O3 -DNDEBUG -std=gnu++23 -O3 -Wall -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith -fmacro-prefix-map=/home/goose/srcmk/Hyprland/= -DWITH_GZFILEOP -pthread -Winvalid-pch -include /home/goose/srcmk/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx -MD -MT CMakeFiles/Hyprland.dir/src/render/Renderer.cpp.o -MF CMakeFiles/Hyprland.dir/src/render/Renderer.cpp.o.d -o CMakeFiles/Hyprland.dir/src/render/Renderer.cpp.o -c /home/goose/srcmk/Hyprland/src/render/Renderer.cpp
/home/goose/srcmk/Hyprland/src/render/Renderer.cpp:3:10: fatal error: linux-dmabuf-unstable-v1-protocol.h: No such file or directory
    3 | #include "linux-dmabuf-unstable-v1-protocol.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[202/252] Building CXX object CMakeFiles/Hyprland.dir/src/render/OpenGL.cpp.o
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:15: release] Error 1
make[1]: Leaving directory '/home/goose/srcmk/Hyprland'
make: *** [Makefile:34: all] Error 2

@vaxerski
Copy link
Member Author

ah uh oops heh you can remove that include. I'll nuke it when I am on my laptop

@VirtCode
Copy link
Contributor

Aside from firefox not showing anything, wofi crashes for me after typing two letters. It also shows this warning right before the crash:

(wofi:41120): Gdk-WARNING **: 18:30:33.506: (../gtk/gdk/wayland/gdkwindow-wayland.c:918):buffer_release_callback: runtime check failed: (impl->staging_cairo_surface != cairo_surface)
wofi: ../cairo/src/cairo-surface.c:938: cairo_surface_reference: Assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&surface->ref_count)' failed.
Aborted (core dumped)

Here's the coredump info (not sure whether that helps though): wofi-coredump.txt

Also, it currently doesn't build for me with meson, probably because of the missing quote there:

image

@vaxerski
Copy link
Member Author

lmfao oops

@ettancos
Copy link

ettancos commented Jun 8, 2024

Sorry, I had another crash related to PrimarySelection, this time right after waking up from suspend.
gdb.txt.gz

33bddac with latest hw-s
fyi I can't test today anymore, maybe in the evening

edit: after cleaning up all the asan deps and rebuilding clean its not clear if i can reproduce, I won't have my external monitor until the evening to test after unplugging, probably not worth delaying we can fix it later if there is still anything

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

I'll merge this, if it still happens open up a ticket with an ASan trace.

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

Thanks everyone!

@vaxerski vaxerski merged commit 6967a31 into main Jun 8, 2024
19 checks passed
@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

heh on drm and release I also get the viewporter bug. Not on nested. I love programming

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

uhhh... I think there is something wrong with handling the buffers now that I am running it for a bit longer... :(

I've launched minecraft and I am getting nvidia experience'd with black flashing

@VirtCode
Copy link
Contributor

VirtCode commented Jun 8, 2024

hmm, minecraft works normally for me (on intel), in both fullscreen and tiled

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

20240608_124531.mp4

@VirtCode
Copy link
Contributor

VirtCode commented Jun 8, 2024

okay nvm, ran the wrong build,
can also reproduce it on intel

maybe it has something to do with glfw? both mc and kitty use that IIRC

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

it could - but it still happens only here

me rn

reeeeee.mp4

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

launched cs2, (SDL on X11) and no flickers are to be seen

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

what else uses glfw so I can do some testing?

@VirtCode
Copy link
Contributor

VirtCode commented Jun 8, 2024

i am also struggling to find good examples. basically everything made with lwjgl would be, but i don't have any other such games besides minecraft

I tried to run the official glfw examples (in their repo), and don't see any issue with them, but i also don't know whether they use all the features a normal program/game would

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

likely an issue with the interaction with glfw with the EGL mode as a backend, so kitty and minecraft fall into the category as they both use opengl

@VirtCode
Copy link
Contributor

VirtCode commented Jun 8, 2024

I think the issues with minecraft might be caused due to it running through xwayland. If i run the same version on native wayland (by using system glfw with -Dorg.lwjgl.glfw.libname=/usr/lib/libglfw.so), it runs fine for me without the stutters and black frames.

I tested with as vanilla a game as possible, so I'm using the official launcher (and bundled jre), with vanilla 1.20.4. My system glfw is that from the arch repos. Testing still has been a bit flakey with it sometimes refusing to start after adding the flag, but rebooting fixed most of that (a full reboot is probably not necessary, but I don't know where the issue is there)

However, it working through xwayland should still be supported because i think older versions require other versions of glfw which may not have a wayland patch.

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

it still is a regression from this MR, so I would guess I did some no-no with implicit sync somewhere.

@VirtCode
Copy link
Contributor

VirtCode commented Jun 8, 2024

yes, but that probably means that the issue isn't glfw but something else in the case of mc if I am not mistaken

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

chromium stretching popups fixed on main

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

nhekobug.mp4

@VirtCode you seein this shit too on intel? that's nheko

@VirtCode
Copy link
Contributor

VirtCode commented Jun 8, 2024

doesn't seem to happen for me neither on wayland nor xwayland

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

I have a patch ready. I'll just do some more testing

@vaxerski
Copy link
Member Author

vaxerski commented Jun 8, 2024

FIXED! 9994b73

@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented Jun 9, 2024

9994b73 also fixed the default mpv --vo=gpu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.