mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 04:56:00 +01:00
drm/legacy: avoid crashing on missing crtcs
This commit is contained in:
parent
25836ee88e
commit
cef415f033
1 changed files with 6 additions and 2 deletions
|
@ -151,12 +151,16 @@ bool Aquamarine::CDRMLegacyImpl::commit(Hyprutils::Memory::CSharedPointer<SDRMCo
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Aquamarine::CDRMLegacyImpl::reset() {
|
bool Aquamarine::CDRMLegacyImpl::reset() {
|
||||||
|
bool ok = true;
|
||||||
for (auto& connector : backend->connectors) {
|
for (auto& connector : backend->connectors) {
|
||||||
|
if (!connector->crtc)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (int ret = drmModeSetCrtc(backend->gpu->fd, connector->crtc->id, 0, 0, 0, nullptr, 0, nullptr); ret) {
|
if (int ret = drmModeSetCrtc(backend->gpu->fd, connector->crtc->id, 0, 0, 0, nullptr, 0, nullptr); ret) {
|
||||||
connector->backend->backend->log(AQ_LOG_ERROR, std::format("legacy drm: reset failed: {}", strerror(-ret)));
|
connector->backend->backend->log(AQ_LOG_ERROR, std::format("legacy drm: reset failed: {}", strerror(-ret)));
|
||||||
return false;
|
ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return ok;
|
||||||
}
|
}
|
Loading…
Reference in a new issue