backends/drm: fix error in finding the best plane

This commit is contained in:
Xaver Hugl 2022-12-17 15:40:43 +01:00
parent e708f8a166
commit 9078d916c2

View file

@ -197,7 +197,7 @@ void DrmGpu::initDrmResources()
const auto notconnected = std::find_if(list.begin(), list.end(), [](DrmPlane *plane) {
return plane->getProp(DrmPlane::PropertyIndex::CrtcId)->pending() == 0;
});
if (notconnected == list.end()) {
if (notconnected != list.end()) {
return *notconnected;
}
return list.empty() ? nullptr : list.front();