drm: fix crash for connectors without a fallback mode (#20)

This commit is contained in:
JManch 2024-07-18 10:09:17 +01:00 committed by GitHub
parent 5b34d0df1f
commit dcac376308
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1122,7 +1122,7 @@ void Aquamarine::SDRMConnector::connect(drmModeConnector* connector) {
aqMode->preferred ? " (preferred)" : "")); aqMode->preferred ? " (preferred)" : ""));
} }
if (!currentModeInfo) { if (!currentModeInfo && fallbackMode) {
output->state->setMode(fallbackMode); output->state->setMode(fallbackMode);
crtc->refresh = calculateRefresh(fallbackMode->modeInfo.value()); crtc->refresh = calculateRefresh(fallbackMode->modeInfo.value());
} }