Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Line(s) | |||||
295 | { | 295 | { | ||
296 | QString manufacturer; | 296 | QString manufacturer; | ||
297 | if (!m_edid.vendor().isEmpty()) { | 297 | if (!m_edid.vendor().isEmpty()) { | ||
298 | manufacturer = QString::fromLatin1(m_edid.vendor()); | 298 | manufacturer = QString::fromLatin1(m_edid.vendor()); | ||
299 | } else if (!m_edid.eisaId().isEmpty()) { | 299 | } else if (!m_edid.eisaId().isEmpty()) { | ||
300 | manufacturer = QString::fromLatin1(m_edid.eisaId()); | 300 | manufacturer = QString::fromLatin1(m_edid.eisaId()); | ||
301 | } | 301 | } | ||
302 | 302 | | |||
303 | QString connectorName = s_connectorNames.value(connector->connector_type, QByteArrayLiteral("Unknown")); | 303 | QString connectorName = s_connectorNames.value(connector->connector_type, QByteArrayLiteral("Unknown")) + QStringLiteral("-") + QString::number(connector->connector_type_id); | ||
304 | QString modelName; | 304 | QString modelName; | ||
305 | 305 | | |||
306 | if (!m_edid.monitorName().isEmpty()) { | 306 | if (!m_edid.monitorName().isEmpty()) { | ||
307 | QString m = QString::fromLatin1(m_edid.monitorName()); | 307 | QString m = QString::fromLatin1(m_edid.monitorName()); | ||
308 | if (!m_edid.serialNumber().isEmpty()) { | 308 | if (!m_edid.serialNumber().isEmpty()) { | ||
309 | m.append('/'); | 309 | m.append('/'); | ||
310 | m.append(QString::fromLatin1(m_edid.serialNumber())); | 310 | m.append(QString::fromLatin1(m_edid.serialNumber())); | ||
311 | } | 311 | } | ||
312 | modelName = m; | 312 | modelName = m; | ||
313 | } else if (!m_edid.serialNumber().isEmpty()) { | 313 | } else if (!m_edid.serialNumber().isEmpty()) { | ||
314 | modelName = QString::fromLatin1(m_edid.serialNumber()); | 314 | modelName = QString::fromLatin1(m_edid.serialNumber()); | ||
315 | } else { | 315 | } else { | ||
316 | modelName = i18n("unknown"); | 316 | modelName = i18n("unknown"); | ||
317 | } | 317 | } | ||
318 | 318 | | |||
319 | const QString model = connectorName + QStringLiteral("-") + QString::number(connector->connector_type_id) + QStringLiteral("-") + modelName; | 319 | const QString model = connectorName + QStringLiteral("-") + modelName; | ||
320 | 320 | | |||
321 | // read in mode information | 321 | // read in mode information | ||
322 | QVector<KWayland::Server::OutputDeviceInterface::Mode> modes; | 322 | QVector<KWayland::Server::OutputDeviceInterface::Mode> modes; | ||
323 | for (int i = 0; i < connector->count_modes; ++i) { | 323 | for (int i = 0; i < connector->count_modes; ++i) { | ||
324 | // TODO: in AMS here we could read and store for later every mode's blob_id | 324 | // TODO: in AMS here we could read and store for later every mode's blob_id | ||
325 | // would simplify isCurrentMode(..) and presentAtomically(..) in case of mode set | 325 | // would simplify isCurrentMode(..) and presentAtomically(..) in case of mode set | ||
326 | auto *m = &connector->modes[i]; | 326 | auto *m = &connector->modes[i]; | ||
327 | KWayland::Server::OutputDeviceInterface::ModeFlags deviceflags; | 327 | KWayland::Server::OutputDeviceInterface::ModeFlags deviceflags; | ||
Show All 19 Lines | |||||
347 | KConfigGroup group = kwinApp()->config()->group("EdidOverwrite").group(m_edid.eisaId().isEmpty() ? unknown : m_edid.eisaId()) | 347 | KConfigGroup group = kwinApp()->config()->group("EdidOverwrite").group(m_edid.eisaId().isEmpty() ? unknown : m_edid.eisaId()) | ||
348 | .group(m_edid.monitorName().isEmpty() ? unknown : m_edid.monitorName()) | 348 | .group(m_edid.monitorName().isEmpty() ? unknown : m_edid.monitorName()) | ||
349 | .group(m_edid.serialNumber().isEmpty() ? unknown : m_edid.serialNumber()); | 349 | .group(m_edid.serialNumber().isEmpty() ? unknown : m_edid.serialNumber()); | ||
350 | if (group.hasKey("PhysicalSize")) { | 350 | if (group.hasKey("PhysicalSize")) { | ||
351 | const QSize overwriteSize = group.readEntry("PhysicalSize", physicalSize); | 351 | const QSize overwriteSize = group.readEntry("PhysicalSize", physicalSize); | ||
352 | qCWarning(KWIN_DRM) << "Overwriting monitor physical size for" << m_edid.eisaId() << "/" << m_edid.monitorName() << "/" << m_edid.serialNumber() << " from " << physicalSize << "to " << overwriteSize; | 352 | qCWarning(KWIN_DRM) << "Overwriting monitor physical size for" << m_edid.eisaId() << "/" << m_edid.monitorName() << "/" << m_edid.serialNumber() << " from " << physicalSize << "to " << overwriteSize; | ||
353 | physicalSize = overwriteSize; | 353 | physicalSize = overwriteSize; | ||
354 | } | 354 | } | ||
355 | 355 | setName(connectorName); | |||
356 | initInterfaces(model, manufacturer, m_uuid, physicalSize, modes); | 356 | initInterfaces(model, manufacturer, m_uuid, physicalSize, modes); | ||
357 | } | 357 | } | ||
358 | 358 | | |||
359 | bool DrmOutput::isCurrentMode(const drmModeModeInfo *mode) const | 359 | bool DrmOutput::isCurrentMode(const drmModeModeInfo *mode) const | ||
360 | { | 360 | { | ||
361 | return mode->clock == m_mode.clock | 361 | return mode->clock == m_mode.clock | ||
362 | && mode->hdisplay == m_mode.hdisplay | 362 | && mode->hdisplay == m_mode.hdisplay | ||
363 | && mode->hsync_start == m_mode.hsync_start | 363 | && mode->hsync_start == m_mode.hsync_start | ||
▲ Show 20 Lines • Show All 728 Lines • Show Last 20 Lines |