imx: add Wayland GPU libs / Weston-imx support
cover imx: add Wayland GPU libs / Weston-imx support
Hi all,
This series adds Wayland support for the Vivante GPU libraries used by i.MX processors.
Adding Wayland configuration to the imx-gpu-viv was pretty straightforward since there was the x11/fb mechanism in place.
However, to get the Wayland libraries properly used in Weston it requires to use NXP weston-imx repo, other the gl-renderer isn't used for the fbdev backend.
This series will be particularly useful for the i.MX8M since the GPU libraries for this latter only supports Wayland backend (no more FB/X11 options).
The whole series was tested on i.MX6Q Nitrogen6x platform.
Let me know if you have any question.
Regards,
Gary
Gary Bisson (3):
imx-gpu-viv: add Wayland backend option
weston: remove dependency on mesa3d to enable egl
weston: add weston-imx variant when using imx-gpu-viv
package/freescale-imx/imx-gpu-viv/Config.in | 10 +++++++++- package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 10 ++++++++++ package/weston/weston.hash | 2 ++ package/weston/weston.mk | 10 ++++++++-- 4 files changed, 29 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.0
PATCH 1/3 imx-gpu-viv: add Wayland backend option
This package has been tested with Wayland back-end using weston-imx repository on a i.MX6Q Nitrogen6x:
https://source.codeaurora.org/external/imx/weston-imx/
(tag rel_imx_4.9.51_8mq_ga to work with both i.MX6 and i.MX8MQ)
Weston was started as follows:
# export XDG_RUNTIME_DIR=/tmp # weston --tty=1 --device=/dev/fb0
Finally the Vivante sample apps were started from weston-terminal:
# cd /usr/share/examples/viv_samples/vdk/ # ./tutorial7
--- package/freescale-imx/imx-gpu-viv/Config.in | 10 +++++++++- package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
package/freescale-imx/imx-gpu-viv/Config.in +9 -1
@@ -12,7 +12,7 @@ config BR2_PACKAGE_IMX_GPU_VIV select BR2_PACKAGE_HAS_LIBGLES select BR2_PACKAGE_HAS_LIBOPENVG help - Userspace libraries for Vivante GPU on i.MX6 platforms + Userspace libraries for Vivante GPU on i.MX platforms It contains libraries and headers for GLES, OpenCL, and OpenVG. It also contains a DRI plugin for X11. It also
@@ -44,12 +44,20 @@ comment "X11 backend needs Xorg package" config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_FB bool "Framebuffer" +config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL + bool "Wayland" + # libdrm needed by gbm_viv.so + select BR2_PACKAGE_LIBDRM + select BR2_PACKAGE_WAYLAND + select BR2_PACKAGE_HAS_LIBEGL_WAYLAND + endchoice config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT string default "x11" if BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 default "fb" if BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_FB + default "wl" if BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL config BR2_PACKAGE_PROVIDES_LIBEGL default "imx-gpu-viv"
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +10 -0
@@ -25,6 +25,10 @@ ifeq ($(IMX_GPU_VIV_LIB_TARGET),x11) IMX_GPU_VIV_DEPENDENCIES += xlib_libXdamage xlib_libXext xlib_libXfixes endif +ifeq ($(IMX_GPU_VIV_LIB_TARGET),wl) +IMX_GPU_VIV_DEPENDENCIES += libdrm wayland +endif + define IMX_GPU_VIV_EXTRACT_CMDS $(call FREESCALE_IMX_EXTRACT_HELPER,$(IMX_GPU_VIV_DL_DIR)/$(IMX_GPU_VIV_SOURCE)) endef
@@ -62,6 +66,12 @@ define IMX_GPU_VIV_FIXUP_PKGCONFIG endef endif +ifeq ($(IMX_GPU_VIV_LIB_TARGET),wl) +define IMX_GPU_VIV_FIXUP_PKGCONFIG + ln -sf egl_wayland.pc $(@D)/gpu-core/usr/lib/pkgconfig/egl.pc +endef +endif + ifeq ($(IMX_GPU_VIV_LIB_TARGET),x11) define IMX_GPU_VIV_FIXUP_PKGCONFIG for lib in egl gbm glesv1_cm glesv2 vg; do \
Signature · 1 line
2.17.0
Thomas Petazzoni
AppliedPATCH 1/3 imx-gpu-viv: add Wayland backend option
Hello,
Quoted 10 lines · Gary Bisson
This package has been tested with Wayland back-end using weston-imx repository on a i.MX6Q Nitrogen6x:
https://source.codeaurora.org/external/imx/weston-imx/
(tag rel_imx_4.9.51_8mq_ga to work with both i.MX6 and i.MX8MQ)Weston was started as follows:
# export XDG_RUNTIME_DIR=/tmp # weston --tty=1 --device=/dev/fb0Finally the Vivante sample apps were started from weston-terminal:
Quoted 8 lines
# cd /usr/share/examples/viv_samples/vdk/ # ./tutorial7Signed-off-by Gary Bisson <[email protected]>--- package/freescale-imx/imx-gpu-viv/Config.in | 10 +++++++++- package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH 2/3 weston: remove dependency on mesa3d to enable egl
In reply to Gary BissonOther packages can actually provide Wayland libraries like imx-gpu-viv.
--- package/weston/weston.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
package/weston/weston.mk +1 -2
@@ -50,8 +50,7 @@ else WESTON_CONF_OPTS += --disable-weston-launch endif -# Needs wayland-egl, which normally only mesa provides -ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_EGL)$(BR2_PACKAGE_MESA3D_OPENGL_ES),yy) +ifeq ($(BR2_PACKAGE_HAS_LIBEGL_WAYLAND),y) WESTON_CONF_OPTS += --enable-egl WESTON_DEPENDENCIES += libegl else
Signature · 1 line
2.17.0
Thomas Petazzoni
AppliedPATCH 2/3 weston: remove dependency on mesa3d to enable egl
Hello,
Quoted 6 lines · Gary Bisson
Other packages can actually provide Wayland libraries like imx-gpu-viv.
Signed-off-by Gary Bisson <[email protected]>--- package/weston/weston.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
In reply to Gary BissonThis variant contains various optimizations for i.MX processors.
For instance, on i.MX6/7 devices with GPU, the gl-renderer needs to be enabled for the fbdev-backend which was removed from upstream weston long time ago.
Also, weston-imx adds support for G2D which is enabled by default, this patch makes sure to disable it when imx-gpu-g2d isn't selected.
The tag version rel_imx_4.9.51_8mq_ga proved to work fine on both i.MX6Q/DL and i.MX8MQ processors.
Here are the commands used to start weston on i.MX6Q:
- Using 3D GPU (gl-renderer):
# weston --tty=1 --device=/dev/fb0 - Using 2D GPU (G2D): # weston --tty=1 --device=/dev/fb0 --use-g2d=1
Upstream repository:
https://source.codeaurora.org/external/imx/weston-imx/
--- package/weston/weston.hash | 2 ++ package/weston/weston.mk | 15 +++++++++++++++ 2 files changed, 17 insertions(+)
package/weston/weston.hash +2 -0
@@ -3,3 +3,5 @@ md5 33709aa4d5916f89643fca0fc0064b39 weston-4.0.0.tar.xz sha1 df1da4a880920c515162e95b18f3709a46690be7 weston-4.0.0.tar.xz sha256 a0fc0ae7ef83dfbed12abfe9b8096a24a7dd00705e86fa0db1e619ded18b4b58 weston-4.0.0.tar.xz sha512 0af41016ff4eae85779f95b5c5e44b9683f4ef681a8e52256efeebfa38073082b83e039d0db3c94ac22f22f8d8314c9d6cd16611144b260b353fc5bfdd1ded19 weston-4.0.0.tar.xz +# locally computed +sha256 0f0de7b7b1f65870139c95dde7abc19ed305631ae7c5d37c386db40cde108632 weston-rel_imx_4.9.51_8mq_ga.tar.gz
package/weston/weston.mk +15 -0
@@ -4,9 +4,16 @@ # ################################################################################ +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y) +WESTON_VERSION = rel_imx_4.9.51_8mq_ga +WESTON_SITE = https://source.codeaurora.org/external/imx/weston-imx +WESTON_SITE_METHOD = git +WESTON_AUTORECONF = YES +else WESTON_VERSION = 4.0.0 WESTON_SITE = http://wayland.freedesktop.org/releases WESTON_SOURCE = weston-$(WESTON_VERSION).tar.xz +endif WESTON_LICENSE = MIT WESTON_LICENSE_FILES = COPYING
@@ -50,6 +57,14 @@ else WESTON_CONF_OPTS += --disable-weston-launch endif +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y) +ifeq ($(BR2_PACKAGE_IMX_GPU_G2D),y) +WESTON_DEPENDENCIES += imx-gpu-g2d +else +WESTON_CONF_OPTS += --disable-imxg2d +endif +endif + ifeq ($(BR2_PACKAGE_HAS_LIBEGL_WAYLAND),y) WESTON_CONF_OPTS += --enable-egl WESTON_DEPENDENCIES += libegl
Signature · 1 line
2.17.0
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
Quoted 1 line · Gary Bisson
This variant contains various optimizations for i.MX processors.
Argh, this is annoying...
Quoted 40 lines
For instance, on i.MX6/7 devices with GPU, the gl-renderer needs to be enabled for the fbdev-backend which was removed from upstream weston long time ago.
Also, weston-imx adds support for G2D which is enabled by default, this patch makes sure to disable it when imx-gpu-g2d isn't selected.
The tag version rel_imx_4.9.51_8mq_ga proved to work fine on both i.MX6Q/DL and i.MX8MQ processors.
Here are the commands used to start weston on i.MX6Q:
- Using 3D GPU (gl-renderer):# weston --tty=1 --device=/dev/fb0 - Using 2D GPU (G2D): # weston --tty=1 --device=/dev/fb0 --use-g2d=1Upstream repository:
https://source.codeaurora.org/external/imx/weston-imx/Signed-off-by Gary Bisson <[email protected]>--- package/weston/weston.hash | 2 ++ package/weston/weston.mk | 15 +++++++++++++++ 2 files changed, 17 insertions(+)package/weston/weston.hash +2
-0@@ -3,3 +3,5 @@ md5 33709aa4d5916f89643fca0fc0064b39 weston-4.0.0.tar.xz sha1 df1da4a880920c515162e95b18f3709a46690be7 weston-4.0.0.tar.xz sha256 a0fc0ae7ef83dfbed12abfe9b8096a24a7dd00705e86fa0db1e619ded18b4b58 weston-4.0.0.tar.xz sha512 0af41016ff4eae85779f95b5c5e44b9683f4ef681a8e52256efeebfa38073082b83e039d0db3c94ac22f22f8d8314c9d6cd16611144b260b353fc5bfdd1ded19 weston-4.0.0.tar.xz +# locally computed +sha256 0f0de7b7b1f65870139c95dde7abc19ed305631ae7c5d37c386db40cde108632 weston-rel_imx_4.9.51_8mq_ga.tar.gzpackage/weston/weston.mk +0
-0
package/weston/weston.mk line 7
Quoted 4 lines
package/weston/weston.mk +1
-0@@ -4,9 +4,16 @@ # ################################################################################ +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y)
It is not entirely impossible that people use Buildroot to generate a rootfs
that should be able to boot on several CPUs, in which case they may not want to use the NXP fork of weston. So, I'd make an explicit Config.in option for this:
if BR2_PACKAGE_WESTON
config BR2_PACKAGE_WESTON_IMX
bool "weston-imx"
default y
depends on BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
help
On i.MX6/7/8 platforms, a fork of weston can be used that enables various optimisations for this platform. Blah blah blah.
http://some-url-that-explains-it
endif
But maybe I'm exaggerating.
Quoted 13 lines
package/weston/weston.mk +6
-0+WESTON_VERSION = rel_imx_4.9.51_8mq_ga +WESTON_SITE = https://source.codeaurora.org/external/imx/weston-imx +WESTON_SITE_METHOD = git +WESTON_AUTORECONF = YES +else WESTON_VERSION = 4.0.0 WESTON_SITE = http://wayland.freedesktop.org/releases WESTON_SOURCE = weston-$(WESTON_VERSION).tar.xz +endif WESTON_LICENSE = MIT WESTON_LICENSE_FILES = COPYING
package/weston/weston.mk else · line 61
Quoted 5 lines
package/weston/weston.mk +2
-0@@ -50,6 +57,14 @@ else WESTON_CONF_OPTS += --disable-weston-launch endif +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y) +ifeq ($(BR2_PACKAGE_IMX_GPU_G2D),y)
WESTON_CONF_OPTS += --enable-imxg2d
With that:
Quoted 10 lines
package/weston/weston.mk +6
-0+WESTON_DEPENDENCIES += imx-gpu-g2d +else +WESTON_CONF_OPTS += --disable-imxg2d +endif +endif + ifeq ($(BR2_PACKAGE_HAS_LIBEGL_WAYLAND),y) WESTON_CONF_OPTS += --enable-egl WESTON_DEPENDENCIES += libegl
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
Hi Arnout,
Quoted 6 lines · Arnout Vandecappelle
Quoted 1 line · Gary Bisson
This variant contains various optimizations for i.MX processors.
Argh, this is annoying...
Yeah I know, I felt the same way.
Quoted 58 lines
Quoted 40 lines
For instance, on i.MX6/7 devices with GPU, the gl-renderer needs to be enabled for the fbdev-backend which was removed from upstream weston long time ago.
Also, weston-imx adds support for G2D which is enabled by default, this patch makes sure to disable it when imx-gpu-g2d isn't selected.
The tag version rel_imx_4.9.51_8mq_ga proved to work fine on both i.MX6Q/DL and i.MX8MQ processors.
Here are the commands used to start weston on i.MX6Q:
- Using 3D GPU (gl-renderer):# weston --tty=1 --device=/dev/fb0 - Using 2D GPU (G2D): # weston --tty=1 --device=/dev/fb0 --use-g2d=1Upstream repository:
https://source.codeaurora.org/external/imx/weston-imx/Signed-off-by Gary Bisson <[email protected]>--- package/weston/weston.hash | 2 ++ package/weston/weston.mk | 15 +++++++++++++++ 2 files changed, 17 insertions(+)package/weston/weston.hash +2
-0@@ -3,3 +3,5 @@ md5 33709aa4d5916f89643fca0fc0064b39 weston-4.0.0.tar.xz sha1 df1da4a880920c515162e95b18f3709a46690be7 weston-4.0.0.tar.xz sha256 a0fc0ae7ef83dfbed12abfe9b8096a24a7dd00705e86fa0db1e619ded18b4b58 weston-4.0.0.tar.xz sha512 0af41016ff4eae85779f95b5c5e44b9683f4ef681a8e52256efeebfa38073082b83e039d0db3c94ac22f22f8d8314c9d6cd16611144b260b353fc5bfdd1ded19 weston-4.0.0.tar.xz +# locally computed +sha256 0f0de7b7b1f65870139c95dde7abc19ed305631ae7c5d37c386db40cde108632 weston-rel_imx_4.9.51_8mq_ga.tar.gzpackage/weston/weston.mk +0
-0package/weston/weston.mk line 7
Quoted 4 lines
package/weston/weston.mk +1
-0@@ -4,9 +4,16 @@ # ################################################################################ +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y)It is not entirely impossible that people use Buildroot to generate a rootfs
that should be able to boot on several CPUs, in which case they may not want to use the NXP fork of weston. So, I'd make an explicit Config.in option for this:if
BR2_PACKAGE_WESTON
configBR2_PACKAGE_WESTON_IMX
bool "weston-imx"
default y
depends onBR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
help
On i.MX6/7/8 platforms, a fork of weston can be used that enables various optimisations for this platform. Blah blah blah.
Quoted 4 lines
http://some-url-that-explains-it
endifBut maybe I'm exaggerating.
I'm ok with that approach too. I'll let the others comment before making the V2.
Yann, Thomas, what do you prefer?
Quoted 12 lines
Quoted 12 lines
package/weston/weston.mk +6
-0+WESTON_VERSION = rel_imx_4.9.51_8mq_ga +WESTON_SITE = https://source.codeaurora.org/external/imx/weston-imx +WESTON_SITE_METHOD = git +WESTON_AUTORECONF = YES +else WESTON_VERSION = 4.0.0 WESTON_SITE = http://wayland.freedesktop.org/releases WESTON_SOURCE = weston-$(WESTON_VERSION).tar.xz +endif WESTON_LICENSE = MIT WESTON_LICENSE_FILES = COPYING
Quoted 8 lines
package/weston/weston.mk else · line 61
Quoted 6 lines
package/weston/weston.mk +2
-0@@ -50,6 +57,14 @@ else WESTON_CONF_OPTS += --disable-weston-launch endif +ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y) +ifeq ($(BR2_PACKAGE_IMX_GPU_G2D),y)
WESTON_CONF_OPTS+= --enable-imxg2d
Ok, I forgot you wanted that --enable-xxx options to be explicit although it ends up in the 'unrecognized options'.
Quoted 2 lines
With that:
Thanks for the review. I'll add that in the V2 once it is decided what to do about the config option.
Regards,
Gary
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
Quoted 6 lines · Gary Bisson
Hi Arnout,
Quoted 3 lines · Arnout Vandecappelle
On 16-05-18 17:52, Gary Bisson wrote:
[snip]
Quoted 7 lines
Quoted 4 lines
package/weston/weston.mk else · line 61
Quoted 2 lines
package/weston/weston.mk +2
-0+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y) +ifeq ($(BR2_PACKAGE_IMX_GPU_G2D),y)
WESTON_CONF_OPTS+= --enable-imxg2dOk, I forgot you wanted that --enable-xxx options to be explicit although it ends up in the 'unrecognized options'.
So I took a look at the configure.ac, and of course they got it wrong;
--enable-imxg2d will disable it. So your patch was correct.
Reading documentation is apparently difficult :-)
Since I'm not entirely convinced of the config option myself anyway:
Regards,
Arnout
Quoted 7 lines
Thanks for the review. I'll add that in the V2 once it is decided what to do about the config option.
Regards,
Gary
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
Hi Arnout
Quoted 15 lines · Arnout Vandecappelle
Quoted 6 lines · Gary Bisson
Hi Arnout,
Quoted 3 lines · Arnout Vandecappelle
On 16-05-18 17:52, Gary Bisson wrote:
[snip]
Quoted 5 lines
Quoted 4 lines
package/weston/weston.mk else · line 61
Quoted 2 lines
package/weston/weston.mk +2
-0+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),y) +ifeq ($(BR2_PACKAGE_IMX_GPU_G2D),y)
WESTON_CONF_OPTS+= --enable-imxg2d
Quoted 7 lines
Quoted 2 lines
Ok, I forgot you wanted that --enable-xxx options to be explicit although it ends up in the 'unrecognized options'.
So I took a look at the configure.ac, and of course they got it wrong;
--enable-imxg2d will disable it. So your patch was correct.Reading documentation is apparently difficult :-)
Haha, thanks for checking.
Quoted 3 lines
Since I'm not entirely convinced of the config option myself anyway:
Thomas, I've seen you applied the rest of the series, do you have any objection about that patch?
Regards,
Gary
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
Hello,
Quoted 6 lines · Gary Bisson
Quoted 3 lines
Since I'm not entirely convinced of the config option myself anyway:
Thomas, I've seen you applied the rest of the series, do you have any objection about that patch?
No, not really. Since it was a bit more "controversial", I left it in the pending queue for a longer period of time. This way, when I finally apply it, if someone complains, I can say that it has been pending for quite some time without anybody complaining :-)
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
PATCH 3/3 weston: add weston-imx variant when using imx-gpu-viv
Quoted 8 lines · Thomas Petazzoni
Hello,
Quoted 4 lines · Gary Bisson
Quoted 3 lines
Since I'm not entirely convinced of the config option myself anyway:
Quoted 7 lines
Quoted 2 lines
Thomas, I've seen you applied the rest of the series, do you have any objection about that patch?
No, not really. Since it was a bit more "controversial", I left it in the pending queue for a longer period of time. This way, when I finally apply it, if someone complains, I can say that it has been pending for quite some time without anybody complaining :-)
The period has passed, so applied to master, thanks.
Regards,
Arnout