Bug 247056 - graphics/mesa-dri regression: no more vulkan support on wayland
Summary: graphics/mesa-dri regression: no more vulkan support on wayland
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Emmanuel Vadot
Depends on:
Reported: 2020-06-07 17:16 UTC by shamaz.mazum
Modified: 2020-06-10 03:51 UTC (History)
1 user (show)

See Also:
linimon: maintainer-feedback? (x11)


Note You need to log in before you can comment on or make changes to this bug.
Description shamaz.mazum 2020-06-07 17:16:28 UTC
After the commit with a message "mesa*: Add platforms option" (I use git repository hosted on github.com/freebsd/freebsd, it is the commit 25466cc) I can no longer use Vulkan applications (like vkquake) on Wayland:

QUAKE ERROR: Couldn't create window: Installed Vulkan doesn't implement the VK_KHR_wayland_surfaceextension

My port options are all set with exception of VDPAU.
Comment 1 commit-hook freebsd_committer 2020-06-08 10:49:50 UTC
A commit references this bug:

Author: manu
Date: Mon Jun  8 10:49:33 UTC 2020
New revision: 538209
URL: https://svnweb.freebsd.org/changeset/ports/538209

  mesa-dri: Add wayland to -Dplatform if option is selected

  PR:		247056
  Approved by:	zeising (x11@ implicit)

Comment 2 Emmanuel Vadot freebsd_committer 2020-06-09 19:21:11 UTC
Fixed in r538209.
Built a poudriere image with only :

and vulkaninfo and vkcube works correctly.
Comment 3 Jan Beich freebsd_committer 2020-06-09 20:30:29 UTC
(In reply to Emmanuel Vadot from comment #2)
> and vulkaninfo and vkcube works correctly.

- vulkaninfo would work even without X11 and Wayland (see VK_KHR_display)
- vkcube uses X11 via Xwayland as Wayland version crashes (VK_KHR_display works fine on console)

Try the following instead:

  $ pkg install vkquake
  $ SDL_VIDEODRIVER=wayland vkquake &
  $ swaymsg -t get_tree | jq '.. | select(.shell? == "xdg_shell") | .name'
  "vkQuake 1.03.0"
Comment 4 Emmanuel Vadot freebsd_committer 2020-06-09 20:49:12 UTC
(In reply to Jan Beich from comment #3)

Am I supposed to see the "vkQuake 1.03.0" ?
Comment 5 Emmanuel Vadot freebsd_committer 2020-06-09 21:28:20 UTC
I see one difference when I'm starting vkquake with SDL_VIDEODRIVER=wayland and without :
 - When SDL_VIDEODRIVER=wayland vkquake starts in windowed mode
 - When it's not set vkquake starts in fullscreen

I'll build a new image tomorow with Xwayland disabled to be sure.
Comment 6 Jan Beich freebsd_committer 2020-06-09 21:33:56 UTC
(In reply to Emmanuel Vadot from comment #4)
Yep, in the list of native Wayland clients. "shell" is either "xwayland" for X11 clients and "xdg_shell" for Wayland clients.

Another option is to advertise shell in window title:

  $ swaymsg for_window \[shell=".*"] title_format "%title :: %shell"

or disable X11 support

  $ swaymsg xwayland disable
  $ pkill Xwayland
Comment 7 Emmanuel Vadot freebsd_committer 2020-06-09 21:42:26 UTC
(In reply to Jan Beich from comment #6)

Well I don't see any shell variable in swaymsg -t get_tree
But using
  $ swaymsg for_window \[shell=".*"] title_format "%title :: %shell"
Shows xdg_shell when I start vkquake with SDL_VIDEODRIVER=wayland
When I don't set this variable and use your commands (
  $ swaymsg xwayland disable
  $ pkill Xwayland) it starts it with Xwayland mode.
Comment 8 Emmanuel Vadot freebsd_committer 2020-06-09 21:47:42 UTC
(In reply to Emmanuel Vadot from comment #7)

Not sure if it's new or not but anyway vkquake with wayland works.

also note that I've just got a freeze after 
1/ swaymsg xwayland disable
2/ pkill Xwayland (it was killed)
3/ starting vkquake without SDL_VIDEODRIVER set (seems to be start in X11 mode)
4/ pkill Xwayland
5/ start vkquake again

Not a freeze per-say but I ended up on the console with garbage on it, still could ssh to the machine and reboot.
I'll try to reproduce and do a proper PR then.
Comment 9 Jan Beich freebsd_committer 2020-06-09 21:56:01 UTC
(In reply to Emmanuel Vadot from comment #7)
> it starts it with Xwayland mode.

I guess, disabling X11 after startup is buggy. Sway doesn't clear DISPLAY variable that tells potential clients X11 can be used. Maybe Xwayland was restarted or pkill didn't have permissions due to setuid bit.
Comment 10 shamaz.mazum 2020-06-10 03:51:07 UTC
Works for me, thanks