|
|
|
@ -48,7 +48,7 @@ PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHR pEglStreamConsumerGLTextureExternalKHR
|
|
|
|
|
PFNEGLQUERYSTREAMATTRIBNV pEglQueryStreamAttribNV = nullptr;
|
|
|
|
|
PFNEGLSTREAMCONSUMERRELEASEKHR pEglStreamConsumerReleaseKHR = nullptr;
|
|
|
|
|
PFNEGLQUERYWAYLANDBUFFERWL pEglQueryWaylandBufferWL = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef EGL_CONSUMER_AUTO_ACQUIRE_EXT
|
|
|
|
|
#define EGL_CONSUMER_AUTO_ACQUIRE_EXT 0x332B
|
|
|
|
|
#endif
|
|
|
|
@ -67,7 +67,7 @@ PFNEGLQUERYWAYLANDBUFFERWL pEglQueryWaylandBufferWL = nullptr;
|
|
|
|
|
|
|
|
|
|
#ifndef EGL_WAYLAND_Y_INVERTED_WL
|
|
|
|
|
#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
EglStreamBackend::EglStreamBackend(DrmBackend *b, DrmGpu *gpu)
|
|
|
|
|
: AbstractEglBackend(), m_backend(b), m_gpu(gpu)
|
|
|
|
@ -139,14 +139,14 @@ bool EglStreamBackend::initializeEgl()
|
|
|
|
|
if (m_gpu->devNode().compare(drmDeviceFile)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char *deviceExtensionCString = eglQueryDeviceStringEXT(device, EGL_EXTENSIONS);
|
|
|
|
|
QByteArray deviceExtensions = QByteArray::fromRawData(deviceExtensionCString,
|
|
|
|
|
qstrlen(deviceExtensionCString));
|
|
|
|
|
if (!deviceExtensions.split(' ').contains(QByteArrayLiteral("EGL_EXT_device_drm"))) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EGLint platformAttribs[] = {
|
|
|
|
|
EGL_DRM_MASTER_FD_EXT, m_gpu->fd(),
|
|
|
|
|
EGL_NONE
|
|
|
|
@ -161,7 +161,7 @@ bool EglStreamBackend::initializeEgl()
|
|
|
|
|
setFailed("No suitable EGL device found");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setEglDisplay(display);
|
|
|
|
|
if (!initEglAPI()) {
|
|
|
|
|
return false;
|
|
|
|
@ -202,7 +202,7 @@ EglStreamBackend::StreamTexture *EglStreamBackend::lookupStreamTexture(KWaylandS
|
|
|
|
|
{
|
|
|
|
|
auto it = m_streamTextures.find(surface);
|
|
|
|
|
return it != m_streamTextures.end() ?
|
|
|
|
|
&it.value() :
|
|
|
|
|
&it.value() :
|
|
|
|
|
nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -257,7 +257,7 @@ void EglStreamBackend::init()
|
|
|
|
|
setFailed("EGLStream backend requires atomic modesetting");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!initializeEgl()) {
|
|
|
|
|
setFailed("Failed to initialize EGL api");
|
|
|
|
|
return;
|
|
|
|
@ -355,11 +355,11 @@ bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput)
|
|
|
|
|
}
|
|
|
|
|
eglDestroySurface(eglDisplay(), o.eglSurface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (o.eglStream != EGL_NO_STREAM_KHR) {
|
|
|
|
|
pEglDestroyStreamKHR(eglDisplay(), o.eglStream);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
o.eglStream = stream;
|
|
|
|
|
o.eglSurface = eglSurface;
|
|
|
|
|
return true;
|
|
|
|
@ -394,7 +394,7 @@ bool EglStreamBackend::makeContextCurrent(const Output &output)
|
|
|
|
|
if (surface == EGL_NO_SURFACE) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (eglMakeCurrent(eglDisplay(), surface, surface, context()) == EGL_FALSE) {
|
|
|
|
|
qCCritical(KWIN_DRM) << "Failed to make EGL context current";
|
|
|
|
|
return false;
|
|
|
|
@ -405,7 +405,7 @@ bool EglStreamBackend::makeContextCurrent(const Output &output)
|
|
|
|
|
qCWarning(KWIN_DRM) << "Error occurred while making EGL context current" << error;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const QSize &overall = screens()->size();
|
|
|
|
|
const QRect &v = output.output->geometry();
|
|
|
|
|
qreal scale = output.output->scale();
|
|
|
|
|