All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support
@ 2022-07-21 14:49 Alexandru Ardelean
  2022-07-21 16:16 ` Thomas Petazzoni via buildroot
  2022-07-22  7:01 ` [Buildroot] [PATCH v2] " Alexandru Ardelean
  0 siblings, 2 replies; 12+ messages in thread
From: Alexandru Ardelean @ 2022-07-21 14:49 UTC (permalink / raw)
  To: buildroot; +Cc: Alexandru Ardelean

When building with DRM support, it can happen that the libgbm library
is not yet built by the provider of libgbm (specified by
BR2_PACKAGE_PROVIDES_LIBGBM).

The docs in cog `docs/platform-drm.md` specify this dep-list:
- **WPEBackend-fdo**:
- **Wayland**:
- **libdrm**:
- **libgbm**:
- **libinput**:
- **libudev**:

libgbm needs to be added, whereas `libudev` is provided by systemd (in my
case).

What happens (in my case) is that cog gets built before mesa3d (which is
the libgbm provider).

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
---

If this could be backported to branch '2022.05.x', it would be great :)
No worries if there is ont intent to do so.

 package/cog/cog.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/cog/cog.mk b/package/cog/cog.mk
index f2ca0af93d..1d68ef1b7e 100644
--- a/package/cog/cog.mk
+++ b/package/cog/cog.mk
@@ -28,7 +28,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
 COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
-COG_DEPENDENCIES += libdrm libinput
+COG_DEPENDENCIES += libdrm libinput libgbm
 else
 COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
 endif
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support
  2022-07-21 14:49 [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support Alexandru Ardelean
@ 2022-07-21 16:16 ` Thomas Petazzoni via buildroot
  2022-07-22  6:25   ` Alexandru Ardelean
  2022-07-22  7:01 ` [Buildroot] [PATCH v2] " Alexandru Ardelean
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-21 16:16 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: Adrian Perez de Castro, buildroot

Hello Alexandru,

On Thu, 21 Jul 2022 17:49:39 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> When building with DRM support, it can happen that the libgbm library
> is not yet built by the provider of libgbm (specified by
> BR2_PACKAGE_PROVIDES_LIBGBM).
> 
> The docs in cog `docs/platform-drm.md` specify this dep-list:
> - **WPEBackend-fdo**:
> - **Wayland**:
> - **libdrm**:
> - **libgbm**:
> - **libinput**:
> - **libudev**:
> 
> libgbm needs to be added, whereas `libudev` is provided by systemd (in my
> case).

Then udev should also be in the dependencies when
BR2_PACKAGE_COG_PLATFORM_DRM=y.

>  ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
>  COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
> -COG_DEPENDENCIES += libdrm libinput
> +COG_DEPENDENCIES += libdrm libinput libgbm

That is correct, but not complete. The DRM platform code in Cog also
uses EGL, so we would also need libegl in the list of dependencies. In
pratice, libgbm and libegl are most likely implemented by the same
package, but for the sake of correctness, it would be better to have
both.

Another thing that is wrong is:

	depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm

in the Config.in file. This used to be the only way to detect the
availability of gbm, but since quite some time now, we have the libgbm
virtual package.

So this should be instead:

	depends on BR2_PACKAGE_HAS_LIBGBM

and I'm pretty sure Cog uses some "advanced" features of libgbm, so
most likely at least depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
is needed, and probably also depends on
BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT is needed.
See package/opengl/libgbm/Config.in for details.

Of course, this aspect should be in a different patch: your change to
add "libgbm" in the DEPENDENCIES variable is really a fix, while my
proposed change in the Config.in file is really an improvement, that
will allow using Cog on libgbm-capable platforms that don't use mesa3d
as their OpenGL/libgbm implementation.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support
  2022-07-21 16:16 ` Thomas Petazzoni via buildroot
@ 2022-07-22  6:25   ` Alexandru Ardelean
  2022-07-22  6:38     ` Alexandru Ardelean
  0 siblings, 1 reply; 12+ messages in thread
From: Alexandru Ardelean @ 2022-07-22  6:25 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Adrian Perez de Castro, buildroot

On Thu, Jul 21, 2022 at 7:16 PM Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
>
> Hello Alexandru,
>
> On Thu, 21 Jul 2022 17:49:39 +0300
> Alexandru Ardelean <ardeleanalex@gmail.com> wrote:
>
> > When building with DRM support, it can happen that the libgbm library
> > is not yet built by the provider of libgbm (specified by
> > BR2_PACKAGE_PROVIDES_LIBGBM).
> >
> > The docs in cog `docs/platform-drm.md` specify this dep-list:
> > - **WPEBackend-fdo**:
> > - **Wayland**:
> > - **libdrm**:
> > - **libgbm**:
> > - **libinput**:
> > - **libudev**:
> >
> > libgbm needs to be added, whereas `libudev` is provided by systemd (in my
> > case).
>
> Then udev should also be in the dependencies when
> BR2_PACKAGE_COG_PLATFORM_DRM=y.
>
> >  ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
> >  COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
> > -COG_DEPENDENCIES += libdrm libinput
> > +COG_DEPENDENCIES += libdrm libinput libgbm
>
> That is correct, but not complete. The DRM platform code in Cog also
> uses EGL, so we would also need libegl in the list of dependencies. In
> pratice, libgbm and libegl are most likely implemented by the same
> package, but for the sake of correctness, it would be better to have
> both.
>
> Another thing that is wrong is:
>
>         depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
>
> in the Config.in file. This used to be the only way to detect the
> availability of gbm, but since quite some time now, we have the libgbm
> virtual package.
>
> So this should be instead:
>
>         depends on BR2_PACKAGE_HAS_LIBGBM

So, I'm assuming a V2, would contain adding BR2_PACKAGE_HAS_LIBGBM to
the Config.in and libegl to the DEPENDENCIES var.

I can also do the second version, after the fix is agreed upon.
But no promises :)

>
> and I'm pretty sure Cog uses some "advanced" features of libgbm, so
> most likely at least depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> is needed, and probably also depends on
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT is needed.
> See package/opengl/libgbm/Config.in for details.
>
> Of course, this aspect should be in a different patch: your change to
> add "libgbm" in the DEPENDENCIES variable is really a fix, while my
> proposed change in the Config.in file is really an improvement, that
> will allow using Cog on libgbm-capable platforms that don't use mesa3d
> as their OpenGL/libgbm implementation.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support
  2022-07-22  6:25   ` Alexandru Ardelean
@ 2022-07-22  6:38     ` Alexandru Ardelean
  2022-07-22  6:59       ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 12+ messages in thread
From: Alexandru Ardelean @ 2022-07-22  6:38 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Adrian Perez de Castro, buildroot

On Fri, Jul 22, 2022 at 9:25 AM Alexandru Ardelean
<ardeleanalex@gmail.com> wrote:
>
> On Thu, Jul 21, 2022 at 7:16 PM Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> >
> > Hello Alexandru,
> >
> > On Thu, 21 Jul 2022 17:49:39 +0300
> > Alexandru Ardelean <ardeleanalex@gmail.com> wrote:
> >
> > > When building with DRM support, it can happen that the libgbm library
> > > is not yet built by the provider of libgbm (specified by
> > > BR2_PACKAGE_PROVIDES_LIBGBM).
> > >
> > > The docs in cog `docs/platform-drm.md` specify this dep-list:
> > > - **WPEBackend-fdo**:
> > > - **Wayland**:
> > > - **libdrm**:
> > > - **libgbm**:
> > > - **libinput**:
> > > - **libudev**:
> > >
> > > libgbm needs to be added, whereas `libudev` is provided by systemd (in my
> > > case).
> >
> > Then udev should also be in the dependencies when
> > BR2_PACKAGE_COG_PLATFORM_DRM=y.
> >
> > >  ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
> > >  COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
> > > -COG_DEPENDENCIES += libdrm libinput
> > > +COG_DEPENDENCIES += libdrm libinput libgbm
> >
> > That is correct, but not complete. The DRM platform code in Cog also
> > uses EGL, so we would also need libegl in the list of dependencies. In
> > pratice, libgbm and libegl are most likely implemented by the same
> > package, but for the sake of correctness, it would be better to have
> > both.
> >
> > Another thing that is wrong is:
> >
> >         depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
> >
> > in the Config.in file. This used to be the only way to detect the
> > availability of gbm, but since quite some time now, we have the libgbm
> > virtual package.
> >
> > So this should be instead:
> >
> >         depends on BR2_PACKAGE_HAS_LIBGBM
>
> So, I'm assuming a V2, would contain adding BR2_PACKAGE_HAS_LIBGBM to
> the Config.in and libegl to the DEPENDENCIES var.
>
> I can also do the second version, after the fix is agreed upon.
> But no promises :)
>
> >
> > and I'm pretty sure Cog uses some "advanced" features of libgbm, so
> > most likely at least depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> > is needed, and probably also depends on
> > BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT is needed.
> > See package/opengl/libgbm/Config.in for details.
> >
> > Of course, this aspect should be in a different patch: your change to
> > add "libgbm" in the DEPENDENCIES variable is really a fix, while my
> > proposed change in the Config.in file is really an improvement, that
> > will allow using Cog on libgbm-capable platforms that don't use mesa3d
> > as their OpenGL/libgbm implementation.

Apologies for not including this part in the second email.
So, at least cog 0.12.4 that is currently packaged in Buildroot
doesn't seem to support (yet)
BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
and
BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF

at least what 'package/opengl/libgbm/Config.in ' mentions:
- i can't see any use of gbm_device_get_format_modifier_plane_count in
cog 0.12.4
- i can't see any use of gbm_bo_get_fd in cog 0.12.4

And also looking now through the code, I see that EGL is used in all 3
platforms (DRM, X11 and Wayland).
Buildroot builds for Wayland and DRM (AFAICT).
So, I guess libegl is explicitly required for the DRM platform.

> >
> > Best regards,
> >
> > Thomas
> > --
> > Thomas Petazzoni, co-owner and CEO, Bootlin
> > Embedded Linux and Kernel engineering and training
> > https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support
  2022-07-22  6:38     ` Alexandru Ardelean
@ 2022-07-22  6:59       ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-22  6:59 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: Adrian Perez de Castro, buildroot

On Fri, 22 Jul 2022 09:38:02 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> > > Of course, this aspect should be in a different patch: your change to
> > > add "libgbm" in the DEPENDENCIES variable is really a fix, while my
> > > proposed change in the Config.in file is really an improvement, that
> > > will allow using Cog on libgbm-capable platforms that don't use mesa3d
> > > as their OpenGL/libgbm implementation.  
> 
> Apologies for not including this part in the second email.
> So, at least cog 0.12.4 that is currently packaged in Buildroot
> doesn't seem to support (yet)

It's not about whether cog supports it, but whether it uses it.

> BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> and
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> 
> at least what 'package/opengl/libgbm/Config.in ' mentions:
> - i can't see any use of gbm_device_get_format_modifier_plane_count in
> cog 0.12.4

Correct, but it is using:

gbm_bo_get_plane_count
gbm_bo_get_handle_for_plane
gbm_bo_get_stride_for_plane

etc. which are also related to the same "plane" support. Actually, I'm
wondering if the name
BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT was really
the best.

We do have versions of libgbm that don't have any support for this
plane API.

> - i can't see any use of gbm_bo_get_fd in cog 0.12.4
> 
> And also looking now through the code, I see that EGL is used in all 3
> platforms (DRM, X11 and Wayland).
> Buildroot builds for Wayland and DRM (AFAICT).
> So, I guess libegl is explicitly required for the DRM platform.

Correct.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
  2022-07-21 14:49 [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support Alexandru Ardelean
  2022-07-21 16:16 ` Thomas Petazzoni via buildroot
@ 2022-07-22  7:01 ` Alexandru Ardelean
  2022-07-22  7:05   ` Alexandru Ardelean
                     ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Alexandru Ardelean @ 2022-07-22  7:01 UTC (permalink / raw)
  To: buildroot; +Cc: aperez, Alexandru Ardelean, thomas.petazzoni

When building with the DRM support, it can happen that the libgbm library
is not yet built by the provider of this lib (specified by
BR2_PACKAGE_PROVIDES_LIBGBM).

The docs in cog `docs/platform-drm.md` specify this dep-list:
- **WPEBackend-fdo**:
- **Wayland**:
- **libdrm**:
- **libgbm**:
- **libinput**:
- **libudev**:

libgbm needs to be added.
Adding libegl as well.

Updated package/cog/Config.in to define the dependencies (for DRM)
according to libegl & libgbm.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
---
 package/cog/Config.in | 9 ++++++---
 package/cog/cog.mk    | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/package/cog/Config.in b/package/cog/Config.in
index d4238750f9..484eb85c70 100644
--- a/package/cog/Config.in
+++ b/package/cog/Config.in
@@ -39,7 +39,8 @@ config BR2_PACKAGE_COG_PLATFORM_FDO
 config BR2_PACKAGE_COG_PLATFORM_DRM
 	bool "DRM backend"
 	depends on BR2_PACKAGE_HAS_UDEV # libinput
-	depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
+	depends on BR2_PACKAGE_HAS_LIBEGL
+	depends on BR2_PACKAGE_HAS_LIBGBM
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBINPUT
 	help
@@ -52,7 +53,9 @@ config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
 	help
 	  Expose remote control interface on system bus
 
-comment "DRM platform needs mesa3d w/ EGL driver and GBM"
-	depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL
+comment "DRM platform needs EGL and GBM"
+	depends on \
+		!BR2_PACKAGE_HAS_LIBEGL || \
+		!BR2_PACKAGE_HAS_LIBGBM
 
 endif
diff --git a/package/cog/cog.mk b/package/cog/cog.mk
index f2ca0af93d..da660eb7c1 100644
--- a/package/cog/cog.mk
+++ b/package/cog/cog.mk
@@ -28,7 +28,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
 COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
-COG_DEPENDENCIES += libdrm libinput
+COG_DEPENDENCIES += libdrm libinput libgbm libegl
 else
 COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
 endif
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
  2022-07-22  7:01 ` [Buildroot] [PATCH v2] " Alexandru Ardelean
@ 2022-07-22  7:05   ` Alexandru Ardelean
  2022-07-23  8:48   ` Arnout Vandecappelle
  2022-08-12 15:05   ` Peter Korsgaard
  2 siblings, 0 replies; 12+ messages in thread
From: Alexandru Ardelean @ 2022-07-22  7:05 UTC (permalink / raw)
  To: buildroot; +Cc: Adrian Perez de Castro, Thomas Petazzoni

On Fri, Jul 22, 2022 at 10:02 AM Alexandru Ardelean
<ardeleanalex@gmail.com> wrote:
>
> When building with the DRM support, it can happen that the libgbm library
> is not yet built by the provider of this lib (specified by
> BR2_PACKAGE_PROVIDES_LIBGBM).
>
> The docs in cog `docs/platform-drm.md` specify this dep-list:
> - **WPEBackend-fdo**:
> - **Wayland**:
> - **libdrm**:
> - **libgbm**:
> - **libinput**:
> - **libudev**:
>
> libgbm needs to be added.
> Adding libegl as well.
>
> Updated package/cog/Config.in to define the dependencies (for DRM)
> according to libegl & libgbm.
>

I was sending this V2 while you (Thomas) were replying to my previous email :p

Feel free to nitpick directly on this patch.
I'm still not 100% what you would like this to be.
I'm happy to re-spin as needed ; as long as you tell me directly what to change.

> Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
> ---
>  package/cog/Config.in | 9 ++++++---
>  package/cog/cog.mk    | 2 +-
>  2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/package/cog/Config.in b/package/cog/Config.in
> index d4238750f9..484eb85c70 100644
> --- a/package/cog/Config.in
> +++ b/package/cog/Config.in
> @@ -39,7 +39,8 @@ config BR2_PACKAGE_COG_PLATFORM_FDO
>  config BR2_PACKAGE_COG_PLATFORM_DRM
>         bool "DRM backend"
>         depends on BR2_PACKAGE_HAS_UDEV # libinput
> -       depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
> +       depends on BR2_PACKAGE_HAS_LIBEGL
> +       depends on BR2_PACKAGE_HAS_LIBGBM
>         select BR2_PACKAGE_LIBDRM
>         select BR2_PACKAGE_LIBINPUT
>         help
> @@ -52,7 +53,9 @@ config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
>         help
>           Expose remote control interface on system bus
>
> -comment "DRM platform needs mesa3d w/ EGL driver and GBM"
> -       depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL
> +comment "DRM platform needs EGL and GBM"
> +       depends on \
> +               !BR2_PACKAGE_HAS_LIBEGL || \
> +               !BR2_PACKAGE_HAS_LIBGBM
>
>  endif
> diff --git a/package/cog/cog.mk b/package/cog/cog.mk
> index f2ca0af93d..da660eb7c1 100644
> --- a/package/cog/cog.mk
> +++ b/package/cog/cog.mk
> @@ -28,7 +28,7 @@ endif
>
>  ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
>  COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
> -COG_DEPENDENCIES += libdrm libinput
> +COG_DEPENDENCIES += libdrm libinput libgbm libegl
>  else
>  COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
>  endif
> --
> 2.34.1
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
  2022-07-22  7:01 ` [Buildroot] [PATCH v2] " Alexandru Ardelean
  2022-07-22  7:05   ` Alexandru Ardelean
@ 2022-07-23  8:48   ` Arnout Vandecappelle
       [not found]     ` <48-62dd4800-5-54f5770@160071985>
  2022-07-26  8:29     ` Alexandru Ardelean
  2022-08-12 15:05   ` Peter Korsgaard
  2 siblings, 2 replies; 12+ messages in thread
From: Arnout Vandecappelle @ 2022-07-23  8:48 UTC (permalink / raw)
  To: Alexandru Ardelean, buildroot; +Cc: aperez, thomas.petazzoni



On 22/07/2022 09:01, Alexandru Ardelean wrote:
> When building with the DRM support, it can happen that the libgbm library
> is not yet built by the provider of this lib (specified by
> BR2_PACKAGE_PROVIDES_LIBGBM).

  I've applied this one to master already, however there are two comments on v1 
that remain unaddressed.

> 
> The docs in cog `docs/platform-drm.md` specify this dep-list:
> - **WPEBackend-fdo**:
> - **Wayland**:
> - **libdrm**:
> - **libgbm**:
> - **libinput**:
> - **libudev**:

  This would imply that a dependency on udev is needed as well (both in the 
Config.in and the .mk). It is actually implied by libinput, so we won't get 
build failures, but it's better to have explicit dependencies.

> 
> libgbm needs to be added.
> Adding libegl as well.
> 
> Updated package/cog/Config.in to define the dependencies (for DRM)
> according to libegl & libgbm.
> 
> Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
> ---
>   package/cog/Config.in | 9 ++++++---
>   package/cog/cog.mk    | 2 +-
>   2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/package/cog/Config.in b/package/cog/Config.in
> index d4238750f9..484eb85c70 100644
> --- a/package/cog/Config.in
> +++ b/package/cog/Config.in
> @@ -39,7 +39,8 @@ config BR2_PACKAGE_COG_PLATFORM_FDO
>   config BR2_PACKAGE_COG_PLATFORM_DRM
>   	bool "DRM backend"
>   	depends on BR2_PACKAGE_HAS_UDEV # libinput
> -	depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
> +	depends on BR2_PACKAGE_HAS_LIBEGL
> +	depends on BR2_PACKAGE_HAS_LIBGBM

  It apparently needs the 
BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT feature. You can test 
that by trying a build with rockchip-mali or ti-sgx-um as provider, since those 
packages don't have that feature.


  Regards,
  Arnout

>   	select BR2_PACKAGE_LIBDRM
>   	select BR2_PACKAGE_LIBINPUT
>   	help
> @@ -52,7 +53,9 @@ config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
>   	help
>   	  Expose remote control interface on system bus
>   
> -comment "DRM platform needs mesa3d w/ EGL driver and GBM"
> -	depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL
> +comment "DRM platform needs EGL and GBM"
> +	depends on \
> +		!BR2_PACKAGE_HAS_LIBEGL || \
> +		!BR2_PACKAGE_HAS_LIBGBM
>   
>   endif
> diff --git a/package/cog/cog.mk b/package/cog/cog.mk
> index f2ca0af93d..da660eb7c1 100644
> --- a/package/cog/cog.mk
> +++ b/package/cog/cog.mk
> @@ -28,7 +28,7 @@ endif
>   
>   ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
>   COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
> -COG_DEPENDENCIES += libdrm libinput
> +COG_DEPENDENCIES += libdrm libinput libgbm libegl
>   else
>   COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
>   endif
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
       [not found]     ` <48-62dd4800-5-54f5770@160071985>
@ 2022-07-24 13:50       ` Arnout Vandecappelle
  2022-07-24 14:53       ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 12+ messages in thread
From: Arnout Vandecappelle @ 2022-07-24 13:50 UTC (permalink / raw)
  To: Michael Nosthoff; +Cc: aperez, Alexandru Ardelean, thomas.petazzoni, buildroot



On 24/07/2022 15:25, Michael Nosthoff wrote:
> Hi,
> 
> On Saturday, July 23, 2022 10:48 CEST, Arnout Vandecappelle <arnout@mind.be> wrote:
> 
>>
>>
>> On 22/07/2022 09:01, Alexandru Ardelean wrote:
>>> When building with the DRM support, it can happen that the libgbm library
>>> is not yet built by the provider of this lib (specified by
>>> BR2_PACKAGE_PROVIDES_LIBGBM).
>>
>>    I've applied this one to master already, however there are two comments on v1
>> that remain unaddressed.
>>
>>>
>>> The docs in cog `docs/platform-drm.md` specify this dep-list:
>>> - **WPEBackend-fdo**:
>>> - **Wayland**:
>>> - **libdrm**:
>>> - **libgbm**:
>>> - **libinput**:
>>> - **libudev**:
>>
>>    This would imply that a dependency on udev is needed as well (both in the
>> Config.in and the .mk). It is actually implied by libinput, so we won't get
>> build failures, but it's better to have explicit dependencies.
>>
>>>
>>> libgbm needs to be added.
>>> Adding libegl as well.
>>>
>>> Updated package/cog/Config.in to define the dependencies (for DRM)
>>> according to libegl & libgbm.
>>>
>>> Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
>>> ---
>>>    package/cog/Config.in | 9 ++++++---
>>>    package/cog/cog.mk    | 2 +-
>>>    2 files changed, 7 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/package/cog/Config.in b/package/cog/Config.in
>>> index d4238750f9..484eb85c70 100644
>>> --- a/package/cog/Config.in
>>> +++ b/package/cog/Config.in
>>> @@ -39,7 +39,8 @@ config BR2_PACKAGE_COG_PLATFORM_FDO
>>>    config BR2_PACKAGE_COG_PLATFORM_DRM
>>>    	bool "DRM backend"
>>>    	depends on BR2_PACKAGE_HAS_UDEV # libinput
>>> -	depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
>>> +	depends on BR2_PACKAGE_HAS_LIBEGL
>>> +	depends on BR2_PACKAGE_HAS_LIBGBM
>>
>>    It apparently needs the
>> BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT feature. You can test
>> that by trying a build with rockchip-mali or ti-sgx-um as provider, since those
>> packages don't have that feature.
>>
> I'm currently maintaining an external package for the newest ti-sgx-um version which provides
> (i think) a newer/more complete version of libegl/libgbm. For this I currently have to patch
> the cog package but the output is working fine with the drm backend.
> So I would be highly interested in a patch like this.

  Since I merged this patch, you should no longer need to patch anything 
yourself, right?

> 
> Is there a way to find out which features a certain libegl/libgbm provides? 

  There are a bunch of functions related to those features. See elsewhere in 
this thread for some examples.

> Maybe I can then pick-up
> the work on bumping the ti-sgx-um/km packages again to bring them to a more recent version.

  Yes please!

  I do believe that it requires a specific TI BSP kernel version as well, so 
don't forget to document that in the Config.in help text.

  Regards,
  Arnout

> 
> Regards,
> Michael
> 
>>
>>    Regards,
>>    Arnout
>>
>>>    	select BR2_PACKAGE_LIBDRM
>>>    	select BR2_PACKAGE_LIBINPUT
>>>    	help
>>> @@ -52,7 +53,9 @@ config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
>>>    	help
>>>    	  Expose remote control interface on system bus
>>>    
>>> -comment "DRM platform needs mesa3d w/ EGL driver and GBM"
>>> -	depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL
>>> +comment "DRM platform needs EGL and GBM"
>>> +	depends on \
>>> +		!BR2_PACKAGE_HAS_LIBEGL || \
>>> +		!BR2_PACKAGE_HAS_LIBGBM
>>>    
>>>    endif
>>> diff --git a/package/cog/cog.mk b/package/cog/cog.mk
>>> index f2ca0af93d..da660eb7c1 100644
>>> --- a/package/cog/cog.mk
>>> +++ b/package/cog/cog.mk
>>> @@ -28,7 +28,7 @@ endif
>>>    
>>>    ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
>>>    COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
>>> -COG_DEPENDENCIES += libdrm libinput
>>> +COG_DEPENDENCIES += libdrm libinput libgbm libegl
>>>    else
>>>    COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
>>>    endif
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
       [not found]     ` <48-62dd4800-5-54f5770@160071985>
  2022-07-24 13:50       ` Arnout Vandecappelle
@ 2022-07-24 14:53       ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 12+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-24 14:53 UTC (permalink / raw)
  To: Michael Nosthoff; +Cc: aperez, Alexandru Ardelean, buildroot

Hello Michael,

On Sun, 24 Jul 2022 15:25:00 +0200
"Michael Nosthoff" <michael@nosthoff.rocks> wrote:

> I'm currently maintaining an external package for the newest ti-sgx-um version which provides
> (i think) a newer/more complete version of libegl/libgbm. For this I currently have to patch
> the cog package but the output is working fine with the drm backend.

Wow, do you have that available somewhere? I'm also working on a
project that uses ti-sgx, we're also working on updating it to the
latest version from TI, and we had issues with libgbm being
insufficient to run Cog.

> Is there a way to find out which features a certain libegl/libgbm provides? Maybe I can then pick-up
> the work on bumping the ti-sgx-um/km packages again to bring them to a more recent version.

It is explained in package/opengl/libgbm/Config.in:

# gbm implementations should select
# BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT if they
# provide the format modifier plane count feature. This API was
# initially introduced in mesa3d version 17. A gbm implementation
# provides this feature if it is implement function
# gbm_device_get_format_modifier_plane_count.
config BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
        bool
        depends on BR2_PACKAGE_HAS_LIBGBM

# gbm implementations should select
# BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF if they provide the dma
# buffer feature. This API was initially introduced in mesa3d version
# 10. A gbm implementation provides this feature if it is implement
# function gbm_bo_get_fd.
config BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
        bool
        depends on BR2_PACKAGE_HAS_LIBGBM

So basically, you can readelf on libgbm.so, and based on the functions
that it provides, decide which of the above feature flag your ti-sgx-um
package should select.

If you need some help on this, feel free to get in touch on IRC (if
you're not already there), I'll be happy to have a look as I'm
interested in Cog + ti-sgx-um.

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
  2022-07-23  8:48   ` Arnout Vandecappelle
       [not found]     ` <48-62dd4800-5-54f5770@160071985>
@ 2022-07-26  8:29     ` Alexandru Ardelean
  1 sibling, 0 replies; 12+ messages in thread
From: Alexandru Ardelean @ 2022-07-26  8:29 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: Adrian Perez de Castro, Thomas Petazzoni, buildroot

On Sat, Jul 23, 2022 at 11:48 AM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 22/07/2022 09:01, Alexandru Ardelean wrote:
> > When building with the DRM support, it can happen that the libgbm library
> > is not yet built by the provider of this lib (specified by
> > BR2_PACKAGE_PROVIDES_LIBGBM).
>
>   I've applied this one to master already, however there are two comments on v1
> that remain unaddressed.

yes
i wasn't sure whether to do this patch-first (which is more of a fix)
and do a follow-up
will do a follow-up :)
since this was applied
thanks :)

>
> >
> > The docs in cog `docs/platform-drm.md` specify this dep-list:
> > - **WPEBackend-fdo**:
> > - **Wayland**:
> > - **libdrm**:
> > - **libgbm**:
> > - **libinput**:
> > - **libudev**:
>
>   This would imply that a dependency on udev is needed as well (both in the
> Config.in and the .mk). It is actually implied by libinput, so we won't get
> build failures, but it's better to have explicit dependencies.

ack; will add

>
> >
> > libgbm needs to be added.
> > Adding libegl as well.
> >
> > Updated package/cog/Config.in to define the dependencies (for DRM)
> > according to libegl & libgbm.
> >
> > Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
> > ---
> >   package/cog/Config.in | 9 ++++++---
> >   package/cog/cog.mk    | 2 +-
> >   2 files changed, 7 insertions(+), 4 deletions(-)
> >
> > diff --git a/package/cog/Config.in b/package/cog/Config.in
> > index d4238750f9..484eb85c70 100644
> > --- a/package/cog/Config.in
> > +++ b/package/cog/Config.in
> > @@ -39,7 +39,8 @@ config BR2_PACKAGE_COG_PLATFORM_FDO
> >   config BR2_PACKAGE_COG_PLATFORM_DRM
> >       bool "DRM backend"
> >       depends on BR2_PACKAGE_HAS_UDEV # libinput
> > -     depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
> > +     depends on BR2_PACKAGE_HAS_LIBEGL
> > +     depends on BR2_PACKAGE_HAS_LIBGBM
>
>   It apparently needs the
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT feature. You can test
> that by trying a build with rockchip-mali or ti-sgx-um as provider, since those
> packages don't have that feature.

ack; will add
i think i should also add BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF as
Thomas mentioned

>
>
>   Regards,
>   Arnout
>
> >       select BR2_PACKAGE_LIBDRM
> >       select BR2_PACKAGE_LIBINPUT
> >       help
> > @@ -52,7 +53,9 @@ config BR2_PACKAGE_COG_USE_SYSTEM_DBUS
> >       help
> >         Expose remote control interface on system bus
> >
> > -comment "DRM platform needs mesa3d w/ EGL driver and GBM"
> > -     depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL
> > +comment "DRM platform needs EGL and GBM"
> > +     depends on \
> > +             !BR2_PACKAGE_HAS_LIBEGL || \
> > +             !BR2_PACKAGE_HAS_LIBGBM
> >
> >   endif
> > diff --git a/package/cog/cog.mk b/package/cog/cog.mk
> > index f2ca0af93d..da660eb7c1 100644
> > --- a/package/cog/cog.mk
> > +++ b/package/cog/cog.mk
> > @@ -28,7 +28,7 @@ endif
> >
> >   ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
> >   COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
> > -COG_DEPENDENCIES += libdrm libinput
> > +COG_DEPENDENCIES += libdrm libinput libgbm libegl
> >   else
> >   COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
> >   endif
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/cog: add libgbm as dependency when building with DRM support
  2022-07-22  7:01 ` [Buildroot] [PATCH v2] " Alexandru Ardelean
  2022-07-22  7:05   ` Alexandru Ardelean
  2022-07-23  8:48   ` Arnout Vandecappelle
@ 2022-08-12 15:05   ` Peter Korsgaard
  2 siblings, 0 replies; 12+ messages in thread
From: Peter Korsgaard @ 2022-08-12 15:05 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: aperez, thomas.petazzoni, buildroot

>>>>> "Alexandru" == Alexandru Ardelean <ardeleanalex@gmail.com> writes:

 > When building with the DRM support, it can happen that the libgbm library
 > is not yet built by the provider of this lib (specified by
 > BR2_PACKAGE_PROVIDES_LIBGBM).

 > The docs in cog `docs/platform-drm.md` specify this dep-list:
 > - **WPEBackend-fdo**:
 > - **Wayland**:
 > - **libdrm**:
 > - **libgbm**:
 > - **libinput**:
 > - **libudev**:

 > libgbm needs to be added.
 > Adding libegl as well.

 > Updated package/cog/Config.in to define the dependencies (for DRM)
 > according to libegl & libgbm.

 > Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-08-12 15:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 14:49 [Buildroot] [PATCH] package/cog: add libgbm as dependency when building with DRM support Alexandru Ardelean
2022-07-21 16:16 ` Thomas Petazzoni via buildroot
2022-07-22  6:25   ` Alexandru Ardelean
2022-07-22  6:38     ` Alexandru Ardelean
2022-07-22  6:59       ` Thomas Petazzoni via buildroot
2022-07-22  7:01 ` [Buildroot] [PATCH v2] " Alexandru Ardelean
2022-07-22  7:05   ` Alexandru Ardelean
2022-07-23  8:48   ` Arnout Vandecappelle
     [not found]     ` <48-62dd4800-5-54f5770@160071985>
2022-07-24 13:50       ` Arnout Vandecappelle
2022-07-24 14:53       ` Thomas Petazzoni via buildroot
2022-07-26  8:29     ` Alexandru Ardelean
2022-08-12 15:05   ` Peter Korsgaard

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.