Open gpanders opened 3 years ago
Can you obtain DRM debug logs? See https://github.com/swaywm/wlroots/wiki/DRM-Debugging
[ 2965.440924] [drm:vmw_du_cursor_plane_atomic_check [vmwgfx]] *ERROR* surface not suitable for cursor
[ 2965.440934] [drm:drm_atomic_helper_check_planes [drm_kms_helper]] [PLANE:35:plane-1] atomic driver check failed
[ 2965.440952] [drm:drm_atomic_check_only [drm]] atomic driver check for 000000002c4d38b2 failed: -22
$ lsmod | grep drm_kms_helper
drm_kms_helper 266240 1 vmwgfx
cec 73728 1 drm_kms_helper
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
fb_sys_fops 16384 1 drm_kms_helper
drm 585728 5 vmwgfx,drm_kms_helper,ttm
I've scoured the package manager for every permutation of mesa
, drm
, dri
, and vmware
I can think of and it appears I have all appropriate packages installed.
Also, I don't know if this is relevant/helpful, but I can start sway from an already running Gnome session (i.e. running sway
from Gnome Terminal). It opens sway in a separate window but everything seems to be working as expected. It's only when started from the tty that it fails to start. That makes me think it's not a driver problem (though I could be wrong).
WLR_NO_HARDWARE_CURSORS=1 sway
is a workaround for me.
It sounds like this check fails in the driver:
if (surface && !surface->snooper.image) {
DRM_ERROR("surface not suitable for cursor\n");
ret = -EINVAL;
}
The snooper image is created in these conditions:
if (metadata->scanout &&
metadata->num_sizes == 1 &&
metadata->sizes[0].width == 64 &&
metadata->sizes[0].height == 64 &&
metadata->format == SVGA3D_A8R8G8B8) {
srf->snooper.image = kzalloc(64 * 64 * 4, GFP_KERNEL);
if (!srf->snooper.image) {
DRM_ERROR("Failed to allocate cursor_image\n");
ret = -ENOMEM;
goto out_no_copy;
}
} else {
srf->snooper.image = NULL;
}
We need to figure out which one of these conditions fail.
Can you provide a drm_info
log?
drm_info, in windowed mode: https://gist.github.com/hedgepigdaniel/63c37724779f70a5415efe8237f61bca
The "preferred" mode changes in drm_info
when resizing the host window, or when switching to and from full screen modes, or enabling/disabling the use of multiple screens in full screen mode.
However, the modes seen by sway according to swaymsg -t get_outputs
don't seem to update consistently. When new displays are added or removed they appear (I think usually with the correct resolution), but resizing an existing host window (guest screen) does not seem to cause sway to update the available modes.
Also when guest use of multiple screens is enabled, the cursor is sometimes not able to travel across the entire area of all the screens.
LMK if any of these deserve separate issues - just posting here in case it's related.
The symptom is different when VMware is set to full screen mode - sway starts and works, but the cursor is not visible as in https://github.com/swaywm/sway/issues/3814
drm_info: https://gist.github.com/hedgepigdaniel/bf4a121cace8d9eb0e0e83393dd71a82
I see many messages like this in my kernel log:
[drm:vmw_du_cursor_plane_atomic_check [vmwgfx]] *ERROR* surface not suitable for cursor
Thanks @hedgepigdaniel, setting WLR_NO_HARDWARE_CURSORS=1
works for me as well. I had seen that recommended in other issues (such as #3814) but I didn't think to try it since the problems in those issues were different than mine.
The snooper image is created in these conditions:
if (metadata->scanout && metadata->num_sizes == 1 && metadata->sizes[0].width == 64 && metadata->sizes[0].height == 64 && metadata->format == SVGA3D_A8R8G8B8) { srf->snooper.image = kzalloc(64 * 64 * 4, GFP_KERNEL); if (!srf->snooper.image) { DRM_ERROR("Failed to allocate cursor_image\n"); ret = -ENOMEM; goto out_no_copy; } } else { srf->snooper.image = NULL; }
We need to figure out which one of these conditions fail.
Preliminary findings to be confirmed: None of this code runs at all. I put a DRM_ERROR in the else block and didn't see any log messages.
Next step is to put more of them at all the early returns earlier in that function and see of one of them is the culprit.
To save me a bunch of confusion - what code in wlroots would you expect to be calling vmw_surface_define_ioctl
?
what code in wlroots would you expect to be calling vmw_surface_define_ioctl?
This function is hooked up to the ioctl VMW_CREATE_SURFACE
, which I expect would be called when creating a GBM BO (so as a result of a gbm_bo_create
call, which should call the driver-specific function to allocate a buffer in Mesa).
Well, it turns out that mesa doesn't call vmw_surface_define_ioctl
- instead it calls vmw_gb_surface_define_ext_ioctl
, and that does not set snooper.image
.
The choice between the two ioctls is made here on the basis that have_gb_objects
is true.
OK. Can you report a Mesa bug about this?
WLR_NO_HARDWARE_CURSORS=1 doesn't help in VMWare Fusion 12.1.0 (17195230) (macOS Big Sur host, fresh Arch Linux guest). I get the following error when starting from tty1:
00:00:00.004 [sway/main.c:349] Unable to retrieve socket path
Same issue when starting from GDM. If started from gnome-terminal sway successfully runs in a separate window.
@IvoMajic Please redirect the output of Sway to a file to get full logs: sway -d >sway.log 2>&1
. The console is messed up when Sway switches it to graphics mode.
@emersion full log:
https://gist.github.com/IvoMajic/e09a49d12510e1efa61d1c67dfa3c90b
The result is just a black screen, which can only be exited by switching to other tty or shutdown.
You're also getting this:
00:00:00.221 [ERROR] [backend/drm/atomic.c:36] Virtual-1: Atomic commit failed (pageflip): Invalid argument
Is there anything I can do to help? I'm successfully running Sway 1.5.1 on a Macbook Pro 2019 with Big Sur 11.2.2 in VMware Fusion Pro 12.1.0 in a window (not fullscreen). I am setting WLR_NO_HARDWARE_CURSORS=1
.
Debug log from my VM: https://gist.github.com/lvets/944d9d351f814567d472000583822b40
Having the same issue. My dmesg log shows no errors, and the redirected output from sway
is an empty file.
This is using VMWare Workstation Player 16 and a fresh install of Arch.
Using WLR_NO_HARDWARE_CURSORS=1
changed nothing.
Running sway
immediately freezes the VM and no additional input works. A forced reboot is required.
the redirected output from sway is an empty file.
You need to redirect stderr.
@emersion I did. I ran sway -d >sway.log 2>&1
exactly as prescribed in https://github.com/swaywm/sway/issues/5834#issuecomment-751126401.
Just popping in with a +1 - I am experiencing the same issue when running sway (albeit in a Void Linux VMware VM).
WLR_NO_HARDWARE_CURSORS=1
did not resolve.
00:00:00.225 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:00.225 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:00.230 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:00.230 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:00.285 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:00.285 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:01.236 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:01.236 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:02.241 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:02.241 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:03.248 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:03.248 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:04.254 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:04.254 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:05.261 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:05.261 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:06.266 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:06.266 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:07.273 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:07.273 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:08.279 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:08.279 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:09.284 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:09.284 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
00:00:10.291 [ERROR] [wlr] [backend/drm/atomic.c:140] Failed to acquire FB
00:00:10.291 [ERROR] [wlr] [backend/drm/atomic.c:162] Failed to set plane 35 properties
Sway works perfectly for me when setting WLR_NO_HARDWARE_CURSORS=1
and ensuring Accelerate 3D Graphics
in the guest VM's display preferences is enabled.
If the former is not set you will get a black screen. If the latter is not set you will get a Could not connect to socket
error.
Something fishy is definitely going on with wlroots and virtualised drm drivers (such as virtio-gpu, vmwgfx, etc.). On all virtual machines (tried Parallels Desktop, VMware Fusion, but above there are reports re: Virtualbox too) any wlroots-based compositor can't produce a hardware cursor (either it is not visible or results in a console lockup). At the same time, Weston happily works with all these drm drivers and enables hardware cursor. JFYI.
I am having the same issue on a fresh install of ubuntu in vmware. Same symptoms (black screen, starting from already running gnome session opens sway correctly in window).
WLR_NO_HARDWARE_CURSORS=1 sway
is a workaround for me.
Works for me too. I have to disable the graphical login manager with sudo systemctl set-default multi-user
and start it with the workaround from the terminal.
hey bros doesnt anybody know how to make WLR_NO_HARDWARE_CURSORS=1 sway this work with sddm? because if i try to input it into the .desktop file it doenst work
pls halp.
I am having the same issue with arch as a guest in qemu, arch kernel vesions: --6.3.1
+1
not much to add
host: Win10 Ent; VMware 16 PRO
guest: Debian12 headless; sway 1.7 from scratch + swaybg and all recommended
WLR_NO_HARDWARE_CURSORS=1
black screen after sway launched from terminal
after switching between TTYs, graphical output is updated, but again hangs until another TTY switch back and forward.
all env.var. SWAYSOCK etc. appear to be empty by default. Manually setting SWAYSOCK has no effect.
Anything to provide or help?
Please fill out the following:
Sway Version: 1.5.1
Debug Log: https://paste.sr.ht/~gpanders/64de4204fcd197701c1750ffcd02cf2397b37e37
Configuration File: Default sway config file
Description: This is a fresh install of Arch Linux on VMWare Fusion. I'm running
sway
from the command line and then the screen goes black and unresponsive. The only way for me to kill it is to switch to another tty using Ctrl+Alt+F3 and runningkillall sway
.These are the errors I see in the log file:
I've tried with and without VMWare's "Accelerate 3D Graphics" option. It doesn't seem to make a difference.