Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.cpp
Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Line(s) | |||||
247 | { | 247 | { | ||
248 | initEdid(connector); | 248 | initEdid(connector); | ||
249 | initDpms(connector); | 249 | initDpms(connector); | ||
250 | initUuid(); | 250 | initUuid(); | ||
251 | if (m_backend->atomicModeSetting()) { | 251 | if (m_backend->atomicModeSetting()) { | ||
252 | if (!initPrimaryPlane()) { | 252 | if (!initPrimaryPlane()) { | ||
253 | return false; | 253 | return false; | ||
254 | } | 254 | } | ||
255 | } else if (!m_crtc->blank()) { | | |||
256 | return false; | | |||
257 | } | 255 | } | ||
258 | 256 | | |||
259 | setInternal(connector->connector_type == DRM_MODE_CONNECTOR_LVDS || connector->connector_type == DRM_MODE_CONNECTOR_eDP); | 257 | setInternal(connector->connector_type == DRM_MODE_CONNECTOR_LVDS || connector->connector_type == DRM_MODE_CONNECTOR_eDP); | ||
260 | setDpmsSupported(true); | 258 | setDpmsSupported(true); | ||
261 | 259 | | |||
262 | if (isInternal()) { | 260 | if (isInternal()) { | ||
263 | connect(kwinApp(), &Application::screensCreated, this, | 261 | connect(kwinApp(), &Application::screensCreated, this, | ||
264 | [this] { | 262 | [this] { | ||
265 | connect(screens()->orientationSensor(), &OrientationSensor::orientationChanged, this, &DrmOutput::automaticRotation); | 263 | connect(screens()->orientationSensor(), &OrientationSensor::orientationChanged, this, &DrmOutput::automaticRotation); | ||
266 | } | 264 | } | ||
267 | ); | 265 | ); | ||
268 | } | 266 | } | ||
269 | 267 | | |||
270 | initOutputDevice(connector); | 268 | initOutputDevice(connector); | ||
269 | | ||||
270 | if (!m_backend->atomicModeSetting() && !m_crtc->blank()) { | ||||
271 | // We use legacy mode and the initial output blank failed. | ||||
272 | return false; | ||||
273 | } | ||||
274 | | ||||
271 | updateDpms(KWayland::Server::OutputInterface::DpmsMode::On); | 275 | updateDpms(KWayland::Server::OutputInterface::DpmsMode::On); | ||
272 | return true; | 276 | return true; | ||
273 | } | 277 | } | ||
274 | 278 | | |||
275 | void DrmOutput::initUuid() | 279 | void DrmOutput::initUuid() | ||
276 | { | 280 | { | ||
277 | QCryptographicHash hash(QCryptographicHash::Md5); | 281 | QCryptographicHash hash(QCryptographicHash::Md5); | ||
278 | hash.addData(QByteArray::number(m_conn->id())); | 282 | hash.addData(QByteArray::number(m_conn->id())); | ||
▲ Show 20 Lines • Show All 461 Lines • ▼ Show 20 Line(s) | |||||
740 | void DrmOutput::setWaylandMode() | 744 | void DrmOutput::setWaylandMode() | ||
741 | { | 745 | { | ||
742 | AbstractWaylandOutput::setWaylandMode(QSize(m_mode.hdisplay, m_mode.vdisplay), | 746 | AbstractWaylandOutput::setWaylandMode(QSize(m_mode.hdisplay, m_mode.vdisplay), | ||
743 | refreshRateForMode(&m_mode)); | 747 | refreshRateForMode(&m_mode)); | ||
744 | } | 748 | } | ||
745 | 749 | | |||
746 | void DrmOutput::pageFlipped() | 750 | void DrmOutput::pageFlipped() | ||
747 | { | 751 | { | ||
748 | Q_ASSERT(m_pageFlipPending); | 752 | // In legacy mode we might get a page flip through a blank. | ||
753 | Q_ASSERT(m_pageFlipPending || !m_backend->atomicModeSetting()); | ||||
749 | m_pageFlipPending = false; | 754 | m_pageFlipPending = false; | ||
755 | | ||||
750 | if (m_deleted) { | 756 | if (m_deleted) { | ||
751 | deleteLater(); | 757 | deleteLater(); | ||
752 | return; | 758 | return; | ||
753 | } | 759 | } | ||
754 | 760 | | |||
755 | if (!m_crtc) { | 761 | if (!m_crtc) { | ||
756 | return; | 762 | return; | ||
757 | } | 763 | } | ||
▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines |