Merge branch 'Plasma/5.7'
commit
d443e54901
|
@ -80,6 +80,11 @@ bool AbstractEglBackend::initEglAPI()
|
|||
{
|
||||
EGLint major, minor;
|
||||
if (eglInitialize(m_display, &major, &minor) == EGL_FALSE) {
|
||||
qCWarning(KWIN_CORE) << "eglInitialize failed";
|
||||
EGLint error = eglGetError();
|
||||
if (error != EGL_SUCCESS) {
|
||||
qCWarning(KWIN_CORE) << "Error during eglInitialize " << error;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
EGLint error = eglGetError();
|
||||
|
|
|
@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
|
||||
// system
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
// drm
|
||||
#include <xf86drm.h>
|
||||
#if HAVE_GBM
|
||||
|
@ -44,13 +45,16 @@ DrmBuffer::DrmBuffer(DrmBackend *backend, const QSize &size)
|
|||
createArgs.width = size.width();
|
||||
createArgs.height = size.height();
|
||||
if (drmIoctl(m_backend->fd(), DRM_IOCTL_MODE_CREATE_DUMB, &createArgs) != 0) {
|
||||
qCWarning(KWIN_DRM) << "DRM_IOCTL_MODE_CREATE_DUMB failed";
|
||||
return;
|
||||
}
|
||||
m_handle = createArgs.handle;
|
||||
m_bufferSize = createArgs.size;
|
||||
m_stride = createArgs.pitch;
|
||||
drmModeAddFB(m_backend->fd(), size.width(), size.height(), 24, 32,
|
||||
m_stride, createArgs.handle, &m_bufferId);
|
||||
if (drmModeAddFB(m_backend->fd(), size.width(), size.height(), 24, 32,
|
||||
m_stride, createArgs.handle, &m_bufferId) != 0) {
|
||||
qCWarning(KWIN_DRM) << "drmModeAddFB failed with errno" << errno;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -179,8 +179,10 @@ bool EglOnXBackend::initRenderingContext()
|
|||
setHavePlatformBase(havePlatformBase);
|
||||
if (havePlatformBase) {
|
||||
// Make sure that the X11 platform is supported
|
||||
if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_x11")))
|
||||
if (!hasClientExtension(QByteArrayLiteral("EGL_EXT_platform_x11"))) {
|
||||
qCWarning(KWIN_CORE) << "EGL_EXT_platform_base is supported, but EGL_EXT_platform_x11 is not. Cannot create EGLDisplay on X11";
|
||||
return false;
|
||||
}
|
||||
|
||||
const int attribs[] = {
|
||||
EGL_PLATFORM_X11_SCREEN_EXT, m_x11ScreenNumber,
|
||||
|
@ -192,8 +194,10 @@ bool EglOnXBackend::initRenderingContext()
|
|||
dpy = eglGetDisplay(m_x11Display);
|
||||
}
|
||||
|
||||
if (dpy == EGL_NO_DISPLAY)
|
||||
if (dpy == EGL_NO_DISPLAY) {
|
||||
qCWarning(KWIN_CORE) << "Failed to get the EGLDisplay";
|
||||
return false;
|
||||
}
|
||||
setEglDisplay(dpy);
|
||||
initEglAPI();
|
||||
|
||||
|
|
Loading…
Reference in New Issue