diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp index c1d5af47aa..ebb55864d7 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp @@ -114,6 +114,9 @@ void QEglFSWindow::create() // raster windows will not have their own native window, surface and context. Instead, // they will be composited onto the root window's surface. QEglFSScreen *screen = this->screen(); + + QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); +/* #ifndef QT_NO_OPENGL QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); if (screen->primarySurface() != EGL_NO_SURFACE) { @@ -129,6 +132,7 @@ void QEglFSWindow::create() return; } #endif // QT_NO_OPENGL +*/ m_flags |= HasNativeWindow; setGeometry(QRect()); // will become fullscreen diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp index b8f04cf978..1fe861ef7a 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp @@ -37,6 +37,9 @@ ** ****************************************************************************/ +#include +#include + #include "qeglfsopenwfdintegration.h" #include "wfd.h" @@ -78,7 +81,7 @@ void QEglFSOpenWFDIntegration::platformInit() // Create device WFDint dev_attribs[3] = {WFD_DEVICE_CLIENT_TYPE, - WFD_CLIENT_ID_CLUSTER, + 0x7810, WFD_NONE}; bool ok; @@ -98,7 +101,12 @@ void QEglFSOpenWFDIntegration::platformInit() wfdEnumeratePorts(mDevice, portIds, numPorts, nullptr); // Create port - mPort = wfdCreatePort(mDevice, portIds[0], nullptr); + WFDint portIndex = qgetenv("QT_OPENWFD_PORT_ID").toInt(&ok, 16); + + if (!ok) + portIndex = portIds[0]; + + mPort = wfdCreatePort(mDevice, portIndex, nullptr); if (WFD_INVALID_HANDLE == mPort) qFatal("Failed to create wfd port"); @@ -139,9 +147,24 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow const QSize &size, const QSurfaceFormat &format) { - Q_UNUSED(window); Q_UNUSED(format); + qDebug() << "Create native window for WinId: " << window->winId(); + + if (window->winId() == 2) { + WFDint dev_attribs[3] = {WFD_DEVICE_CLIENT_TYPE, + 0x7815, + WFD_NONE}; + + mDevice = wfdCreateDevice(WFD_DEFAULT_DEVICE_ID, dev_attribs); + mPort = wfdCreatePort(mDevice, 0, nullptr); + WFDint numPortModes = wfdGetPortModes(mDevice, mPort, nullptr, 0); + WFDPortMode portModes[MAX_NUM_OF_WFD_PORT_MODES]; + wfdGetPortModes(mDevice, mPort, portModes, numPortModes); + wfdSetPortMode(mDevice, mPort, portModes[0]); + wfdSetPortAttribi(mDevice, mPort, WFD_PORT_POWER_MODE, WFD_POWER_MODE_ON); + } + // Get list of pipelines WFDint numPipelines = wfdEnumeratePipelines(mDevice, nullptr, 0, nullptr); @@ -154,6 +177,9 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow if (!ok) pipelineId = pipelineIds[0]; + if (window->winId() == 2) + pipelineId = 9; + WFDPipeline pipeline = wfdCreatePipeline(mDevice, pipelineId, nullptr); if (WFD_INVALID_HANDLE == pipeline) qFatal("Failed to create wfd pipeline");