michaelforney / swc

a library for making a simple Wayland compositor
MIT License
626 stars 53 forks source link

SWC fails to create WLD DRM context for nouveau drivers unless WLD_DRM_DUMB environment variable is set. (possibly WLD bug?) #32

Open faithanalog opened 9 years ago

faithanalog commented 9 years ago

I use the nouveau drivers. Running swc-launch velox without WLD_DRM_DUMB results in

[swc:libswc/drm.c:161] DEBUG: /dev/dri/card0 is the primary GPU
# find_driver: Trying DRM driver `intel'
# find_driver: Trying DRM driver `nouveau'
[swc:libswc/drm.c:319] ERROR: Could not create WLD DRM context
[swc:libswc/swc.c:133] ERROR: Could not initialize DRM

And with WLD_DRM_DUMB=nouveau, it starts properly.

I'm unsure of whether this is a wld bug or an swc bug, but I'm submitting here because the error was printed in swc code. I did add some debug statements to wld, and verified that driver_device_supported is returning true for nouveau, and wld is returning the nouveau driver in drm.c, so I'm not sure what the actual problem is.

michaelforney commented 9 years ago

What generation card do you have?

I only have an NVC0, so that is all that is supported by wld at the moment. If you want to try to get your card supported, you could take a look at nouveau.c.

faithanalog commented 9 years ago

GTX 760, which I believe would be NVE4

michaelforney commented 9 years ago

Cool. If you uncomment https://github.com/michaelforney/wld/blob/master/nouveau.c#L112, there is a chance that it will just work. However, there is also a chance that it won't. If it seems like nothing is displaying, I think normal key bindings should work, but just in case, you should make sure you have a way to ssh in and kill velox.

Let me know how it goes!