diff mbox series

[RFC,v4,3/3] package/qt5/qt5wayland: fix compile for rpi3

Message ID 20200403212357.26997-3-ps.report@gmx.net
State New
Headers show
Series [RFC,v4,1/3] package/qt5: bump version to 5.13.2 | expand

Commit Message

Peter Seiderer April 3, 2020, 9:23 p.m. UTC
Add three patches to fix compile for rpi3.

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Changes v3 -> v4:
  - new patch
---
 ...ibdrm-related-configure-test-failure.patch | 56 +++++++++++++++++++
 ...ayland-scanner-client-wayland-protoc.patch | 36 ++++++++++++
 ...land-texture-sharing-custom-composit.patch | 42 ++++++++++++++
 3 files changed, 134 insertions(+)
 create mode 100644 package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
 create mode 100644 package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
 create mode 100644 package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch

Comments

Thomas Petazzoni April 11, 2020, 1:03 p.m. UTC | #1
On Fri,  3 Apr 2020 23:23:57 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> Add three patches to fix compile for rpi3.
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>

I'm not super at ease with the patches. Especially, I'm always worried
about a commit that fixes things for one particular platform: patches 1
and 3 don't seem at all related to Rpi3 specifically.

> diff --git a/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch b/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
> new file mode 100644
> index 0000000000..b4d0a2c302
> --- /dev/null
> +++ b/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
> @@ -0,0 +1,56 @@
> +From ba93ccba2aa70bd76f0af43675fa5864e166e3c3 Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Fri, 3 Apr 2020 21:52:30 +0200
> +Subject: [PATCH 1/3] fix libdrm related configure test failure

Nit: use git format-patch -N to generate patches.

> +
> +Fixes:
> +
> +  Project ERROR: Test config.qtwayland_client.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
> +  Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
> +  Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-client-buffer tries to use undeclared library 'drm'
> +
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>

Should the "drm" library be declared somewhere instead? How is this
building for upstream?

> diff --git a/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch b/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
> new file mode 100644
> index 0000000000..f14c374e76
> --- /dev/null
> +++ b/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
> @@ -0,0 +1,36 @@
> +From 4770af94884be5a603934b36e6804eed7d18d43c Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Fri, 3 Apr 2020 22:42:23 +0200
> +Subject: [PATCH 2/3] brcm-egl: needs
> + wayland-scanner-client-wayland-protocol-include
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Fixes:
> +
> +  wayland-brcm-client-protocol.h: In function ‘wl_buffer* qt_brcm_create_buffer(qt_brcm*, int32_t, int32_t, wl_array*)’:
> +  wayland-brcm-client-protocol.h:115:29: error: ‘wl_buffer_interface’ was not declared in this scope; did you mean ‘qt_brcm_interface’?
> +    115 |     QT_BRCM_CREATE_BUFFER, &wl_buffer_interface, NULL, width, height, data);
> +        |                             ^~~~~~~~~~~~~~~~~~~
> +        |                             qt_brcm_interface
> +
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>

A bit more explanation on the relationship between the build issue and
the fix would be good.

> diff --git a/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch b/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch
> new file mode 100644
> index 0000000000..1f0f919c93
> --- /dev/null
> +++ b/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch
> @@ -0,0 +1,42 @@
> +From f7d96ddd00f868810ed2ca260acd41435717e6b8 Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Fri, 3 Apr 2020 22:40:29 +0200
> +Subject: [PATCH 3/3] examples: fix wayland/texture-sharing/custom-compositor
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Fixes:
> +
> +  main.cpp:83:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’?
> +     83 |             *glInternalFormat = GL_RGBA8;
> +        |                                 ^~~~~~~~
> +        |                                 GL_RGBA4
> +  main.cpp:120:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’?
> +    120 |             *glInternalFormat = GL_RGBA8;
> +        |                                 ^~~~~~~~
> +        |                                 GL_RGBA4
> +
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> +---
> + examples/wayland/texture-sharing/custom-compositor/main.cpp | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/examples/wayland/texture-sharing/custom-compositor/main.cpp b/examples/wayland/texture-sharing/custom-compositor/main.cpp
> +index a39c8c3..af37502 100644
> +--- a/examples/wayland/texture-sharing/custom-compositor/main.cpp
> ++++ b/examples/wayland/texture-sharing/custom-compositor/main.cpp
> +@@ -63,6 +63,10 @@
> + 
> + #include "QtWaylandCompositor/private/qwltexturesharingextension_p.h"
> + 
> ++#ifndef GL_RGBA8
> ++#define GL_RGBA8 0x8058
> ++#endif

This feels like a hack. What should normally be providing the GL_RGBA8
define? The OpenGL headers?

Thomas
Peter Seiderer April 11, 2020, 3:24 p.m. UTC | #2
Hello Thomas,

On Sat, 11 Apr 2020 15:03:47 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Fri,  3 Apr 2020 23:23:57 +0200
> Peter Seiderer <ps.report@gmx.net> wrote:
> 
> > Add three patches to fix compile for rpi3.
> > 
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>  
> 
> I'm not super at ease with the patches. Especially, I'm always worried
> about a commit that fixes things for one particular platform: patches 1
> and 3 don't seem at all related to Rpi3 specifically.

That is why this is sent as an extra patch (and as RFC)...should have marked
it as WIP ;-)
 
> 
> > diff --git a/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch b/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
> > new file mode 100644
> > index 0000000000..b4d0a2c302
> > --- /dev/null
> > +++ b/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
> > @@ -0,0 +1,56 @@
> > +From ba93ccba2aa70bd76f0af43675fa5864e166e3c3 Mon Sep 17 00:00:00 2001
> > +From: Peter Seiderer <ps.report@gmx.net>
> > +Date: Fri, 3 Apr 2020 21:52:30 +0200
> > +Subject: [PATCH 1/3] fix libdrm related configure test failure  
> 
> Nit: use git format-patch -N to generate patches.

Ups..., will do....

> 
> > +
> > +Fixes:
> > +
> > +  Project ERROR: Test config.qtwayland_client.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
> > +  Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
> > +  Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-client-buffer tries to use undeclared library 'drm'
> > +
> > +Signed-off-by: Peter Seiderer <ps.report@gmx.net>  
> 
> Should the "drm" library be declared somewhere instead? How is this
> building for upstream?

Seems they always build with libdrm available....

Did not find the right way to fix it for the qt configure framework,
but opened an upstream bug report [1], [2]...but no feedback yet...

> 
> > diff --git a/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch b/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
> > new file mode 100644
> > index 0000000000..f14c374e76
> > --- /dev/null
> > +++ b/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
> > @@ -0,0 +1,36 @@
> > +From 4770af94884be5a603934b36e6804eed7d18d43c Mon Sep 17 00:00:00 2001
> > +From: Peter Seiderer <ps.report@gmx.net>
> > +Date: Fri, 3 Apr 2020 22:42:23 +0200
> > +Subject: [PATCH 2/3] brcm-egl: needs
> > + wayland-scanner-client-wayland-protocol-include
> > +MIME-Version: 1.0
> > +Content-Type: text/plain; charset=UTF-8
> > +Content-Transfer-Encoding: 8bit
> > +
> > +Fixes:
> > +
> > +  wayland-brcm-client-protocol.h: In function ‘wl_buffer* qt_brcm_create_buffer(qt_brcm*, int32_t, int32_t, wl_array*)’:
> > +  wayland-brcm-client-protocol.h:115:29: error: ‘wl_buffer_interface’ was not declared in this scope; did you mean ‘qt_brcm_interface’?
> > +    115 |     QT_BRCM_CREATE_BUFFER, &wl_buffer_interface, NULL, width, height, data);
> > +        |                             ^~~~~~~~~~~~~~~~~~~
> > +        |                             qt_brcm_interface
> > +
> > +Signed-off-by: Peter Seiderer <ps.report@gmx.net>  
> 
> A bit more explanation on the relationship between the build issue and
> the fix would be good.

Will try give an better explanation...., positive feedback from
upstream [3], [4]..., only the target branch seems questionable...

> 
> > diff --git a/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch b/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch
> > new file mode 100644
> > index 0000000000..1f0f919c93
> > --- /dev/null
> > +++ b/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch
> > @@ -0,0 +1,42 @@
> > +From f7d96ddd00f868810ed2ca260acd41435717e6b8 Mon Sep 17 00:00:00 2001
> > +From: Peter Seiderer <ps.report@gmx.net>
> > +Date: Fri, 3 Apr 2020 22:40:29 +0200
> > +Subject: [PATCH 3/3] examples: fix wayland/texture-sharing/custom-compositor
> > +MIME-Version: 1.0
> > +Content-Type: text/plain; charset=UTF-8
> > +Content-Transfer-Encoding: 8bit
> > +
> > +Fixes:
> > +
> > +  main.cpp:83:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’?
> > +     83 |             *glInternalFormat = GL_RGBA8;
> > +        |                                 ^~~~~~~~
> > +        |                                 GL_RGBA4
> > +  main.cpp:120:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’?
> > +    120 |             *glInternalFormat = GL_RGBA8;
> > +        |                                 ^~~~~~~~
> > +        |                                 GL_RGBA4
> > +
> > +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> > +---
> > + examples/wayland/texture-sharing/custom-compositor/main.cpp | 4 ++++
> > + 1 file changed, 4 insertions(+)
> > +
> > +diff --git a/examples/wayland/texture-sharing/custom-compositor/main.cpp b/examples/wayland/texture-sharing/custom-compositor/main.cpp
> > +index a39c8c3..af37502 100644
> > +--- a/examples/wayland/texture-sharing/custom-compositor/main.cpp
> > ++++ b/examples/wayland/texture-sharing/custom-compositor/main.cpp
> > +@@ -63,6 +63,10 @@
> > + 
> > + #include "QtWaylandCompositor/private/qwltexturesharingextension_p.h"
> > + 
> > ++#ifndef GL_RGBA8
> > ++#define GL_RGBA8 0x8058
> > ++#endif  
> 
> This feels like a hack. What should normally be providing the GL_RGBA8
> define? The OpenGL headers?

Same 'hack' is used at some other Qt locations and patch is
upstream accepted [5], [6] as is ;-)

Will wait some time for more feedback...., and provide an updated
buildroot patch soon...

Regards,
Peter

[1] https://bugreports.qt.io/browse/QTBUG-83303
[2] https://codereview.qt-project.org/c/qt/qtwayland/+/296213
[3] https://bugreports.qt.io/browse/QTBUG-83305
[4] https://codereview.qt-project.org/c/qt/qtwayland/+/296215
[5] https://bugreports.qt.io/browse/QTBUG-83304
[6] https://codereview.qt-project.org/c/qt/qtwayland/+/296214

> 
> Thomas
diff mbox series

Patch

diff --git a/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch b/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
new file mode 100644
index 0000000000..b4d0a2c302
--- /dev/null
+++ b/package/qt5/qt5wayland/0001-fix-libdrm-related-configure-test-failure.patch
@@ -0,0 +1,56 @@ 
+From ba93ccba2aa70bd76f0af43675fa5864e166e3c3 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Fri, 3 Apr 2020 21:52:30 +0200
+Subject: [PATCH 1/3] fix libdrm related configure test failure
+
+Fixes:
+
+  Project ERROR: Test config.qtwayland_client.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
+  Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
+  Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-client-buffer tries to use undeclared library 'drm'
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ src/client/configure.json     | 3 ++-
+ src/compositor/configure.json | 6 ++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/client/configure.json b/src/client/configure.json
+index 0621396..27c73f8 100644
+--- a/src/client/configure.json
++++ b/src/client/configure.json
+@@ -74,7 +74,8 @@
+             "label": "Linux dma-buf Buffer Sharing",
+             "type": "compile",
+             "test": "dmabuf_server_buffer",
+-            "use": "egl drm"
++            "libs": "-ldrm",
++            "use": "egl"
+         },
+         "vulkan-server-buffer": {
+             "label": "Vulkan Buffer Sharing",
+diff --git a/src/compositor/configure.json b/src/compositor/configure.json
+index 0dbb336..73e4c1a 100644
+--- a/src/compositor/configure.json
++++ b/src/compositor/configure.json
+@@ -80,13 +80,15 @@
+             "label": "Linux dma-buf Buffer Sharing",
+             "type": "compile",
+             "test": "dmabuf_server_buffer",
+-            "use": "egl drm"
++            "libs": "-ldrm",
++            "use": "egl"
+         },
+         "dmabuf-client-buffer": {
+             "label": "Linux Client dma-buf Buffer Sharing",
+             "type": "compile",
+             "test": "dmabuf_client_buffer",
+-            "use": "egl drm"
++            "libs": "-ldrm",
++            "use": "egl"
+         },
+         "vulkan-server-buffer": {
+             "label": "Vulkan Buffer Sharing",
+-- 
+2.26.0
+
diff --git a/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch b/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
new file mode 100644
index 0000000000..f14c374e76
--- /dev/null
+++ b/package/qt5/qt5wayland/0002-brcm-egl-needs-wayland-scanner-client-wayland-protoc.patch
@@ -0,0 +1,36 @@ 
+From 4770af94884be5a603934b36e6804eed7d18d43c Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Fri, 3 Apr 2020 22:42:23 +0200
+Subject: [PATCH 2/3] brcm-egl: needs
+ wayland-scanner-client-wayland-protocol-include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+  wayland-brcm-client-protocol.h: In function ‘wl_buffer* qt_brcm_create_buffer(qt_brcm*, int32_t, int32_t, wl_array*)’:
+  wayland-brcm-client-protocol.h:115:29: error: ‘wl_buffer_interface’ was not declared in this scope; did you mean ‘qt_brcm_interface’?
+    115 |     QT_BRCM_CREATE_BUFFER, &wl_buffer_interface, NULL, width, height, data);
+        |                             ^~~~~~~~~~~~~~~~~~~
+        |                             qt_brcm_interface
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ src/hardwareintegration/client/brcm-egl/brcm-egl.pri | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
+index f9f8d07..95eb86e 100644
+--- a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
++++ b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
+@@ -11,5 +11,5 @@ HEADERS += $$PWD/qwaylandbrcmeglintegration.h \
+            $$PWD/qwaylandbrcmglcontext.h \
+            $$PWD/qwaylandbrcmeglwindow.h
+ 
+-CONFIG += wayland-scanner
++CONFIG += wayland-scanner-client-wayland-protocol-include
+ WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/brcm.xml
+-- 
+2.26.0
+
diff --git a/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch b/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch
new file mode 100644
index 0000000000..1f0f919c93
--- /dev/null
+++ b/package/qt5/qt5wayland/0003-examples-fix-wayland-texture-sharing-custom-composit.patch
@@ -0,0 +1,42 @@ 
+From f7d96ddd00f868810ed2ca260acd41435717e6b8 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Fri, 3 Apr 2020 22:40:29 +0200
+Subject: [PATCH 3/3] examples: fix wayland/texture-sharing/custom-compositor
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes:
+
+  main.cpp:83:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’?
+     83 |             *glInternalFormat = GL_RGBA8;
+        |                                 ^~~~~~~~
+        |                                 GL_RGBA4
+  main.cpp:120:33: error: ‘GL_RGBA8’ was not declared in this scope; did you mean ‘GL_RGBA4’?
+    120 |             *glInternalFormat = GL_RGBA8;
+        |                                 ^~~~~~~~
+        |                                 GL_RGBA4
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ examples/wayland/texture-sharing/custom-compositor/main.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/examples/wayland/texture-sharing/custom-compositor/main.cpp b/examples/wayland/texture-sharing/custom-compositor/main.cpp
+index a39c8c3..af37502 100644
+--- a/examples/wayland/texture-sharing/custom-compositor/main.cpp
++++ b/examples/wayland/texture-sharing/custom-compositor/main.cpp
+@@ -63,6 +63,10 @@
+ 
+ #include "QtWaylandCompositor/private/qwltexturesharingextension_p.h"
+ 
++#ifndef GL_RGBA8
++#define GL_RGBA8 0x8058
++#endif
++
+ class CustomSharingExtension : public QWaylandTextureSharingExtension
+ {
+     Q_OBJECT
+-- 
+2.26.0
+