[1/3] ti-sgx-libgbm: new package

Message ID 1530773875-19452-1-git-send-email-tolvupostur@gmail.com
State New
Headers show
Series
  • [1/3] ti-sgx-libgbm: new package
Related show

Commit Message

Einar Jón July 5, 2018, 6:57 a.m.
ti-sgx-libgbm is a required package for ti-sgx-um in SDK 4.00

Signed-off-by: Einar Jon Gunnarsson <tolvupostur@gmail.com>
---
 package/Config.in                        |  1 +
 package/ti-sgx-libgbm/Config.in          |  9 +++++++++
 package/ti-sgx-libgbm/ti-sgx-libgbm.hash |  3 +++
 package/ti-sgx-libgbm/ti-sgx-libgbm.mk   | 17 +++++++++++++++++
 4 files changed, 30 insertions(+)
 create mode 100644 package/ti-sgx-libgbm/Config.in
 create mode 100644 package/ti-sgx-libgbm/ti-sgx-libgbm.hash
 create mode 100644 package/ti-sgx-libgbm/ti-sgx-libgbm.mk

Comments

Bernd Kuhls July 9, 2018, 5:53 p.m. | #1
Am Thu, 05 Jul 2018 08:57:53 +0200 schrieb Einar Jon Gunnarsson:

> --- /dev/null
> +++ b/package/ti-sgx-libgbm/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_TI_SGX_LIBGBM
> +	bool "ti-sgx-libgbm"
> +	depends on BR2_PACKAGE_TI_SGX_KM
> +	select BR2_PACKAGE_WAYLAND
> +	help
> +	  This package provides libgbm.so.2 for the
> +	  TI SGX implementation
> +
> +	  https://git.ti.com/glsdk/libgbm

a similar patch was posted two years ago:
http://lists.busybox.net/pipermail/buildroot/2016-July/167443.html

Back then Thomas wrote:
"Is this libgbm a TI-specific implementation of the libgm available in
 Mesa ? If that's the case, then it's going to be complicated to
 package, as we would have two implementations of the same API."

Working on the next bump of Kodi to v18 I needed to build mesa3d with 
libgbm only, no x11, no wayland. To do so I created a virtual package for 
libgbm which could be used by your package as well to solve the problem 
Thomas noted:

https://github.com/bkuhls/buildroot/commit/
af585ebdd2627980eda0581f99aa844c7292d4de

https://github.com/bkuhls/buildroot/
commit/92a0e96c32aac50a7e28eb0941463c21b119a727

The whole code is still WIP and closely bound to my Kodi repo but you 
should get the idea ;)

Regards, Bernd
Einar Jón July 10, 2018, 5:09 p.m. | #2
Hello Bernd


On 9 July 2018 at 19:53, Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
> Am Thu, 05 Jul 2018 08:57:53 +0200 schrieb Einar Jon Gunnarsson:
>
>> --- /dev/null
>> +++ b/package/ti-sgx-libgbm/Config.in
>> @@ -0,0 +1,9 @@
>> +config BR2_PACKAGE_TI_SGX_LIBGBM
>> +     bool "ti-sgx-libgbm"
>> +     depends on BR2_PACKAGE_TI_SGX_KM
>> +     select BR2_PACKAGE_WAYLAND
>> +     help
>> +       This package provides libgbm.so.2 for the
>> +       TI SGX implementation
>> +
>> +       https://git.ti.com/glsdk/libgbm
>
> a similar patch was posted two years ago:
> http://lists.busybox.net/pipermail/buildroot/2016-July/167443.html
>
> Back then Thomas wrote:
> "Is this libgbm a TI-specific implementation of the libgm available in
>  Mesa ? If that's the case, then it's going to be complicated to
>  package, as we would have two implementations of the same API."

This is indeed a TI-specific implementation of the libgm available in Mesa.
Since it is only available for a subset of ARM CPUs, and Mesa not
available on ARM, I don't see a big risk of conflicts.

>
> Working on the next bump of Kodi to v18 I needed to build mesa3d with
> libgbm only, no x11, no wayland. To do so I created a virtual package for
> libgbm which could be used by your package as well to solve the problem
> Thomas noted:

Interesting. This implementation of libgbm links to Wayland, and will
not run without it. X11 is not needed.

The virtual package makes sense.
Thomas Petazzoni Sept. 13, 2018, 3:34 p.m. | #3
Hello Einar,

On Thu,  5 Jul 2018 08:57:53 +0200, Einar Jon Gunnarsson wrote:
> ti-sgx-libgbm is a required package for ti-sgx-um in SDK 4.00
> 
> Signed-off-by: Einar Jon Gunnarsson <tolvupostur@gmail.com>

I tested this package, and it didn't build because it depends on libdrm
and udev, and those dependencies are not taken into account.

> diff --git a/package/ti-sgx-libgbm/Config.in b/package/ti-sgx-libgbm/Config.in
> new file mode 100644
> index 0000000..07536d9
> --- /dev/null
> +++ b/package/ti-sgx-libgbm/Config.in
> @@ -0,0 +1,9 @@
> +config BR2_PACKAGE_TI_SGX_LIBGBM
> +	bool "ti-sgx-libgbm"
> +	depends on BR2_PACKAGE_TI_SGX_KM

Is there a reason for having this dependency ? It does not require
having the kernel or the kernel modules built in order to build
ti-sgx-libgbm.

Best regards,

Thomas
Thomas Petazzoni Sept. 13, 2018, 3:36 p.m. | #4
Hello Bernd,

On Mon, 09 Jul 2018 19:53:51 +0200, Bernd Kuhls wrote:

> Back then Thomas wrote:
> "Is this libgbm a TI-specific implementation of the libgm available in
>  Mesa ? If that's the case, then it's going to be complicated to
>  package, as we would have two implementations of the same API."
> 
> Working on the next bump of Kodi to v18 I needed to build mesa3d with 
> libgbm only, no x11, no wayland. To do so I created a virtual package for 
> libgbm which could be used by your package as well to solve the problem 
> Thomas noted:

Did you made some progress with this libgbm work? We can't merge
ti-sgx-libgbm without this, otherwise we would have two packages
installing the same conflicting library.

So perhaps it would be nice to have a simple patch series adding a
libgbm virtual package, and adding mesa3d as a provider for it.

Best regards,

Thomas
Bernd Kuhls Sept. 13, 2018, 7:49 p.m. | #5
Am Thu, 13 Sep 2018 17:36:06 +0200 schrieb Thomas Petazzoni:

> So perhaps it would be nice to have a simple patch series adding a
> libgbm virtual package, and adding mesa3d as a provider for it.

Hi Thomas,

this should be enough:
http://patchwork.ozlabs.org/project/buildroot/list/?series=65595

Regards, Bernd
Einar Jón Sept. 13, 2018, 7:53 p.m. | #6
Oh boy,

This was all before the birth of my first child, which seems like a
lifetime ago.

A virtual package would be fine, but I have no other comments on the 2
newest mails.

On Thu, 13 Sep 2018 at 17:34, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Einar,
>
> On Thu,  5 Jul 2018 08:57:53 +0200, Einar Jon Gunnarsson wrote:
> > ti-sgx-libgbm is a required package for ti-sgx-um in SDK 4.00
> >
> > Signed-off-by: Einar Jon Gunnarsson <tolvupostur@gmail.com>
>
> I tested this package, and it didn't build because it depends on libdrm
> and udev, and those dependencies are not taken into account.

I didn't think of that. I only built it on the
beaglebone-qt_defconfig, and my own am335 config,
which both have udev and libdrm.

> > diff --git a/package/ti-sgx-libgbm/Config.in b/package/ti-sgx-libgbm/Config.in
> > new file mode 100644
> > index 0000000..07536d9
> > --- /dev/null
> > +++ b/package/ti-sgx-libgbm/Config.in
> > @@ -0,0 +1,9 @@
> > +config BR2_PACKAGE_TI_SGX_LIBGBM
> > +     bool "ti-sgx-libgbm"
> > +     depends on BR2_PACKAGE_TI_SGX_KM
>
> Is there a reason for having this dependency ? It does not require
> having the kernel or the kernel modules built in order to build
> ti-sgx-libgbm.

This dependency is mostly there for consistency with the other
BR2_PACKAGE_TI_SGX_*
packages.
ti-sgx-um and ti-sgx-demos are like this, which makes hiding them in
menuconfig easier.
This one is the ti-sgx implementation of the mesa libgbm, and the
shared libs in ti-sgx-um
depend on it. It probably won't be useful on anything that else than
ARMs that use ti-sgx-um
(which also depends on ti-sgx-km).
So what are you trying to build them on?

Building the package is one thing, but what is the point of building
it if you don't have anything
that can use it? I think you need the ti-sgx kernel module for
anything meaningful.

Note that Mesa3D does not build on ARM, and this only builds on a
subset of ARM, so it is literally
impossible to create a defconfig that contains both implementations of
libgbm. Conflicts can't happen.
Thomas Petazzoni Sept. 14, 2018, 7:18 a.m. | #7
Hello Einar,

On Thu, 13 Sep 2018 21:53:14 +0200, Einar Jón wrote:

> This was all before the birth of my first child, which seems like a
> lifetime ago.

Hehe. Been there, done that :-)

> > I tested this package, and it didn't build because it depends on libdrm
> > and udev, and those dependencies are not taken into account.  
> 
> I didn't think of that. I only built it on the
> beaglebone-qt_defconfig, and my own am335 config,
> which both have udev and libdrm.

Yes, I tried building just ti-sgx-libgbm.

> > Is there a reason for having this dependency ? It does not require
> > having the kernel or the kernel modules built in order to build
> > ti-sgx-libgbm.  
> 
> This dependency is mostly there for consistency with the other
> BR2_PACKAGE_TI_SGX_*
> packages.
> ti-sgx-um and ti-sgx-demos are like this, which makes hiding them in
> menuconfig easier.
> This one is the ti-sgx implementation of the mesa libgbm, and the
> shared libs in ti-sgx-um
> depend on it. It probably won't be useful on anything that else than
> ARMs that use ti-sgx-um
> (which also depends on ti-sgx-km).
> So what are you trying to build them on?

I wanted to quickly build test ti-sgx-libgbm, and not have to build a
kernel + kernel modules, so I dropped the "depends on" on TI SGX kernel
modules.

> Building the package is one thing, but what is the point of building
> it if you don't have anything
> that can use it? I think you need the ti-sgx kernel module for
> anything meaningful.

Build testing :-)

> Note that Mesa3D does not build on ARM,

Mesa3D definitely builds on ARM, and there is even support in Mesa3D
for GPUs that are *only* found on ARM processors. See vc4, vc5, etnaviv
and freedreno for example.

> and this only builds on a subset of ARM, so it is literally
> impossible to create a defconfig that contains both implementations of
> libgbm. 

As explained above, Mesa3D is available on ARM. While it indeed doesn't
have support for the PowerVR in TI platforms, you can still enable
Mesa3D using the softpipe or llvmpipe drivers on ARM TI platforms, so
it is possible to have a conflict.

Best regards,

Thomas
Einar Jón Sept. 15, 2018, 11:14 a.m. | #8
OK.

So I had time to look at this.
I think the whole thing needs to be reworked. Let's park it for now.
I'll wait for the virtual package to be merged and then add a new
fully tested patch against a more recent master.
If someone bumps beaglebone_defconfig to kernel 4.14.40 (current ti
sdk 5.00), then I would bring beaglebone_qt_defconfig all the way up
to that one.

On Fri, 14 Sep 2018 at 09:18, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> > > Is there a reason for having this dependency ? It does not require
> > > having the kernel or the kernel modules built in order to build
> > > ti-sgx-libgbm.
> >
> I wanted to quickly build test ti-sgx-libgbm, and not have to build a
> kernel + kernel modules, so I dropped the "depends on" on TI SGX kernel
> modules.
> > Building the package is one thing, but what is the point of building
> > it if you don't have anything
> > that can use it? I think you need the ti-sgx kernel module for
> > anything meaningful.
>
> Build testing :-)
>

But you don't need to build ti-sgx-km (and therefore kernel) to
build this package. This is just to hide it in menuconfig.
I added these:
# make sure libdrm builds udev
ti-sgx-um: depends on BR2_PACKAGE_HAS_UDEV
# lazy way to add all the depends of ti-sgx-um
ti-sgx-libgbm: depends on BR2_PACKAGE_TI_SGX_UM
# make sure we have libdrm+udev for ti-sgx-libgbm
TI_SGX_LIBGBM_DEPENDENCIES += libdrm
Then 'make ti-sgx-libgbm' on an empty folder works fine, and doesn't build
kernel or ti-sgx-km/ti-sgx-um.

I just noticed that  ti-sgx-demos depends on ti-sgx-um, not ti-sgx-km.
This one is the same, I doubt that anyone can use it without ti-sgx-um.
So it might make more sense to just make this depend on ti-sgx-um.
But since ti-sgx-um selects it, it can't be selected alone
(always "-*-" in menuconfig or hidden/disabled).
How do you guys like to handle that kind of dependency?

> As explained above, Mesa3D is available on ARM. While it indeed doesn't
> have support for the PowerVR in TI platforms, you can still enable
> Mesa3D using the softpipe or llvmpipe drivers on ARM TI platforms, so
> it is possible to have a conflict.

You're right. I just always assumed Mesa was for Intel CPUs.
Virtual package FTW.

--
Regards
Einar Jón

Patch

diff --git a/package/Config.in b/package/Config.in
index 20fe5ad..c2046a1 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -522,6 +522,7 @@  endmenu
 	source "package/ti-sgx-demos/Config.in"
 	source "package/ti-sgx-km/Config.in"
 	source "package/ti-sgx-um/Config.in"
+	source "package/ti-sgx-libgbm/Config.in"
 	source "package/ti-uim/Config.in"
 	source "package/ti-utils/Config.in"
 	source "package/triggerhappy/Config.in"
diff --git a/package/ti-sgx-libgbm/Config.in b/package/ti-sgx-libgbm/Config.in
new file mode 100644
index 0000000..07536d9
--- /dev/null
+++ b/package/ti-sgx-libgbm/Config.in
@@ -0,0 +1,9 @@ 
+config BR2_PACKAGE_TI_SGX_LIBGBM
+	bool "ti-sgx-libgbm"
+	depends on BR2_PACKAGE_TI_SGX_KM
+	select BR2_PACKAGE_WAYLAND
+	help
+	  This package provides libgbm.so.2 for the
+	  TI SGX implementation
+
+	  https://git.ti.com/glsdk/libgbm
diff --git a/package/ti-sgx-libgbm/ti-sgx-libgbm.hash b/package/ti-sgx-libgbm/ti-sgx-libgbm.hash
new file mode 100644
index 0000000..ffcf134
--- /dev/null
+++ b/package/ti-sgx-libgbm/ti-sgx-libgbm.hash
@@ -0,0 +1,3 @@ 
+# locally computed:
+sha256 758872d87137a919274bdbb9b9c811e2f309ab0338e58a4c67df6db7b2a6c6f5 ti-sgx-libgbm-43cc786d0e5b8274fa93048c7f3bb8d6b62522db.tar.gz
+sha256 dd6e66175f7f4ffe27f5f4dcc35005e07e6ef3aae2ec6fafaf52a53adb450cc1 debian/copyright
diff --git a/package/ti-sgx-libgbm/ti-sgx-libgbm.mk b/package/ti-sgx-libgbm/ti-sgx-libgbm.mk
new file mode 100644
index 0000000..29f6866
--- /dev/null
+++ b/package/ti-sgx-libgbm/ti-sgx-libgbm.mk
@@ -0,0 +1,17 @@ 
+################################################################################
+#
+# ti-sgx-libgbm
+#
+################################################################################
+
+# This is the current "next" branch, which corresponds to SDK 04.00.00.00
+TI_SGX_LIBGBM_VERSION = 43cc786d0e5b8274fa93048c7f3bb8d6b62522db
+TI_SGX_LIBGBM_SITE = git://git.ti.com/glsdk/libgbm.git
+TI_SGX_LIBGBM_INSTALL_STAGING = YES
+TI_SGX_LIBGBM_AUTORECONF = YES
+TI_SGX_LIBGBM_LICENSE = MIT
+TI_SGX_LIBGBM_LICENSE_FILES = debian/copyright
+
+TI_SGX_LIBGBM_DEPENDENCIES = wayland
+
+$(eval $(autotools-package))