mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 04:56:00 +01:00
drm/legacy: fix crash on null mode commit
This commit is contained in:
parent
c8c1e6ae3f
commit
70f4321a93
1 changed files with 6 additions and 3 deletions
|
@ -41,9 +41,12 @@ bool Aquamarine::CDRMLegacyImpl::commitInternal(Hyprutils::Memory::CSharedPointe
|
||||||
mode = (drmModeModeInfo*)&data.modeInfo;
|
mode = (drmModeModeInfo*)&data.modeInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
connector->backend->backend->log(
|
if (mode) {
|
||||||
AQ_LOG_DEBUG,
|
connector->backend->backend->log(
|
||||||
std::format("legacy drm: Modesetting CRTC, mode: clock {} hdisplay {} vdisplay {} vrefresh {}", mode->clock, mode->hdisplay, mode->vdisplay, mode->vrefresh));
|
AQ_LOG_DEBUG,
|
||||||
|
std::format("legacy drm: Modesetting CRTC, mode: clock {} hdisplay {} vdisplay {} vrefresh {}", mode->clock, mode->hdisplay, mode->vdisplay, mode->vrefresh));
|
||||||
|
} else
|
||||||
|
connector->backend->backend->log(AQ_LOG_DEBUG, "legacy drm: Modesetting CRTC, mode null");
|
||||||
|
|
||||||
if (auto ret = drmModeSetCrtc(connector->backend->gpu->fd, connector->crtc->id, mainFB ? mainFB->id : -1, 0, 0, connectors.data(), connectors.size(), mode); ret) {
|
if (auto ret = drmModeSetCrtc(connector->backend->gpu->fd, connector->crtc->id, mainFB ? mainFB->id : -1, 0, 0, connectors.data(), connectors.size(), mode); ret) {
|
||||||
connector->backend->backend->log(AQ_LOG_ERROR, std::format("legacy drm: drmModeSetCrtc failed: {}", strerror(-ret)));
|
connector->backend->backend->log(AQ_LOG_ERROR, std::format("legacy drm: drmModeSetCrtc failed: {}", strerror(-ret)));
|
||||||
|
|
Loading…
Reference in a new issue