platforms/drm: don't take the rotation property for granted

Should fix the crash on the pinephone
This commit is contained in:
Xaver Hugl 2021-07-12 14:28:38 +02:00
parent 3c28a78956
commit 2977ae8e37

View file

@ -140,7 +140,11 @@ void DrmPlane::setBuffer(DrmBuffer *buffer)
bool DrmPlane::needsModeset() const
{
return getProp(PropertyIndex::CrtcId)->needsCommit() || getProp(PropertyIndex::Rotation)->needsCommit();
auto rotation = getProp(PropertyIndex::Rotation);
if (rotation && rotation->needsCommit()) {
return true;
}
return getProp(PropertyIndex::CrtcId)->needsCommit();
}
}