mirror of
https://github.com/hyprwm/aquamarine.git
synced 2025-12-20 04:40:12 +01:00
drm: convert vd path before compare with explicit device path (#222)
FreeBSD always returning symbolic links '/dev/dri/card*' pointed to '/dev/drm/*', so output device will never be found if `AQ_DRM_DEVICES` is set as explicit devices path is converted to canonical file path.
This commit is contained in:
parent
a43bedccec
commit
c6354f54f9
1 changed files with 8 additions and 1 deletions
|
|
@ -200,7 +200,14 @@ static std::vector<SP<CSessionDevice>> scanGPUs(SP<CBackend> backend) {
|
|||
for (auto const& d : explicitDevices) {
|
||||
bool found = false;
|
||||
for (auto const& vd : devices) {
|
||||
if (vd->path == d) {
|
||||
std::error_code ec;
|
||||
auto canonicalFilePath = std::filesystem::canonical(vd->path, ec);
|
||||
if (ec) {
|
||||
backend->log(AQ_LOG_ERROR, std::format("drm: Failed to canonicalize path {}", d));
|
||||
canonicalFilePath = vd->path;
|
||||
}
|
||||
|
||||
if (canonicalFilePath == d) {
|
||||
vecDevices.emplace_back(vd);
|
||||
found = true;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue