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

Added gpu device option #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Ella-0
Copy link
Contributor

@Ella-0 Ella-0 commented Aug 30, 2020

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.

@st3r4g
Copy link
Owner

st3r4g commented Aug 30, 2020

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.

@Ella-0
Copy link
Contributor Author

Ella-0 commented Aug 30, 2020

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.

@st3r4g
Copy link
Owner

st3r4g commented Aug 30, 2020

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.

@illiliti
Copy link

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

@Ella-0
Copy link
Contributor Author

Ella-0 commented Sep 13, 2020

I'll look into doing that.

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.

None yet

3 participants