backends/drm: Fix DrmCrtc::queryCurrentMode() accidentally resetting m_crtc to null
Otherwise kwin will likely crash.
This commit is contained in:
parent
1ee3062e45
commit
1dbef2d5ed
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue