diff mbox series

[RFC:,3/4] package/x11r7/xdriver_xf86-video-imx-viv: bump to version rel_imx_5.4.24_2.1.0

Message ID 20210107110450.4031102-3-romain.naour@gmail.com
State New
Headers show
Series [RFC:,1/4] package/freescale-imx/imx-gpu-viv: BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_{X11, WL} are libgl provider | expand

Commit Message

Romain Naour Jan. 7, 2021, 11:04 a.m. UTC
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(-)

Comments

Romain Naour Jan. 10, 2021, 5:46 p.m. UTC | #1
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
>
Gary Bisson Jan. 11, 2021, 1:12 p.m. UTC | #2
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
Romain Naour Jan. 12, 2021, 10:53 a.m. UTC | #3
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
>
Romain Naour Jan. 12, 2021, 11:05 a.m. UTC | #4
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
> 
>
Peter Seiderer Jan. 12, 2021, 7:32 p.m. UTC | #5
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
Romain Naour Jan. 12, 2021, 9:52 p.m. UTC | #6
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
>
diff mbox series

Patch

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