mirror of
https://github.com/hyprwm/aquamarine.git
synced 2026-05-08 13:08:01 +02:00
backend/drm: support semicolon delimiter for PCI paths in AQ_DRM_DEVICES
This commit is contained in:
parent
f62a4dbfa4
commit
699fc73aa7
1 changed files with 16 additions and 1 deletions
|
|
@ -177,7 +177,18 @@ static std::vector<SP<CSessionDevice>> scanGPUs(SP<CBackend> backend) {
|
|||
auto explicitGpus = getenv("AQ_DRM_DEVICES");
|
||||
if (explicitGpus) {
|
||||
backend->log(AQ_LOG_DEBUG, std::format("drm: Explicit device list {}", explicitGpus));
|
||||
Hyprutils::String::CVarList explicitDevices(explicitGpus, 0, ':', true);
|
||||
std::string explicitGpusStr = explicitGpus;
|
||||
char delimiter = ':';
|
||||
|
||||
std::error_code ec;
|
||||
if (std::filesystem::exists(explicitGpusStr, ec)) {
|
||||
delimiter = ';';
|
||||
}
|
||||
|
||||
if (explicitGpusStr.find(';') != std::string::npos)
|
||||
delimiter = ';';
|
||||
|
||||
Hyprutils::String::CVarList explicitDevices(explicitGpus, 0, delimiter, true);
|
||||
|
||||
// Iterate over GPUs and canonicalize the paths
|
||||
for (auto& d : explicitDevices) {
|
||||
|
|
@ -189,6 +200,10 @@ static std::vector<SP<CSessionDevice>> scanGPUs(SP<CBackend> backend) {
|
|||
// TODO: Verify that the path is a valid DRM device. (https://gitlab.freedesktop.org/wlroots/wlroots/-/blob/master/backend/session/session.c?ref_type=heads#L369-387)
|
||||
if (ec) {
|
||||
backend->log(AQ_LOG_ERROR, std::format("drm: Failed to canonicalize path {}", d));
|
||||
|
||||
if (delimiter == ':') {
|
||||
backend->log(AQ_LOG_ERROR, "drm: If you are using PCI paths with colons, use ';' as a separator instead of ':'.");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue