All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider
@ 2021-01-07 11:04 Romain Naour
  2021-01-07 11:04 ` [Buildroot] [RFC: 2/4] package/freescale-imx/imx-gpu-viv: avoid removing openGL headers when mesa3d is also selected Romain Naour
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Romain Naour @ 2021-01-07 11:04 UTC (permalink / raw)
  To: buildroot

libGL.so is installed when BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 or BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
is selected, so declare it as a libgl provider.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>
---

Not related to this patch but mesa3d-demo doesn't build with imx-gpu-viv
as GL provider. meta-freescale provide a patch that replace glWindowPos2iARB
calls with glWindowPos2i but it was rejected by upstream.

https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
---
 package/freescale-imx/imx-gpu-viv/Config.in      | 6 ++++++
 package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/freescale-imx/imx-gpu-viv/Config.in b/package/freescale-imx/imx-gpu-viv/Config.in
index cca2689905..4e53044d1d 100644
--- a/package/freescale-imx/imx-gpu-viv/Config.in
+++ b/package/freescale-imx/imx-gpu-viv/Config.in
@@ -44,6 +44,7 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11
 	select BR2_PACKAGE_XLIB_LIBXDAMAGE
 	select BR2_PACKAGE_XLIB_LIBXEXT
 	select BR2_PACKAGE_XLIB_LIBXFIXES
+	select BR2_PACKAGE_HAS_LIBGL # libGL-x11.so
 
 comment "X11 backend needs Xorg package"
 	depends on !BR2_PACKAGE_XORG7
@@ -60,6 +61,7 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_WAYLAND
 	select BR2_PACKAGE_HAS_LIBEGL_WAYLAND
+	select BR2_PACKAGE_HAS_LIBGL # libGL-wl.so
 
 endchoice
 
@@ -72,6 +74,10 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT
 config BR2_PACKAGE_PROVIDES_LIBEGL
 	default "imx-gpu-viv"
 
+config BR2_PACKAGE_PROVIDES_LIBGL
+	default "imx-gpu-viv" if BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 || \
+		BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
+
 config BR2_PACKAGE_PROVIDES_LIBGLES
 	default "imx-gpu-viv"
 
diff --git a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
index 6ae9aa7acc..f03415b336 100644
--- a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
+++ b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
@@ -61,7 +61,7 @@ endif
 
 ifeq ($(IMX_GPU_VIV_LIB_TARGET),x11)
 define IMX_GPU_VIV_FIXUP_PKGCONFIG
-	for lib in egl gbm glesv1_cm glesv2 vg; do \
+	for lib in egl gbm glesv1_cm glesv2 gl vg; do \
 		ln -sf $${lib}_x11.pc $(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc || exit 1; \
 	done
 endef
@@ -70,7 +70,7 @@ endif
 define IMX_GPU_VIV_INSTALL_STAGING_CMDS
 	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
 	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
-	for lib in egl gbm glesv1_cm glesv2 vg; do \
+	for lib in egl gbm glesv1_cm glesv2 gl vg; do \
 		$(INSTALL) -m 0644 -D \
 			$(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc \
 			$(STAGING_DIR)/usr/lib/pkgconfig/$${lib}.pc; \
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 2/4] package/freescale-imx/imx-gpu-viv: avoid removing openGL headers when mesa3d is also selected
  2021-01-07 11:04 [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Romain Naour
@ 2021-01-07 11:04 ` Romain Naour
  2021-01-07 11:04 ` [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0 Romain Naour
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Romain Naour @ 2021-01-07 11:04 UTC (permalink / raw)
  To: buildroot

If selected, mesa3d package will remove openGL headers from staging
directory when GLX support (libGL provider) is not selected.
Add mesa3d in imx-gpu-viv dependencies to avoid removing openGL
headers provivded by this package.

xdriver_xf86-video-imx-viv package depends on imx-gpu-viv but
also select mesa3d package for DRI swrast driver.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>
---
 package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
index f03415b336..96195f0723 100644
--- a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
+++ b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
@@ -33,6 +33,14 @@ ifeq ($(IMX_GPU_VIV_LIB_TARGET),wayland)
 IMX_GPU_VIV_DEPENDENCIES += libdrm wayland
 endif
 
+# If selected, mesa3d package will remove openGL headers from staging
+# directory when GLX support (libGL provider) is not selected.
+# Add mesa3d in imx-gpu-viv dependencies to avoid to remove openGL
+# headers provivded by this package.
+ifeq ($(BR2_PACKAGE_MESA3D):$(BR2_PACKAGE_MESA3D_OPENGL_GLX),y:)
+IMX_GPU_VIV_DEPENDENCIES += mesa3d
+endif
+
 define IMX_GPU_VIV_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(IMX_GPU_VIV_DL_DIR)/$(IMX_GPU_VIV_SOURCE))
 endef
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
  2021-01-07 11:04 [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Romain Naour
  2021-01-07 11:04 ` [Buildroot] [RFC: 2/4] package/freescale-imx/imx-gpu-viv: avoid removing openGL headers when mesa3d is also selected Romain Naour
@ 2021-01-07 11:04 ` Romain Naour
  2021-01-10 17:46   ` Romain Naour
  2021-01-07 11:04 ` [Buildroot] [RFC: 4/4] package/x11r7/xdriver_xf86-video-imx-viv: select dri swrast driver Romain Naour
  2021-01-07 17:04 ` [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Yann E. MORIN
  3 siblings, 1 reply; 13+ messages in thread
From: Romain Naour @ 2021-01-07 11:04 UTC (permalink / raw)
  To: buildroot

This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.

Don't override CFLAGS on the command line otherwise we loose some include paths
(ex: -I./vivante_gal).
CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: J?r?me Pouiller <jezz@sysmic.org>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>
---

Note: xdriinfo report a too old libGL library
 # xdriinfo
 libGL is too old.
---
 .../xdriver_xf86-video-imx-viv.hash                           | 2 +-
 .../xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash
index e5d46c86f3..7295061d36 100644
--- a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash
+++ b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256	61b3a7a22f80d1cbc797c329615e1699f3906c9261de7eabcf0de2bf2399de55  xdriver_xf86-video-imx-viv-rel_imx_4.9.x_1.0.0_ga.tar.gz
+sha256  2f927114e8b888237f1a15830ff5dbde3990fc737227b7a2b94dc6fdbcd7fe19  xdriver_xf86-video-imx-viv-rel_imx_5.4.24_2.1.0.tar.gz
 sha256  9d3e373f0440cc0c58853e963636a7c1ffda9308ec5f30ebe9adfb9c16a8a1e4  COPYING-MIT
diff --git a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk
index 0913427542..9aa2b50cad 100644
--- a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk
+++ b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-XDRIVER_XF86_VIDEO_IMX_VIV_VERSION = rel_imx_4.9.x_1.0.0_ga
+XDRIVER_XF86_VIDEO_IMX_VIV_VERSION = rel_imx_5.4.24_2.1.0
 XDRIVER_XF86_VIDEO_IMX_VIV_SITE = https://source.codeaurora.org/external/imx/xf86-video-imx-vivante
 XDRIVER_XF86_VIDEO_IMX_VIV_SITE_METHOD = git
 XDRIVER_XF86_VIDEO_IMX_VIV_DEPENDENCIES = imx-gpu-viv imx-gpu-g2d xserver_xorg-server \
@@ -17,7 +17,7 @@ XDRIVER_XF86_VIDEO_IMX_VIV_MAKE_CMD = $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D)
 define XDRIVER_XF86_VIDEO_IMX_VIV_BUILD_CMDS
 	$(XDRIVER_XF86_VIDEO_IMX_VIV_MAKE_CMD) sysroot=$(STAGING_DIR) \
 		BUSID_HAS_NUMBER=1 BUILD_IN_YOCTO=1 XSERVER_GREATER_THAN_13=1 \
-		CFLAGS="$(TARGET_CFLAGS)"
+		SDKTARGETSYSROOT="$(STAGING_DIR)"
 endef
 
 define XDRIVER_XF86_VIDEO_IMX_VIV_INSTALL_STAGING_CMDS
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 4/4] package/x11r7/xdriver_xf86-video-imx-viv: select dri swrast driver
  2021-01-07 11:04 [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Romain Naour
  2021-01-07 11:04 ` [Buildroot] [RFC: 2/4] package/freescale-imx/imx-gpu-viv: avoid removing openGL headers when mesa3d is also selected Romain Naour
  2021-01-07 11:04 ` [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0 Romain Naour
@ 2021-01-07 11:04 ` Romain Naour
  2021-01-07 17:04 ` [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Yann E. MORIN
  3 siblings, 0 replies; 13+ messages in thread
From: Romain Naour @ 2021-01-07 11:04 UTC (permalink / raw)
  To: buildroot

Curently, this package fail to build because
BR2_PACKAGE_MESA3D_DRI_DRIVER can't be used directly.
since it doesn't select any DRI driver in mesa, this option must
only be used by BR2_PACKAGE_MESA3D_DRI_DRIVER_*.

When this package was added [1] the commit log said:
"Yocto use Mesa3D/swraster to provide Desktop OpenGL API[1]."

It seems swrast dri driver was expected, so
BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST should be selected.

About BR2_PACKAGE_MESA3D_OPENGL_GLX, this option should not
be selected when BR2_PACKAGE_IMX_GPU_VIV is set because
both are libGL provider. But xf86-video-imx-viv seems to
requires both... meta-freescale contain a hack to avoid
overriding the Vivante GPU libGL binary and headers [3].

[1] https://git.buildroot.net/buildroot/commit/?id=8fdf8ccd3bbb199f7ddda1d55996f8923dc19c61
[2] See recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_3.10.17-1.0.1.bb
[3] https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa_%25.bbappend#L37

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: J?r?me Pouiller <jezz@sysmic.org>
Cc: Gary Bisson <gary.bisson@boundarydevices.com>
---
 package/x11r7/xdriver_xf86-video-imx-viv/Config.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/x11r7/xdriver_xf86-video-imx-viv/Config.in b/package/x11r7/xdriver_xf86-video-imx-viv/Config.in
index 13cee14deb..1dda5e39ea 100644
--- a/package/x11r7/xdriver_xf86-video-imx-viv/Config.in
+++ b/package/x11r7/xdriver_xf86-video-imx-viv/Config.in
@@ -4,7 +4,7 @@ config BR2_PACKAGE_XDRIVER_XF86_VIDEO_IMX_VIV
 	depends on BR2_PACKAGE_IMX_GPU_G2D
 	depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d
 	select BR2_PACKAGE_MESA3D # Needed in order to compile xorg with glx/dri
-	select BR2_PACKAGE_MESA3D_DRI_DRIVER
+	select BR2_PACKAGE_MESA3D_DRI_DRIVER_SWRAST
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_XORGPROTO
 	help
-- 
2.25.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider
  2021-01-07 11:04 [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Romain Naour
                   ` (2 preceding siblings ...)
  2021-01-07 11:04 ` [Buildroot] [RFC: 4/4] package/x11r7/xdriver_xf86-video-imx-viv: select dri swrast driver Romain Naour
@ 2021-01-07 17:04 ` Yann E. MORIN
  2021-01-07 17:05   ` Yann E. MORIN
  2021-01-07 20:19   ` Romain Naour
  3 siblings, 2 replies; 13+ messages in thread
From: Yann E. MORIN @ 2021-01-07 17:04 UTC (permalink / raw)
  To: buildroot

romain, All,

On 2021-01-07 12:04 +0100, Romain Naour spake thusly:
> libGL.so is installed when BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 or BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
> is selected, so declare it as a libgl provider.

I don;t think this is a good solution. At the very best it is a poor
workaround...

mesa3d will not install its headers if opengl is not enabled.

However, we always enable openGL:

    https://git.buildroot.org/buildroot/tree/package/mesa3d/mesa3d.mk#n160

    # Always enable OpenGL:
    #   - Building OpenGL ES without OpenGL is not supported, so alway keep opengl enabled.

The first part of thet comment was added back in 2014-04-2, with commit
384d601d4ea (package/mesa3d: always enable openGL, by your's truly), and
the second part was just an amendment to that, when we switched to using
meson as buildsystem, with commit f0483751dfa (package/mesa3d: switch
build system to meson).

So, the initial rationale for always enabling openGL is very old, and
mesa3d has changed quite a lot since then, so I'd like that we revisit
that assertion in the light of the new meson-based buildsystem.

And if imx-gpu-viv is enabled but mesa3d is not, then it would be
missing the GL headers. As such, it seems that mesa3d-headers should
then be used to provide those headers.

Unfortunately, we've made mesa3d-headers and mesa3d to conflict on
purpose.

But then does it make sense to have both imx-gpu-viv and mesa3d enabled
at the same time in the same configuration?

I.e. isn't the solution to that issue for imx-gpu-viv to select and
build-depend on mesa3d-headers when it needs the GL headers?

Regards,
Yann E. MORIN.

> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
> 
> Not related to this patch but mesa3d-demo doesn't build with imx-gpu-viv
> as GL provider. meta-freescale provide a patch that replace glWindowPos2iARB
> calls with glWindowPos2i but it was rejected by upstream.
> 
> https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
> ---
>  package/freescale-imx/imx-gpu-viv/Config.in      | 6 ++++++
>  package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 4 ++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/package/freescale-imx/imx-gpu-viv/Config.in b/package/freescale-imx/imx-gpu-viv/Config.in
> index cca2689905..4e53044d1d 100644
> --- a/package/freescale-imx/imx-gpu-viv/Config.in
> +++ b/package/freescale-imx/imx-gpu-viv/Config.in
> @@ -44,6 +44,7 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11
>  	select BR2_PACKAGE_XLIB_LIBXDAMAGE
>  	select BR2_PACKAGE_XLIB_LIBXEXT
>  	select BR2_PACKAGE_XLIB_LIBXFIXES
> +	select BR2_PACKAGE_HAS_LIBGL # libGL-x11.so
>  
>  comment "X11 backend needs Xorg package"
>  	depends on !BR2_PACKAGE_XORG7
> @@ -60,6 +61,7 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
>  	select BR2_PACKAGE_LIBDRM
>  	select BR2_PACKAGE_WAYLAND
>  	select BR2_PACKAGE_HAS_LIBEGL_WAYLAND
> +	select BR2_PACKAGE_HAS_LIBGL # libGL-wl.so
>  
>  endchoice
>  
> @@ -72,6 +74,10 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT
>  config BR2_PACKAGE_PROVIDES_LIBEGL
>  	default "imx-gpu-viv"
>  
> +config BR2_PACKAGE_PROVIDES_LIBGL
> +	default "imx-gpu-viv" if BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 || \
> +		BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
> +
>  config BR2_PACKAGE_PROVIDES_LIBGLES
>  	default "imx-gpu-viv"
>  
> diff --git a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
> index 6ae9aa7acc..f03415b336 100644
> --- a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
> +++ b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
> @@ -61,7 +61,7 @@ endif
>  
>  ifeq ($(IMX_GPU_VIV_LIB_TARGET),x11)
>  define IMX_GPU_VIV_FIXUP_PKGCONFIG
> -	for lib in egl gbm glesv1_cm glesv2 vg; do \
> +	for lib in egl gbm glesv1_cm glesv2 gl vg; do \
>  		ln -sf $${lib}_x11.pc $(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc || exit 1; \
>  	done
>  endef
> @@ -70,7 +70,7 @@ endif
>  define IMX_GPU_VIV_INSTALL_STAGING_CMDS
>  	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
>  	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
> -	for lib in egl gbm glesv1_cm glesv2 vg; do \
> +	for lib in egl gbm glesv1_cm glesv2 gl vg; do \
>  		$(INSTALL) -m 0644 -D \
>  			$(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc \
>  			$(STAGING_DIR)/usr/lib/pkgconfig/$${lib}.pc; \
> -- 
> 2.25.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider
  2021-01-07 17:04 ` [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Yann E. MORIN
@ 2021-01-07 17:05   ` Yann E. MORIN
  2021-01-07 20:19   ` Romain Naour
  1 sibling, 0 replies; 13+ messages in thread
From: Yann E. MORIN @ 2021-01-07 17:05 UTC (permalink / raw)
  To: buildroot

Romain, All,

On 2021-01-07 18:04 +0100, Yann E. MORIN spake thusly:
> On 2021-01-07 12:04 +0100, Romain Naour spake thusly:
> > libGL.so is installed when BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 or BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
> > is selected, so declare it as a libgl provider.
[--SNIP--]
> I.e. isn't the solution to that issue for imx-gpu-viv to select and
> build-depend on mesa3d-headers when it needs the GL headers?

That was obviously a review for pttch 2 of the series, not patch 1.
Sorry for the confusion...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider
  2021-01-07 17:04 ` [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Yann E. MORIN
  2021-01-07 17:05   ` Yann E. MORIN
@ 2021-01-07 20:19   ` Romain Naour
  1 sibling, 0 replies; 13+ messages in thread
From: Romain Naour @ 2021-01-07 20:19 UTC (permalink / raw)
  To: buildroot

Yann, All,

Le 07/01/2021 ? 18:04, Yann E. MORIN a ?crit?:
> romain, All,
> 
> On 2021-01-07 12:04 +0100, Romain Naour spake thusly:
>> libGL.so is installed when BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 or BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
>> is selected, so declare it as a libgl provider.
> 

We are speaking about patch 2/4:
http://lists.busybox.net/pipermail/buildroot/2021-January/300221.html

> I don;t think this is a good solution. At the very best it is a poor
> workaround...

Well, the real purpose of this patch is to explain the issue.

> 
> mesa3d will not install its headers if opengl is not enabled.
> 
> However, we always enable openGL:
> 
>     https://git.buildroot.org/buildroot/tree/package/mesa3d/mesa3d.mk#n160
> 
>     # Always enable OpenGL:
>     #   - Building OpenGL ES without OpenGL is not supported, so alway keep opengl enabled.
> 
> The first part of thet comment was added back in 2014-04-2, with commit
> 384d601d4ea (package/mesa3d: always enable openGL, by your's truly), and
> the second part was just an amendment to that, when we switched to using
> meson as buildsystem, with commit f0483751dfa (package/mesa3d: switch
> build system to meson).

Indeed

> 
> So, the initial rationale for always enabling openGL is very old, and
> mesa3d has changed quite a lot since then, so I'd like that we revisit
> that assertion in the light of the new meson-based buildsystem.
> 
> And if imx-gpu-viv is enabled but mesa3d is not, then it would be
> missing the GL headers. As such, it seems that mesa3d-headers should
> then be used to provide those headers.

imx-gpu-viv provides GL headers but for some reason mesa3d is needed to build
xorg with glx/dri (see xdriver_xf86-video-imx-viv package).

> 
> Unfortunately, we've made mesa3d-headers and mesa3d to conflict on
> purpose.
> 
> But then does it make sense to have both imx-gpu-viv and mesa3d enabled
> at the same time in the same configuration?

Well, that what meta-freescale do in order to build X11 image w/ GLX.

The debian 10.2 image for nitrogen6x (sabrelite) contain both mesa and imx gpu
firmware (as far I can see):

https://boundarydevices.com/debian-buster-10-2-for-i-mx6-7-boards-december-2019-kernel-4-14-x/

> 
> I.e. isn't the solution to that issue for imx-gpu-viv to select and
> build-depend on mesa3d-headers when it needs the GL headers?

I tried to remove mesa3d and use mesa3d-headers but it doesn't build.

Best regards,
Romain

> 
> Regards,
> Yann E. MORIN.
> 
>> Signed-off-by: Romain Naour <romain.naour@gmail.com>
>> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
>> ---
>>
>> Not related to this patch but mesa3d-demo doesn't build with imx-gpu-viv
>> as GL provider. meta-freescale provide a patch that replace glWindowPos2iARB
>> calls with glWindowPos2i but it was rejected by upstream.
>>
>> https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch
>> ---
>>  package/freescale-imx/imx-gpu-viv/Config.in      | 6 ++++++
>>  package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk | 4 ++--
>>  2 files changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/package/freescale-imx/imx-gpu-viv/Config.in b/package/freescale-imx/imx-gpu-viv/Config.in
>> index cca2689905..4e53044d1d 100644
>> --- a/package/freescale-imx/imx-gpu-viv/Config.in
>> +++ b/package/freescale-imx/imx-gpu-viv/Config.in
>> @@ -44,6 +44,7 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11
>>  	select BR2_PACKAGE_XLIB_LIBXDAMAGE
>>  	select BR2_PACKAGE_XLIB_LIBXEXT
>>  	select BR2_PACKAGE_XLIB_LIBXFIXES
>> +	select BR2_PACKAGE_HAS_LIBGL # libGL-x11.so
>>  
>>  comment "X11 backend needs Xorg package"
>>  	depends on !BR2_PACKAGE_XORG7
>> @@ -60,6 +61,7 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
>>  	select BR2_PACKAGE_LIBDRM
>>  	select BR2_PACKAGE_WAYLAND
>>  	select BR2_PACKAGE_HAS_LIBEGL_WAYLAND
>> +	select BR2_PACKAGE_HAS_LIBGL # libGL-wl.so
>>  
>>  endchoice
>>  
>> @@ -72,6 +74,10 @@ config BR2_PACKAGE_IMX_GPU_VIV_OUTPUT
>>  config BR2_PACKAGE_PROVIDES_LIBEGL
>>  	default "imx-gpu-viv"
>>  
>> +config BR2_PACKAGE_PROVIDES_LIBGL
>> +	default "imx-gpu-viv" if BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11 || \
>> +		BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
>> +
>>  config BR2_PACKAGE_PROVIDES_LIBGLES
>>  	default "imx-gpu-viv"
>>  
>> diff --git a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
>> index 6ae9aa7acc..f03415b336 100644
>> --- a/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
>> +++ b/package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk
>> @@ -61,7 +61,7 @@ endif
>>  
>>  ifeq ($(IMX_GPU_VIV_LIB_TARGET),x11)
>>  define IMX_GPU_VIV_FIXUP_PKGCONFIG
>> -	for lib in egl gbm glesv1_cm glesv2 vg; do \
>> +	for lib in egl gbm glesv1_cm glesv2 gl vg; do \
>>  		ln -sf $${lib}_x11.pc $(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc || exit 1; \
>>  	done
>>  endef
>> @@ -70,7 +70,7 @@ endif
>>  define IMX_GPU_VIV_INSTALL_STAGING_CMDS
>>  	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
>>  	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
>> -	for lib in egl gbm glesv1_cm glesv2 vg; do \
>> +	for lib in egl gbm glesv1_cm glesv2 gl vg; do \
>>  		$(INSTALL) -m 0644 -D \
>>  			$(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc \
>>  			$(STAGING_DIR)/usr/lib/pkgconfig/$${lib}.pc; \
>> -- 
>> 2.25.4
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
  2021-01-07 11:04 ` [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0 Romain Naour
@ 2021-01-10 17:46   ` Romain Naour
  2021-01-11 13:12     ` Gary Bisson
  0 siblings, 1 reply; 13+ messages in thread
From: Romain Naour @ 2021-01-10 17:46 UTC (permalink / raw)
  To: buildroot

Hello,

Le 07/01/2021 ? 12:04, Romain Naour a ?crit?:
> This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.
> 
> Don't override CFLAGS on the command line otherwise we loose some include paths
> (ex: -I./vivante_gal).
> CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.

What's the status of vivante gpu support for X11 ? especially for kernel >= 5.4.

Because it's currently broken with several issues:

0) glxinfo fail to report OpenGL informations

# glxinfo -B -display :0
name of display: :0
Error: glXMakeCurrent failed
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  148 (GLX)
  Minor opcode of failed request:  4 (X_GLXDestroyContext)
  Serial number of failed request:  20
  Current serial number in output stream:  25
Perform final cleanup before process termination!

(I'm using a patch that replace glWindowPos2iARB calls with glWindowPos2i:
https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch)

1) vivante_fbdev is looking for a device with "platform:Vivante GCCore" using
drmOpen() [1]

 strcpy(pDRIInfo->busIdString,"platform:Vivante GCCore");
 fd = drmOpen(NULL,pDRIInfo->busIdString);

This string "platform:Vivante GCCore" is present in the linux-imx kernel up to
the version imx_4.19.35_1.1.0. The DRM_VIVANTE driver is missing in
imx_5.4.70_2.3.0.

2) I was able to workaround this issue by using "130000.gpu" instead of
"platform:Vivante GCCore" but the dri driver still fail to load.

drmOpenByBusid: Searching for BusID 130000.gpu
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 12, (OK)
drmOpenByBusid: drmOpenMinor returns 12
drmOpenByBusid: drmGetBusid reports 130000.gpu
(II) [drm] DRM interface version 1.4
(II) [drm] Could not create SAREA for DRM lock.
(EE) VIVANTE(0): [dri] DRIScreenInit failed.  Disabling DRI

3) I tried to enable X11_DRI3 but xdriver_xf86-video-imx-viv doesn't even build
due to recent change [2] (removing pScrPriv variable before using it along with
other issues).
See patch [3] that try to fix the issue.
(Note, X11_DRI3 needs libdrm-vivante fork to build)


To compare with a working system, I'm using the Debian (xfce) image provided by
Boundarydevices [4] but the kernel is 4.14.98-28-boundary-17b (DRM_VIVANTE is
still present). I noticed that the SWRAST DRI driver is used along with the
vivante driver:

[    21.503] (II) Initializing extension GLX
[    21.504] (II) AIGLX: Screen 0 is not DRI2 capable
[    22.142] (II) IGLX: Loaded and initialized swrast
[    22.143] (II) GLX: Initialized DRISWRAST GL provider for screen 0

It means that we really need two LIBGL providers enabled at the same time in the
Buildroot configuration.

I have the feeling that I need to switch to Yocto to use meta-freescale and all
the imx hacks and imx forks (libdrm-imx) to get vivante GPU working with X11
(maybe).

Best regards,
Romain

[1]
https://source.codeaurora.org/external/imx/xf86-video-imx-vivante/tree/EXA/src/vivante_fbdev/vivante_dri.c?h=imx_exa_viv6_g2d#n127

[2]
https://source.codeaurora.org/external/imx/xf86-video-imx-vivante/commit/?h=imx_exa_viv6_g2d&id=8ea614949fdefd4ab655d3944fc32d62cb48c3be

[3]
https://github.com/mxOBS/deb-pkg_xserver-xorg-video-imx-viv/commit/3c5abf59abb8d7283cd8c951776ca059a5791272

[4]
https://boundarydevices.com/debian-buster-10-2-for-i-mx6-7-boards-december-2019-kernel-4-14-x/

> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: J?r?me Pouiller <jezz@sysmic.org>
> Cc: Gary Bisson <gary.bisson@boundarydevices.com>
> ---
> 
> Note: xdriinfo report a too old libGL library
>  # xdriinfo
>  libGL is too old.
> ---
>  .../xdriver_xf86-video-imx-viv.hash                           | 2 +-
>  .../xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk  | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash
> index e5d46c86f3..7295061d36 100644
> --- a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash
> +++ b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.hash
> @@ -1,3 +1,3 @@
>  # Locally calculated
> -sha256	61b3a7a22f80d1cbc797c329615e1699f3906c9261de7eabcf0de2bf2399de55  xdriver_xf86-video-imx-viv-rel_imx_4.9.x_1.0.0_ga.tar.gz
> +sha256  2f927114e8b888237f1a15830ff5dbde3990fc737227b7a2b94dc6fdbcd7fe19  xdriver_xf86-video-imx-viv-rel_imx_5.4.24_2.1.0.tar.gz
>  sha256  9d3e373f0440cc0c58853e963636a7c1ffda9308ec5f30ebe9adfb9c16a8a1e4  COPYING-MIT
> diff --git a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk
> index 0913427542..9aa2b50cad 100644
> --- a/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk
> +++ b/package/x11r7/xdriver_xf86-video-imx-viv/xdriver_xf86-video-imx-viv.mk
> @@ -4,7 +4,7 @@
>  #
>  ################################################################################
>  
> -XDRIVER_XF86_VIDEO_IMX_VIV_VERSION = rel_imx_4.9.x_1.0.0_ga
> +XDRIVER_XF86_VIDEO_IMX_VIV_VERSION = rel_imx_5.4.24_2.1.0
>  XDRIVER_XF86_VIDEO_IMX_VIV_SITE = https://source.codeaurora.org/external/imx/xf86-video-imx-vivante
>  XDRIVER_XF86_VIDEO_IMX_VIV_SITE_METHOD = git
>  XDRIVER_XF86_VIDEO_IMX_VIV_DEPENDENCIES = imx-gpu-viv imx-gpu-g2d xserver_xorg-server \
> @@ -17,7 +17,7 @@ XDRIVER_XF86_VIDEO_IMX_VIV_MAKE_CMD = $(TARGET_CONFIGURE_OPTS) $(MAKE1) -C $(@D)
>  define XDRIVER_XF86_VIDEO_IMX_VIV_BUILD_CMDS
>  	$(XDRIVER_XF86_VIDEO_IMX_VIV_MAKE_CMD) sysroot=$(STAGING_DIR) \
>  		BUSID_HAS_NUMBER=1 BUILD_IN_YOCTO=1 XSERVER_GREATER_THAN_13=1 \
> -		CFLAGS="$(TARGET_CFLAGS)"
> +		SDKTARGETSYSROOT="$(STAGING_DIR)"
>  endef
>  
>  define XDRIVER_XF86_VIDEO_IMX_VIV_INSTALL_STAGING_CMDS
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
  2021-01-10 17:46   ` Romain Naour
@ 2021-01-11 13:12     ` Gary Bisson
  2021-01-12 10:53       ` Romain Naour
       [not found]       ` <7856829.T7Z3S40VBb@pc-42>
  0 siblings, 2 replies; 13+ messages in thread
From: Gary Bisson @ 2021-01-11 13:12 UTC (permalink / raw)
  To: buildroot

Hi Romain,

On Sun, Jan 10, 2021 at 06:46:38PM +0100, Romain Naour wrote:
> Hello,
> 
> Le 07/01/2021 ? 12:04, Romain Naour a ?crit?:
> > This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.
> > 
> > Don't override CFLAGS on the command line otherwise we loose some include paths
> > (ex: -I./vivante_gal).
> > CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.
> 
> What's the status of vivante gpu support for X11 ? especially for kernel >= 5.4.

Don't know. To be honest, i.MX6 will soon be a legacy product for NXP
releases so I strongly suggest moving to mainline + Etnaviv.

> Because it's currently broken with several issues:
> 
> 0) glxinfo fail to report OpenGL informations
> 
> # glxinfo -B -display :0
> name of display: :0
> Error: glXMakeCurrent failed
> X Error of failed request:  GLXBadContext
>   Major opcode of failed request:  148 (GLX)
>   Minor opcode of failed request:  4 (X_GLXDestroyContext)
>   Serial number of failed request:  20
>   Current serial number in output stream:  25
> Perform final cleanup before process termination!
> 
> (I'm using a patch that replace glWindowPos2iARB calls with glWindowPos2i:
> https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch)

Have you tried NXP pre-built image from latest release? Although it
seems they now use Wayland/XWayland. Yet it'd be surprising they'd
release a broken X11 package.

> 1) vivante_fbdev is looking for a device with "platform:Vivante GCCore" using
> drmOpen() [1]
> 
>  strcpy(pDRIInfo->busIdString,"platform:Vivante GCCore");
>  fd = drmOpen(NULL,pDRIInfo->busIdString);
> 
> This string "platform:Vivante GCCore" is present in the linux-imx kernel up to
> the version imx_4.19.35_1.1.0. The DRM_VIVANTE driver is missing in
> imx_5.4.70_2.3.0.
> 
> 2) I was able to workaround this issue by using "130000.gpu" instead of
> "platform:Vivante GCCore" but the dri driver still fail to load.
> 
> drmOpenByBusid: Searching for BusID 130000.gpu
> drmOpenDevice: node name is /dev/dri/card0
> drmOpenDevice: open result is 12, (OK)
> drmOpenByBusid: drmOpenMinor returns 12
> drmOpenByBusid: drmGetBusid reports 130000.gpu
> (II) [drm] DRM interface version 1.4
> (II) [drm] Could not create SAREA for DRM lock.
> (EE) VIVANTE(0): [dri] DRIScreenInit failed.  Disabling DRI
> 
> 3) I tried to enable X11_DRI3 but xdriver_xf86-video-imx-viv doesn't even build
> due to recent change [2] (removing pScrPriv variable before using it along with
> other issues).
> See patch [3] that try to fix the issue.
> (Note, X11_DRI3 needs libdrm-vivante fork to build)
> 
> 
> To compare with a working system, I'm using the Debian (xfce) image provided by
> Boundarydevices [4] but the kernel is 4.14.98-28-boundary-17b (DRM_VIVANTE is
> still present). I noticed that the SWRAST DRI driver is used along with the
> vivante driver:
> 
> [    21.503] (II) Initializing extension GLX
> [    21.504] (II) AIGLX: Screen 0 is not DRI2 capable
> [    22.142] (II) IGLX: Loaded and initialized swrast
> [    22.143] (II) GLX: Initialized DRISWRAST GL provider for screen 0

FYI, we haven't updated to 5.4 for i.MX6 and don't plan to.

> It means that we really need two LIBGL providers enabled at the same time in the
> Buildroot configuration.

OpenGL is another issue though, you can get X11 working without it. But
yes the implementation on libGL from imx-gpu-viv is messy. Thomas did
implement it once but never submitted it as the change was pretty
intrusive & hacky.

> I have the feeling that I need to switch to Yocto to use meta-freescale and all
> the imx hacks and imx forks (libdrm-imx) to get vivante GPU working with X11
> (maybe).

Please let us know how that goes. Once again it feels like it would be
better to move to Etnaviv at this point.

Regards,
Gary

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
  2021-01-11 13:12     ` Gary Bisson
@ 2021-01-12 10:53       ` Romain Naour
       [not found]       ` <7856829.T7Z3S40VBb@pc-42>
  1 sibling, 0 replies; 13+ messages in thread
From: Romain Naour @ 2021-01-12 10:53 UTC (permalink / raw)
  To: buildroot

Hello Gary,

Thanks for your feedback!

Le 11/01/2021 ? 14:12, Gary Bisson a ?crit?:
> Hi Romain,
> 
> On Sun, Jan 10, 2021 at 06:46:38PM +0100, Romain Naour wrote:
>> Hello,
>>
>> Le 07/01/2021 ? 12:04, Romain Naour a ?crit?:
>>> This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.
>>>
>>> Don't override CFLAGS on the command line otherwise we loose some include paths
>>> (ex: -I./vivante_gal).
>>> CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.
>>
>> What's the status of vivante gpu support for X11 ? especially for kernel >= 5.4.
> 
> Don't know. To be honest, i.MX6 will soon be a legacy product for NXP
> releases so I strongly suggest moving to mainline + Etnaviv.

ok, but I used the vivante driver since I started from the nitrogen6x_defconfig
for the sabrelite board that use the linux-imx6 from the Boundary BSP.

Also, I wanted to try the opencl support provided by imx-gpu-viv. I'm not sure
there is an opensource opencl provider for imx6 (mesa Clover only support r600
and RadeonSI).

I'll take a look at nitrogen6x_qt5_gst1_mainline_defconfig:

https://github.com/boundarydevices/buildroot-external-boundary/blob/master/configs/nitrogen6x_qt5_gst1_mainline_defconfig

> 
>> Because it's currently broken with several issues:
>>
>> 0) glxinfo fail to report OpenGL informations
>>
>> # glxinfo -B -display :0
>> name of display: :0
>> Error: glXMakeCurrent failed
>> X Error of failed request:  GLXBadContext
>>   Major opcode of failed request:  148 (GLX)
>>   Minor opcode of failed request:  4 (X_GLXDestroyContext)
>>   Serial number of failed request:  20
>>   Current serial number in output stream:  25
>> Perform final cleanup before process termination!
>>
>> (I'm using a patch that replace glWindowPos2iARB calls with glWindowPos2i:
>> https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch)
> 
> Have you tried NXP pre-built image from latest release? Although it
> seems they now use Wayland/XWayland. Yet it'd be surprising they'd
> release a broken X11 package.

I haven't tested NXP pre-built image, I'll take a look.

Well, NXP pre-built image use a lot of imx fork. I can expect having some issues
by using official/upstream release when building the image with Buildroot:

https://www.nxp.com/docs/en/release-note/IMX_LINUX_RELEASE_NOTES.pdf

It's more difficult that I expected :)

> 
>> 1) vivante_fbdev is looking for a device with "platform:Vivante GCCore" using
>> drmOpen() [1]
>>
>>  strcpy(pDRIInfo->busIdString,"platform:Vivante GCCore");
>>  fd = drmOpen(NULL,pDRIInfo->busIdString);
>>
>> This string "platform:Vivante GCCore" is present in the linux-imx kernel up to
>> the version imx_4.19.35_1.1.0. The DRM_VIVANTE driver is missing in
>> imx_5.4.70_2.3.0.
>>
>> 2) I was able to workaround this issue by using "130000.gpu" instead of
>> "platform:Vivante GCCore" but the dri driver still fail to load.
>>
>> drmOpenByBusid: Searching for BusID 130000.gpu
>> drmOpenDevice: node name is /dev/dri/card0
>> drmOpenDevice: open result is 12, (OK)
>> drmOpenByBusid: drmOpenMinor returns 12
>> drmOpenByBusid: drmGetBusid reports 130000.gpu
>> (II) [drm] DRM interface version 1.4
>> (II) [drm] Could not create SAREA for DRM lock.
>> (EE) VIVANTE(0): [dri] DRIScreenInit failed.  Disabling DRI
>>
>> 3) I tried to enable X11_DRI3 but xdriver_xf86-video-imx-viv doesn't even build
>> due to recent change [2] (removing pScrPriv variable before using it along with
>> other issues).
>> See patch [3] that try to fix the issue.
>> (Note, X11_DRI3 needs libdrm-vivante fork to build)
>>
>>
>> To compare with a working system, I'm using the Debian (xfce) image provided by
>> Boundarydevices [4] but the kernel is 4.14.98-28-boundary-17b (DRM_VIVANTE is
>> still present). I noticed that the SWRAST DRI driver is used along with the
>> vivante driver:
>>
>> [    21.503] (II) Initializing extension GLX
>> [    21.504] (II) AIGLX: Screen 0 is not DRI2 capable
>> [    22.142] (II) IGLX: Loaded and initialized swrast
>> [    22.143] (II) GLX: Initialized DRISWRAST GL provider for screen 0
> 
> FYI, we haven't updated to 5.4 for i.MX6 and don't plan to.

Ok. I think it would be good to add a comment in the help section of
xf86-video-imx-viv package to recommend using a kernel imx_4.19.35_1.1.0.

> 
>> It means that we really need two LIBGL providers enabled at the same time in the
>> Buildroot configuration.
> 
> OpenGL is another issue though, you can get X11 working without it. But
> yes the implementation on libGL from imx-gpu-viv is messy. Thomas did
> implement it once but never submitted it as the change was pretty
> intrusive & hacky.

I think I'll take into account the comment from J?r?me Pouiller and consider
that imx-gpu-viv is a EGL and GLES provider only.

> 
>> I have the feeling that I need to switch to Yocto to use meta-freescale and all
>> the imx hacks and imx forks (libdrm-imx) to get vivante GPU working with X11
>> (maybe).
> 
> Please let us know how that goes. Once again it feels like it would be
> better to move to Etnaviv at this point.

Well, I'm not sure to try the Yocto way for the moment.

I'll try using Etnaviv.

Best regards,
Romain

> 
> Regards,
> Gary
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
       [not found]       ` <7856829.T7Z3S40VBb@pc-42>
@ 2021-01-12 11:05         ` Romain Naour
  2021-01-12 19:32           ` Peter Seiderer
  0 siblings, 1 reply; 13+ messages in thread
From: Romain Naour @ 2021-01-12 11:05 UTC (permalink / raw)
  To: buildroot

Hi J?r?me,

Thanks for your feedback!

Le 11/01/2021 ? 15:02, J?r?me Pouiller a ?crit?:
> Hi Romain, Garry,
> 
> On Monday 11 January 2021 14:12:08 CET Gary Bisson wrote:
>> On Sun, Jan 10, 2021 at 06:46:38PM +0100, Romain Naour wrote:
>>> Le 07/01/2021 ? 12:04, Romain Naour a ?crit :
>>>> This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.
>>>>
>>>> Don't override CFLAGS on the command line otherwise we loose some include paths
>>>> (ex: -I./vivante_gal).
>>>> CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.
>>>
>>> What's the status of vivante gpu support for X11 ? especially for kernel >= 5.4.
>>
>> Don't know. To be honest, i.MX6 will soon be a legacy product for NXP
>> releases so I strongly suggest moving to mainline + Etnaviv.
> 
> Same here, I haven't worked on iMX6 for a while. The last teams I know who develop
> new iMX6 designs use Etnaviv..

I haven't worked a lot for customer on iMX6, but each time they used Yocto and
NXP BSP. Last time I tried to use Etnaviv with linux-imx, the kernel build was
broken.

> 
>>> Because it's currently broken with several issues:
>>>
>>> 0) glxinfo fail to report OpenGL informations
>>>
>>> # glxinfo -B -display :0
>>> name of display: :0
>>> Error: glXMakeCurrent failed
>>> X Error of failed request:  GLXBadContext
>>>   Major opcode of failed request:  148 (GLX)
>>>   Minor opcode of failed request:  4 (X_GLXDestroyContext)
>>>   Serial number of failed request:  20
>>>   Current serial number in output stream:  25
>>> Perform final cleanup before process termination!
>>>
>>> (I'm using a patch that replace glWindowPos2iARB calls with glWindowPos2i:
>>> https://github.com/Freescale/meta-freescale/blob/dunfell/recipes-graphics/mesa/mesa-demos/Replace-glWindowPos2iARB-calls-with-glWindowPos2i.patch)
>>
>> Have you tried NXP pre-built image from latest release? Although it
>> seems they now use Wayland/XWayland. Yet it'd be surprising they'd
>> release a broken X11 package.
> 
> As far as remember, imx-gpu-viv has never provided a working GLX stack (it
> only provides EGL/GLes and X11 2D acceleration). Yocto automatically
> provided swrast to support GLX. For Buildroot,
> 
> I remember I found confusing to install swrast automatically. I preferred
> the user manually selects swrast instead.

Yes, Buildroot doesn't support installing two virtual package provider in the
same config.

> 
> [...]
>>> It means that we really need two LIBGL providers enabled at the same time in the
>>> Buildroot configuration.
>>
>> OpenGL is another issue though, you can get X11 working without it. But
>> yes the implementation on libGL from imx-gpu-viv is messy. Thomas did
>> implement it once but never submitted it as the change was pretty
>> intrusive & hacky.
> 
> I think you can consider that imx-gpu-viv is a EGL and GLES provider, but
> it is not a GL provider.

I believe we have to remove LIBGL support from imx-gpu-viv entirely and avoid
installing it.

Best regards,
Romain

> 
> 
> --
> J?r?me Pouiller
> 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
  2021-01-12 11:05         ` Romain Naour
@ 2021-01-12 19:32           ` Peter Seiderer
  2021-01-12 21:52             ` Romain Naour
  0 siblings, 1 reply; 13+ messages in thread
From: Peter Seiderer @ 2021-01-12 19:32 UTC (permalink / raw)
  To: buildroot

Hello Romain,

On Tue, 12 Jan 2021 12:05:58 +0100, Romain Naour <romain.naour@gmail.com> wrote:

> Hi J?r?me,
> 
> Thanks for your feedback!
> 
> Le 11/01/2021 ? 15:02, J?r?me Pouiller a ?crit?:
> > Hi Romain, Garry,
> > 
> > On Monday 11 January 2021 14:12:08 CET Gary Bisson wrote:  
> >> On Sun, Jan 10, 2021 at 06:46:38PM +0100, Romain Naour wrote:  
> >>> Le 07/01/2021 ? 12:04, Romain Naour a ?crit :  
> >>>> This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.
> >>>>
> >>>> Don't override CFLAGS on the command line otherwise we loose some include paths
> >>>> (ex: -I./vivante_gal).
> >>>> CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.  
> >>>
> >>> What's the status of vivante gpu support for X11 ? especially for kernel >= 5.4.  
> >>
> >> Don't know. To be honest, i.MX6 will soon be a legacy product for NXP
> >> releases so I strongly suggest moving to mainline + Etnaviv.  
> > 
> > Same here, I haven't worked on iMX6 for a while. The last teams I know who develop
> > new iMX6 designs use Etnaviv..  
> 
> I haven't worked a lot for customer on iMX6, but each time they used Yocto and
> NXP BSP. Last time I tried to use Etnaviv with linux-imx, the kernel build was
> broken.
> 

On a past project I worked on a iMX6 platform with etnaviv (using Qt eglfs and
qtquickcontrols for the GUI and GStreamer for video/audio recording/streaming)
using mainline linux kernel...., worked very well...

Regards,
Peter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0
  2021-01-12 19:32           ` Peter Seiderer
@ 2021-01-12 21:52             ` Romain Naour
  0 siblings, 0 replies; 13+ messages in thread
From: Romain Naour @ 2021-01-12 21:52 UTC (permalink / raw)
  To: buildroot

Hello Peter,

Le 12/01/2021 ? 20:32, Peter Seiderer a ?crit?:
> Hello Romain,
> 
> On Tue, 12 Jan 2021 12:05:58 +0100, Romain Naour <romain.naour@gmail.com> wrote:
> 
>> Hi J?r?me,
>>
>> Thanks for your feedback!
>>
>> Le 11/01/2021 ? 15:02, J?r?me Pouiller a ?crit?:
>>> Hi Romain, Garry,
>>>
>>> On Monday 11 January 2021 14:12:08 CET Gary Bisson wrote:  
>>>> On Sun, Jan 10, 2021 at 06:46:38PM +0100, Romain Naour wrote:  
>>>>> Le 07/01/2021 ? 12:04, Romain Naour a ?crit :  
>>>>>> This package needs to be updated to build with the NXP imx_5.4.x_2.1.0 release.
>>>>>>
>>>>>> Don't override CFLAGS on the command line otherwise we loose some include paths
>>>>>> (ex: -I./vivante_gal).
>>>>>> CFLAGS is already provided by TARGET_CONFIGURE_OPTS in make environment.  
>>>>>
>>>>> What's the status of vivante gpu support for X11 ? especially for kernel >= 5.4.  
>>>>
>>>> Don't know. To be honest, i.MX6 will soon be a legacy product for NXP
>>>> releases so I strongly suggest moving to mainline + Etnaviv.  
>>>
>>> Same here, I haven't worked on iMX6 for a while. The last teams I know who develop
>>> new iMX6 designs use Etnaviv..  
>>
>> I haven't worked a lot for customer on iMX6, but each time they used Yocto and
>> NXP BSP. Last time I tried to use Etnaviv with linux-imx, the kernel build was
>> broken.
>>
> 
> On a past project I worked on a iMX6 platform with etnaviv (using Qt eglfs and
> qtquickcontrols for the GUI and GStreamer for video/audio recording/streaming)
> using mainline linux kernel...., worked very well...

Yes, as soon as you use a mainline kernel with Etnaviv it should work as
expected. My point is when you use a linux-imx from NXP BSP (that was changed to
use vivante) and try to enable etnaviv. I had some build issues.


I just finished to configure the xserver to use etnaviv (mainline kernel and
mesa3d):

# glxinfo -B -display :0
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: etnaviv (0xffffffff)
    Device: Vivante GC2000 rev 5108 (0xffffffff)
    Version: 20.3.2
    Accelerated: yes
    Video memory: 0MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 1.3
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0
OpenGL vendor string: etnaviv
OpenGL renderer string: Vivante GC2000 rev 5108
OpenGL version string: 1.3 Mesa 20.3.2

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 20.3.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

I just had to backport one patch to xserver 1.20.10:

https://cgit.freedesktop.org/xorg/xserver/commit/?id=26004df63c25061586a967f3586795a75280acc2

Surprisingly etnaviv driver expose OpenGL 1.3 while the vivante driver expose
OpenGL 3.1:

(Debian buster image)
$ glxinfo -B
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
OpenGL vendor string: Vivante Corporation
OpenGL renderer string: Vivante GC2000
OpenGL version string: 3.1 V6.2.4.p4.190076
OpenGL shading language version string: 3.00
OpenGL context flags: (none)


Best regards,
Romain


> 
> Regards,
> Peter
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-12 21:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 11:04 [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Romain Naour
2021-01-07 11:04 ` [Buildroot] [RFC: 2/4] package/freescale-imx/imx-gpu-viv: avoid removing openGL headers when mesa3d is also selected Romain Naour
2021-01-07 11:04 ` [Buildroot] [RFC: 3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0 Romain Naour
2021-01-10 17:46   ` Romain Naour
2021-01-11 13:12     ` Gary Bisson
2021-01-12 10:53       ` Romain Naour
     [not found]       ` <7856829.T7Z3S40VBb@pc-42>
2021-01-12 11:05         ` Romain Naour
2021-01-12 19:32           ` Peter Seiderer
2021-01-12 21:52             ` Romain Naour
2021-01-07 11:04 ` [Buildroot] [RFC: 4/4] package/x11r7/xdriver_xf86-video-imx-viv: select dri swrast driver Romain Naour
2021-01-07 17:04 ` [Buildroot] [RFC: 1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider Yann E. MORIN
2021-01-07 17:05   ` Yann E. MORIN
2021-01-07 20:19   ` Romain Naour

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.