swvkc icon indicating copy to clipboard operation
swvkc copied to clipboard

Added gpu device option

Open Ella-0 opened this issue 3 years ago • 5 comments

This is a little hack and I'm not sure whether or not you want it merged. I need it as my operating system uses libudev-zero (a daemon-less libudev replacement) which doesn't implement all the features of udev so I have to manually specify the card to get it to work though it does work which I'm mildly surprised about. The thing that concerns me most in the patch is the duplicate branching in drm_setup to handle the freeing of devpath though I can't think of a better way of handling it.

Ella-0 avatar Aug 30 '20 00:08 Ella-0

This is a little hack and I'm not sure whether or not you want it merged.

I do want something like this. I too experimented with udev replacements (busybox's mdev and skarnet's mdevd), input device discovery didn't work because the ID_INPUT_{KEYBOARD,MOUSE,TOUCHPAD} properties were missing, so I introduced the possibility to specify device nodes as cmdline args. I haven't done it for the gpu yet because it was working (the boot_vga attribute was set with both mdevd and mdev iirc). Ideally I would like to make libudev an optional dependency, because I don't think Vulkan (or better, the Vulkan implementation) requires it (Vulkan is also doing its own gpu discovery). So I think the code needs a bit of cleanup, it was a bit rushed. But in the meantime I could merge this if it works.

st3r4g avatar Aug 30 '20 10:08 st3r4g

This code does work for me at least. And I'm using busybox mdev (though planning to switch to toybox), with libudev-zero. I kinda have a really weird setup as I've been creating a distro with no GNU runtime dependencies and this is the only compositor I've found that doesn't need any of the glib stuff. What's stopping the use of Vulkan's GPU discovery? I'm gessing that libdrm requires more information than Vulkan can provide.

Ella-0 avatar Aug 30 '20 11:08 Ella-0

Right now for simplicity DRM and Vulkan open the GPU independently. This is a problem if the system has more than one GPU, because they might open different GPUs. There are two possibilities:

  1. Open with DRM and tell Vulkan our choice I think this is doable with mesa's recently added device-select-layer

  2. Open with Vulkan and tell DRM our choice This is not possible in core Vulkan, there is no way to extract the file descriptor or device node. However, the extension VK_EXT_pci_bus_info might provide enough info to be able to so.

Either way, I need to do a bit more research. I think 1 is the way to go though. I'll turn this comment into an issue to keep track of this.

st3r4g avatar Aug 30 '20 14:08 st3r4g

@Ella-0 feel free to implement udev_enumerate_add_match_parent function which required by swvkc

illiliti avatar Sep 13 '20 20:09 illiliti

I'll look into doing that.

Ella-0 avatar Sep 13 '20 20:09 Ella-0