platforms/drm: reload m_conn in DrmConnector::updateProperties

This commit is contained in:
Xaver Hugl 2021-09-02 15:21:57 +02:00
parent 82dd480196
commit 1af2067f40
3 changed files with 13 additions and 3 deletions

View file

@ -179,6 +179,7 @@ bool DrmGpu::updateOutputs()
}
m_connectors << c;
} else {
(*it)->updateProperties();
oldConnectors.removeOne(*it);
}
}

View file

@ -138,9 +138,8 @@ bool DrmConnector::init()
return true;
}
bool DrmConnector::isConnected()
bool DrmConnector::isConnected() const
{
m_conn.reset(drmModeGetConnector(gpu()->fd(), id()));
if (!m_conn) {
return false;
}
@ -335,4 +334,13 @@ AbstractWaylandOutput::RgbRange DrmConnector::rgbRange() const
return rgb->enumForValue<AbstractWaylandOutput::RgbRange>(rgb->pending());
}
bool DrmConnector::updateProperties()
{
if (!DrmObject::updateProperties()) {
return false;
}
m_conn.reset(drmModeGetConnector(gpu()->fd(), id()));
return m_conn != nullptr;
}
}

View file

@ -54,7 +54,7 @@ public:
return m_encoders;
}
bool isConnected();
bool isConnected() const;
bool isNonDesktop() const {
auto prop = m_props.at(static_cast<uint32_t>(PropertyIndex::NonDesktop));
@ -103,6 +103,7 @@ public:
AbstractWaylandOutput::RgbRange rgbRange() const;
bool needsModeset() const override;
bool updateProperties() override;
private:
DrmScopedPointer<drmModeConnector> m_conn;