aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase-git/0008-eglfs-fix-egl-error-for-platforms-only-supporting-on.patch
blob: 650dd9dd8d1a29a09d9d16ea9cc428abcdea72e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
From b6776c9f0da5988013d5195592b84e313b79daab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Wed, 5 Feb 2014 18:35:08 +0100
Subject: [PATCH 08/12] eglfs: fix egl error for platforms only supporting one
 window/surface
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

running qmlscene -platform eglfs <filename>.qml

caused

EGL Error : Could not create the egl surface: error = 0x3003

Rebased version of [1-2]

Upstream-Status: unknown

[1] http://repository.timesys.com/buildsources/q/qt-everywhere-opensource/qt-everywhere-opensource-5.1.1/qt-everywhere-opensource-5.1.1-qeglfswindow.cpp.patch
[2] https://github.com/prabindh/qt-configs/blob/master/qt5_1.0_Feb13/qeglfswindow.cpp.patch

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 src/plugins/platforms/eglfs/qeglfswindow.cpp | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 39a3ef9..2c05979 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -68,6 +68,15 @@ void QEglFSWindow::create()
 
     m_flags = Created;
 
+    static EGLSurface __singleWindowSurface;
+    if(QEglFSHooks::hooks() && ! QEglFSHooks::hooks()->hasCapability(QPlatformIntegration::MultipleWindows) && (__singleWindowSurface)) {
+        m_surface = __singleWindowSurface;
+#ifdef QEGL_EXTRA_DEBUG
+        qWarning("Surface recreate request, re-using %x\n", m_surface);
+#endif
+        return;
+    }
+
     if (window()->type() == Qt::Desktop)
         return;
 
@@ -81,7 +90,7 @@ void QEglFSWindow::create()
             return;
         }
 
-#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK)
+#if !defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK) || defined(EGL_API_FB)
         // We can have either a single OpenGL window or multiple raster windows.
         // Other combinations cannot work.
         qFatal("EGLFS: OpenGL windows cannot be mixed with others.");
@@ -101,6 +110,11 @@ void QEglFSWindow::create()
 
     resetSurface();
 
+    if(QEglFSHooks::hooks() && !QEglFSHooks::hooks()->hasCapability(QPlatformIntegration::MultipleWindows))
+    {
+        __singleWindowSurface = m_surface;
+    }
+
     screen->setPrimarySurface(m_surface);
 
     if (isRaster()) {
-- 
2.3.0