platforms/drm: Make DrmObject::m_id private

There's already a getter for the object id.
This commit is contained in:
Vlad Zahorodnii 2021-04-01 14:19:48 +03:00
parent 2ea66eb4c3
commit 7926fce598
4 changed files with 8 additions and 9 deletions

View file

@ -98,8 +98,6 @@ protected:
class Property;
bool atomicAddProperty(drmModeAtomicReq *req, Property *property) const;
const uint32_t m_id;
// for comparison with received name of DRM object
QVector<Property *> m_props;
@ -165,6 +163,7 @@ protected:
private:
DrmGpu *m_gpu;
QVector<QByteArray> m_propsNames;
const uint32_t m_id;
};
}

View file

@ -31,7 +31,7 @@ DrmConnector::~DrmConnector() = default;
bool DrmConnector::init()
{
qCDebug(KWIN_DRM) << "Creating connector" << m_id;
qCDebug(KWIN_DRM) << "Creating connector" << id();
if (!initProps({
PropertyDefinition(QByteArrayLiteral("CRTC_ID")),
@ -85,7 +85,7 @@ bool DrmConnector::init()
bool DrmConnector::isConnected()
{
DrmScopedPointer<drmModeConnector> con(drmModeGetConnector(gpu()->fd(), m_id));
DrmScopedPointer<drmModeConnector> con(drmModeGetConnector(gpu()->fd(), id()));
if (!con) {
return false;
}

View file

@ -30,7 +30,7 @@ bool DrmCrtc::init()
if (!m_crtc) {
return false;
}
qCDebug(KWIN_DRM) << "Init for CRTC:" << resIndex() << "id:" << m_id;
qCDebug(KWIN_DRM) << "Init for CRTC:" << resIndex() << "id:" << id();
return initProps({
PropertyDefinition(QByteArrayLiteral("MODE_ID")),
PropertyDefinition(QByteArrayLiteral("ACTIVE")),
@ -76,7 +76,7 @@ bool DrmCrtc::setGammaRamp(const GammaRamp &gamma)
uint16_t *green = const_cast<uint16_t *>(gamma.green());
uint16_t *blue = const_cast<uint16_t *>(gamma.blue());
const bool isError = drmModeCrtcSetGamma(gpu()->fd(), m_id,
const bool isError = drmModeCrtcSetGamma(gpu()->fd(), id(),
gamma.size(), red, green, blue);
return !isError;

View file

@ -22,11 +22,11 @@ DrmPlane::DrmPlane(DrmGpu *gpu, uint32_t plane_id)
bool DrmPlane::init()
{
qCDebug(KWIN_DRM) << "Atomic init for plane:" << m_id;
DrmScopedPointer<drmModePlane> p(drmModeGetPlane(gpu()->fd(), m_id));
qCDebug(KWIN_DRM) << "Atomic init for plane:" << id();
DrmScopedPointer<drmModePlane> p(drmModeGetPlane(gpu()->fd(), id()));
if (!p) {
qCWarning(KWIN_DRM) << "Failed to get kernel plane" << m_id;
qCWarning(KWIN_DRM) << "Failed to get kernel plane" << id();
return false;
}