From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: Build core-image-weston for beaglebone/am335x with GPU SGX530 enabled To: meta-ti@lists.yoctoproject.org From: "Luca" X-Originating-Location: Arzignano, Veneto, IT (185.23.87.190) X-Originating-Platform: Windows Chrome 81 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sun, 17 May 2020 14:22:39 -0700 References: In-Reply-To: Message-ID: <23459.1589750559600576112@lists.yoctoproject.org> Content-Type: multipart/alternative; boundary="afjnVLsORQBhP1qI3CRx" --afjnVLsORQBhP1qI3CRx Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Probably the topic was too broad, I think I got a partial solution and here you have a partial reply: To my understanding, when using OpenGL and EGL there are two common scenar= ios: * The provider for both GL and EGL is mesa: that works fine in our case * The provider for GL is mesa (specifically mesa-gl) and the provider for = EGL is a GPU user space module (in our case ti-sgx-ddk-um): that at the mom= ent is giving some bitbake errors due to a conflict. Indeed both mesa-gl an= d ti-sgx-ddk-um provide the header khrplatform.h and the library libglapi Since my goal is to use the GPU provided by the am335x SOC I have to focus= on the second one. To setup the second scenario in a .conf file we have to set: IMAGE_INSTALL_append =3D " ti-sgx-ddk-km ti-sgx-ddk-um libdrm" PREFERRED_PROVIDER_virtual/egl =3D "ti-sgx-ddk-um" PREFERRED_PROVIDER_virtual/libgles1=3D "ti-sgx-ddk-um" PREFERRED_PROVIDER_virtual/libgles2 =3D "ti-sgx-ddk-um" PREFERRED_PROVIDER_virtual/libgl =3D "mesa-gl" PREFERRED_PROVIDER_virtual/mesa =3D "mesa-gl" PREFERRED_PROVIDER_libgbm =3D "libgbm" PREFERRED_PROVIDER_libgbm-dev =3D "libgbm-dev" Moreover,=C2=A0since TI provides its own version of libgbm, in a mesa-gl_%= .bbappend we set PACKAGES_remove =3D "libgbm" PACKAGES_remove =3D "libgbm-dev" EXTRA_OECONF_remove =3D "--enable-gbm" (Reference Automotive Grade Linux ( https://gerrit.automotivelinux.org/ger= rit/gitweb?p=3DAGL/meta-agl.git;a=3Dblob;f=3Dmeta-agl-bsp/meta-ti/recipes-g= raphics/mesa/mesa-gl_%25.bbappend;h=3Da5a69513ab927aa054d358aa699845fc43501= 2a6;hb=3DHEAD) ) ) This way the "providers should be set up properly" but unfortunately (depe= nding on the=C2=A0openembedded-core we are using) we could get the error: " file /usr/include/KHR/khrplatform.h is installed by both ti-sgx-ddk-um a= nd mesa-gl, aborting " This seems to be caused by mesa commit 87c156183 ( https://lists.yoctoproj= ect.org/g/meta-ti/topic/build_core_image_weston_for/87c1561 ) that installs= the header khrplatform.h even when mesa should provide only opengl. In other BSP layers the issue has been fixed preventing the GPU module to = install the header (See meta-xilinx ( https://www.yoctoproject.org/pipermai= l/meta-xilinx/2019-November/004555.html ) ). I don't know if it is the proper solution, but I tried to implement it and= I patched the Makefile in omap5-sgx-ddk-um-linux, results: - The error related to khrplatform.h is gone - I get another similar error about libglapi.so being installed by both ti= -sgx-ddk-um and mesa-gl. Should I disable its installation too? Not sure... Any suggestion? Regards Luca --afjnVLsORQBhP1qI3CRx Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Probably the topic was too broad,

I think I got a partial soluti= on and here you have a partial reply:

To my understanding, when = using OpenGL and EGL there are two common scenarios:
  1. The provider for both GL and EGL is mesa: that works fine in our case<= /li>
  2. The provider for GL is mesa (specifically mesa-gl) and the provider fo= r EGL is a GPU user space module (in our case ti-sgx-ddk-um): that at the moment is giving some bitbake errors due to a conflict. Indeed= both mesa-gl and ti-sgx-ddk-um provide the header khrplatform.h and the li= brary libglapi
Since my goal is to use the GPU provided by the am335x SOC I have to focus= on the second one.

To setup the second scenario in a .conf file= we have to set:

IMAGE_INSTALL_append =3D " ti-sgx= -ddk-km ti-sgx-ddk-um libdrm"
PREFERRED_PROVIDER_virtual/egl =3D "ti-= sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgles1=3D = "ti-sgx-ddk-um"
PREFERRED_PROVIDER_virtual/libgles2 =3D "ti-sgx-ddk-um= "
PREFERRED_PROVIDER_virtual/libgl =3D "mesa-gl"
PREFERRED_PROVID= ER_virtual/mesa =3D "mesa-gl"
PREFERRED_PROVIDER_libgbm =3D "libgbm"PREFERRED_PROVIDER_libgbm-dev =3D "libgbm-dev"
 
Moreover, since TI provides its own version of libgbm, in a mesa= -gl_%.bbappend we set

PACKAGES_remove =3D "libgbm"
PACKAGES_remove =3D "libgbm-d= ev"
EXTRA_OECONF_remove =3D "--enable-gbm"

(Reference Automotive Grade Linux<= /a>)

This way the "providers should be set up properly" but= unfortunately (depending on the openembedded-core we are using) we co= uld get the error:
"file /usr/include/KHR/khrplatform.h is installed by both ti-= sgx-ddk-um and mesa-gl, aborting"

This seems to be ca= used by mesa commit 
87c156183 that instal= ls the header khrplatform.h even= when mesa should provide only opengl.
In other BSP layers the issue has be= en fixed preventing the GPU module to install the header (See <= a style=3D"font-size: 14.6667px;" href=3D"https://www.yoctoproject.org/pipe= rmail/meta-xilinx/2019-November/004555.html" target=3D"_blank" rel=3D"noope= ner">meta-xilinx).
I don't know if it is the proper soluti= on, but I tried to implement it and I patched the Makefile in omap5-sgx-ddk= -um-linux, results:
- The error related to khrplatform.h is gone
- I get another similar e= rror about libglapi.so being installed by both 
ti-sgx-ddk-um a= nd mesa-gl. Should I disable its installation too? Not sure...

<= /span>Any suggestion?

Regards
Luca --afjnVLsORQBhP1qI3CRx--