backends/drm: Fix DrmCrtc::queryCurrentMode() accidentally resetting m_crtc to null

Otherwise kwin will likely crash.
This commit is contained in:
Vlad Zahorodnii 2024-06-24 12:32:24 +03:00
parent 1ee3062e45
commit 1dbef2d5ed

View file

@ -58,8 +58,12 @@ bool DrmCrtc::updateProperties()
drmModeModeInfo DrmCrtc::queryCurrentMode()
{
m_crtc.reset(drmModeGetCrtc(gpu()->fd(), id()));
return m_crtc->mode;
DrmUniquePtr<drmModeCrtc> crtc(drmModeGetCrtc(gpu()->fd(), id()));
if (crtc) {
return crtc->mode;
} else {
return m_crtc->mode;
}
}
int DrmCrtc::pipeIndex() const