All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
@ 2021-09-28 22:37 Kamel Bouhara
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 2/7] package/mesa3d: add gbm api features Kamel Bouhara
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Bernd Kuhls, Thomas Petazzoni, Kamel Bouhara

From: Bernd Kuhls <bernd.kuhls@t-online.de>

Kodi 18.0-Leia will implement stand-alone gbm support alongside x11 &
wayland.  To enable building libgbm in mesa3d without x11 & wayland we
need to create a virtual package for libgbm.

Also other packages besides mesa3d may provide libgbm.so, see
http://patchwork.ozlabs.org/patch/647235/
http://patchwork.ozlabs.org/patch/939703/

We also introduce two feature that shall help user choosing the version
implemented by a libgbm provider. This foresightly avoid building package
without having the required libgbm version (e.g. kmscube, qt5, sdl2
etc.)

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
[ Kamel : introduce gbm api features ]
---
Changes v1 -> v2:
 - Squashed patch 1/2
 - Added more relevant comment for each features added

 package/opengl/Config.in        |  1 +
 package/opengl/libgbm/Config.in | 24 ++++++++++++++++++++++++
 package/opengl/libgbm/libgbm.mk |  9 +++++++++
 3 files changed, 34 insertions(+)
 create mode 100644 package/opengl/libgbm/Config.in
 create mode 100644 package/opengl/libgbm/libgbm.mk

diff --git a/package/opengl/Config.in b/package/opengl/Config.in
index cbc001427d..cfa51def45 100644
--- a/package/opengl/Config.in
+++ b/package/opengl/Config.in
@@ -1,5 +1,6 @@
 source "package/opengl/libgl/Config.in"
 source "package/opengl/libegl/Config.in"
+source "package/opengl/libgbm/Config.in"
 source "package/opengl/libgles/Config.in"
 source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
diff --git a/package/opengl/libgbm/Config.in b/package/opengl/libgbm/Config.in
new file mode 100644
index 0000000000..7aa3efb97a
--- /dev/null
+++ b/package/opengl/libgbm/Config.in
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_HAS_LIBGBM
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBGBM
+	string
+	depends on BR2_PACKAGE_HAS_LIBGBM
+
+config BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	bool
+	depends on BR2_PACKAGE_HAS_LIBGBM
+
+# gbm implementations should select this option 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_DMA_BUF
+	bool
+	depends on BR2_PACKAGE_HAS_LIBGBM
+
+# gbm implementations should select this option 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.
diff --git a/package/opengl/libgbm/libgbm.mk b/package/opengl/libgbm/libgbm.mk
new file mode 100644
index 0000000000..ecab234720
--- /dev/null
+++ b/package/opengl/libgbm/libgbm.mk
@@ -0,0 +1,9 @@
+################################################################################
+#
+# libgbm
+#
+################################################################################
+
+# This package requires to install a gbm.pc which needs
+# to be provided by GBM providers.
+$(eval $(virtual-package))
-- 
2.30.2

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

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

* [Buildroot] [PATCH v2 2/7] package/mesa3d: add gbm api features
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
@ 2021-09-28 22:37 ` Kamel Bouhara
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 3/7] package/sunxi-mali-mainline: bump version Kamel Bouhara
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Bernd Kuhls, Kamel Bouhara

From: Bernd Kuhls <bernd.kuhls@t-online.de>

Introduce gbm features so that each packages depending
on it can choose which implementation is required.

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
 package/mesa3d/Config.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
index eb7c1eef46..a181a363da 100644
--- a/package/mesa3d/Config.in
+++ b/package/mesa3d/Config.in
@@ -387,6 +387,9 @@ config BR2_PACKAGE_MESA3D_GBM
 	bool "gbm"
 	depends on BR2_PACKAGE_MESA3D_DRI_DRIVER \
 		|| (BR2_PACKAGE_MESA3D_GALLIUM_DRIVER && BR2_PACKAGE_MESA3D_OPENGL_EGL)
+	select BR2_PACKAGE_HAS_LIBGBM
+	select BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	select BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
 	help
 	  Enable Generic Buffer Management (gbm)
 
@@ -423,6 +426,9 @@ config BR2_PACKAGE_MESA3D_OPENGL_ES
 
 endif # BR2_PACKAGE_MESA3D_DRIVER
 
+config BR2_PACKAGE_PROVIDES_LIBGBM
+	default "mesa3d" if BR2_PACKAGE_MESA3D_GBM
+
 config BR2_PACKAGE_PROVIDES_LIBGL
 	default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_GLX
 
-- 
2.30.2

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

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

* [Buildroot] [PATCH v2 3/7] package/sunxi-mali-mainline: bump version
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 2/7] package/mesa3d: add gbm api features Kamel Bouhara
@ 2021-09-28 22:37 ` Kamel Bouhara
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 4/7] package/sunxi-mali-mainline: add support for different outputs Kamel Bouhara
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Kamel Bouhara, Thomas Petazzoni

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Bumps the sunxi-mali-mainline upstream version to 418f55585e76f375792dbebb3e97532f0c1c556d

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
Changes v1 -> v2:
 - Updated package hash

 package/sunxi-mali-mainline/sunxi-mali-mainline.hash | 2 +-
 package/sunxi-mali-mainline/sunxi-mali-mainline.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.hash b/package/sunxi-mali-mainline/sunxi-mali-mainline.hash
index e1c18fd4f7..96d8251f16 100644
--- a/package/sunxi-mali-mainline/sunxi-mali-mainline.hash
+++ b/package/sunxi-mali-mainline/sunxi-mali-mainline.hash
@@ -1,3 +1,3 @@
 # Locally calculated
-sha256  72969ecf470b9e5ce787c2f8f36242926e1e892af0891924ee59a2cd206de39f  sunxi-mali-mainline-d691cb93884ca8ac67860502117bbec283dc19aa.tar.gz
+sha256  b5e7e8f9f2886ed0b273f72ea16ae4868711726fe33e3d80ef24e86269c90fd2  sunxi-mali-mainline-418f55585e76f375792dbebb3e97532f0c1c556d.tar.gz
 sha256  8a06bcae44a41a886f339b4338422415a786787f113e9ed6456ae117104a0b6a  EULA_for_Mali_400MP_AW.pdf
diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
index 701a1fbbb4..b46f572311 100644
--- a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
+++ b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-SUNXI_MALI_MAINLINE_VERSION = d691cb93884ca8ac67860502117bbec283dc19aa
+SUNXI_MALI_MAINLINE_VERSION = 418f55585e76f375792dbebb3e97532f0c1c556d
 SUNXI_MALI_MAINLINE_SITE = $(call github,bootlin,mali-blobs,$(SUNXI_MALI_MAINLINE_VERSION))
 SUNXI_MALI_MAINLINE_INSTALL_STAGING = YES
 SUNXI_MALI_MAINLINE_PROVIDES = libegl libgles
-- 
2.30.2

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

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

* [Buildroot] [PATCH v2 4/7] package/sunxi-mali-mainline: add support for different outputs
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 2/7] package/mesa3d: add gbm api features Kamel Bouhara
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 3/7] package/sunxi-mali-mainline: bump version Kamel Bouhara
@ 2021-09-28 22:37 ` Kamel Bouhara
  2021-10-01 14:14   ` Thomas Petazzoni
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 5/7] package/sunxi-mali-mainline: provides libgbm Kamel Bouhara
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Kamel Bouhara, Thomas Petazzoni

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Adds support for selecting one of the four display API supported: fbdev,
wayland, x11-dmabuf, x11-ump.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
 package/sunxi-mali-mainline/Config.in         | 26 ++++++++++++++++
 .../sunxi-mali-mainline.mk                    | 30 +++++++++++++++++--
 2 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/package/sunxi-mali-mainline/Config.in b/package/sunxi-mali-mainline/Config.in
index a2fb95bd79..31a9152407 100644
--- a/package/sunxi-mali-mainline/Config.in
+++ b/package/sunxi-mali-mainline/Config.in
@@ -17,6 +17,24 @@ config BR2_PACKAGE_PROVIDES_LIBEGL
 config BR2_PACKAGE_PROVIDES_LIBGLES
 	default "sunxi-mali-mainline"
 
+choice
+	prompt "Output"
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
+	bool "fbdev"
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
+	bool "wayland"
+	depends on BR2_PACKAGE_WAYLAND
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF
+	bool "x11 dma-buf"
+
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_UMP
+	bool "x11 ump"
+
+endchoice
+
 choice
 	prompt "Version"
 	default BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
@@ -27,9 +45,17 @@ config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
 	bool "r6p2"
 config BR2_PACKAGE_SUNXI_MALI_MAINLINE_R8P1
 	bool "r8p1"
+	depends on BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
 
 endchoice
 
+config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT
+	string
+	default "fbdev"		if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
+	default "wayland"	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
+	default "x11_dma_buf" 	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF
+	default "x11_ump"     	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_UMP
+
 config BR2_PACKAGE_SUNXI_MALI_MAINLINE_REVISION
 	string
 	default "r6p2"	if BR2_PACKAGE_SUNXI_MALI_MAINLINE_R6P2
diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
index b46f572311..e9091b05a2 100644
--- a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
+++ b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
@@ -21,22 +21,46 @@ else ifeq ($(BR2_aarch64),y)
 SUNXI_MALI_MAINLINE_ARCH=arm64
 endif
 
+SUNXI_MALI_MAINLINE_OUTPUT = $(call qstrip,$(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT))
+SUNXI_MALI_MAINLINE_LIB_SUBDIR = \
+	$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/$(SUNXI_MALI_MAINLINE_OUTPUT)
+
+ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF)$(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_UMP),y)
+SUNXI_MALI_MAINLINE_INCLUDE_SUBDIR = include/x11
+else
+SUNXI_MALI_MAINLINE_INCLUDE_SUBDIR = \
+	include/$(SUNXI_MALI_MAINLINE_OUTPUT)
+define SUNXI_MALI_MAINLINE_FIXUP_EGL_PC
+	$(SED) "s/Cflags: /Cflags: -DMESA_EGL_NO_X11_HEADERS /" \
+		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND),y)
+SUNXI_MALI_MAINLINE_DEPENDENCIES += wayland
+endif
+
+# FIXME: install gbm.pc conditionally
 define SUNXI_MALI_MAINLINE_INSTALL_STAGING_CMDS
 	mkdir -p $(STAGING_DIR)/usr/lib $(STAGING_DIR)/usr/include
 
-	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/fbdev/*.so* \
+	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_LIB_SUBDIR)/*.so* \
 		$(STAGING_DIR)/usr/lib/
-	cp -rf $(@D)/include/fbdev/* $(STAGING_DIR)/usr/include/
+	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_INCLUDE_SUBDIR)/* \
+		$(STAGING_DIR)/usr/include/
 
 	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/egl.pc \
 		$(STAGING_DIR)/usr/lib/pkgconfig/egl.pc
 	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/glesv2.pc \
 		$(STAGING_DIR)/usr/lib/pkgconfig/glesv2.pc
+	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/gbm.pc \
+		$(STAGING_DIR)/usr/lib/pkgconfig/gbm.pc
+	$(SUNXI_MALI_MAINLINE_FIXUP_EGL_PC)
 endef
 
 define SUNXI_MALI_MAINLINE_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/usr/lib
-	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_REV)/$(SUNXI_MALI_MAINLINE_ARCH)/fbdev/*.so* \
+	cp -rf $(@D)/$(SUNXI_MALI_MAINLINE_LIB_SUBDIR)/*.so* \
 		$(TARGET_DIR)/usr/lib/
 endef
 
-- 
2.30.2

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

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

* [Buildroot] [PATCH v2 5/7] package/sunxi-mali-mainline: provides libgbm
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
                   ` (2 preceding siblings ...)
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 4/7] package/sunxi-mali-mainline: add support for different outputs Kamel Bouhara
@ 2021-09-28 22:37 ` Kamel Bouhara
  2021-10-01 14:16   ` Thomas Petazzoni
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 6/7] package/kmscube: use libgbm virtual package Kamel Bouhara
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Kamel Bouhara, Thomas Petazzoni

Registers the package as a libgbm provider.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
Changes v1 -> v2:
 - Fixed gbm features are provided only when wayland is set

 package/sunxi-mali-mainline/Config.in              |  6 ++++++
 package/sunxi-mali-mainline/gbm.pc                 | 12 ++++++++++++
 package/sunxi-mali-mainline/sunxi-mali-mainline.mk |  1 +
 3 files changed, 19 insertions(+)
 create mode 100644 package/sunxi-mali-mainline/gbm.pc

diff --git a/package/sunxi-mali-mainline/Config.in b/package/sunxi-mali-mainline/Config.in
index 31a9152407..0a32cb456c 100644
--- a/package/sunxi-mali-mainline/Config.in
+++ b/package/sunxi-mali-mainline/Config.in
@@ -3,6 +3,7 @@ config BR2_PACKAGE_SUNXI_MALI_MAINLINE
 	depends on BR2_aarch64 || (BR2_ARM_EABIHF && BR2_arm)
 	depends on BR2_TOOLCHAIN_USES_GLIBC
 	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGBM
 	select BR2_PACKAGE_HAS_LIBGLES
 	help
 	  Install userspace Allwinner OpenGL libraries.
@@ -14,6 +15,9 @@ if BR2_PACKAGE_SUNXI_MALI_MAINLINE
 config BR2_PACKAGE_PROVIDES_LIBEGL
 	default "sunxi-mali-mainline"
 
+config BR2_PACKAGE_PROVIDES_LIBGBM
+	default "sunxi-mali-mainline" if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
+
 config BR2_PACKAGE_PROVIDES_LIBGLES
 	default "sunxi-mali-mainline"
 
@@ -26,6 +30,8 @@ config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
 config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
 	bool "wayland"
 	depends on BR2_PACKAGE_WAYLAND
+	select BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
+	select BR2_PACKAGE_HAS_LIBGBM
 
 config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_X11_DMABUF
 	bool "x11 dma-buf"
diff --git a/package/sunxi-mali-mainline/gbm.pc b/package/sunxi-mali-mainline/gbm.pc
new file mode 100644
index 0000000000..e2f6c04a82
--- /dev/null
+++ b/package/sunxi-mali-mainline/gbm.pc
@@ -0,0 +1,12 @@
+prefix=/usr
+exec_prefix=/usr
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: gbm
+Description: ARM Mali implementation of gbm
+Requires.private: 
+Version: 1.0
+Libs: -L${libdir} -lgbm
+Libs.private: 
+Cflags: -I${includedir}
diff --git a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
index e9091b05a2..8a76b46aba 100644
--- a/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
+++ b/package/sunxi-mali-mainline/sunxi-mali-mainline.mk
@@ -38,6 +38,7 @@ endif
 
 ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND),y)
 SUNXI_MALI_MAINLINE_DEPENDENCIES += wayland
+SUNXI_MALI_MAINLINE_PROVIDES += libgbm
 endif
 
 # FIXME: install gbm.pc conditionally
-- 
2.30.2

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

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

* [Buildroot] [PATCH v2 6/7] package/kmscube: use libgbm virtual package
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
                   ` (3 preceding siblings ...)
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 5/7] package/sunxi-mali-mainline: provides libgbm Kamel Bouhara
@ 2021-09-28 22:37 ` Kamel Bouhara
  2021-10-01 14:18   ` Thomas Petazzoni
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 7/7] package/gcnano-binaries: provides libgbm Kamel Bouhara
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Kamel Bouhara, Thomas Petazzoni

From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

kmscube requires a libgbm implementation, which until now, only Mesa3D
was providing, so kmscube had a direct dependency on Mesa3D.

However, now that we have a proper libgbm virtual package, so this
commit converts the kmscube package to use the libegl, libgbm and
libgles virtual packages.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
[ Kamel : add dependency on recent libgbm ]
---
 package/kmscube/Config.in  | 18 ++++++++++++++----
 package/kmscube/kmscube.mk |  2 +-
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/package/kmscube/Config.in b/package/kmscube/Config.in
index b6ad305bfb..3876f93491 100644
--- a/package/kmscube/Config.in
+++ b/package/kmscube/Config.in
@@ -1,9 +1,19 @@
 config BR2_PACKAGE_KMSCUBE
 	bool "kmscube"
-	# requires libgbm from mesa3d
-	depends on BR2_PACKAGE_MESA3D_OPENGL_EGL
-	depends on BR2_PACKAGE_MESA3D_OPENGL_ES
+	depends on BR2_PACKAGE_HAS_LIBEGL
+	depends on BR2_PACKAGE_HAS_LIBGBM
+	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	depends on BR2_PACKAGE_HAS_LIBGLES
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm
+	select BR2_PACKAGE_LIBDRM
 	help
 	  kmscube is an application to test kms/drm drivers.
 
-	  https://gitlab.freedesktop.org/mesa/kmscube
+	  https://cgit.freedesktop.org/mesa/kmscube/
+
+comment "kmscube needs EGL, GBM and OpenGL ES, and a toolchain w/ thread support"
+	depends on BR2_PACKAGE_HAS_LIBEGL
+	depends on BR2_PACKAGE_HAS_LIBGBM
+	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	depends on BR2_PACKAGE_HAS_LIBGLES
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/kmscube/kmscube.mk b/package/kmscube/kmscube.mk
index 7b458376dc..5719f72ba3 100644
--- a/package/kmscube/kmscube.mk
+++ b/package/kmscube/kmscube.mk
@@ -8,6 +8,6 @@ KMSCUBE_VERSION = 4660a7dca6512b6e658759d00cff7d4ad2a2059d
 KMSCUBE_SITE = https://gitlab.freedesktop.org/mesa/kmscube/-/archive/$(KMSCUBE_VERSION)
 KMSCUBE_LICENSE = MIT
 KMSCUBE_LICENSE_FILES = COPYING
-KMSCUBE_DEPENDENCIES = host-pkgconf mesa3d libdrm
+KMSCUBE_DEPENDENCIES = host-pkgconf libgles libegl libgbm libdrm
 
 $(eval $(meson-package))
-- 
2.30.2

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

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

* [Buildroot] [PATCH v2 7/7] package/gcnano-binaries: provides libgbm
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
                   ` (4 preceding siblings ...)
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 6/7] package/kmscube: use libgbm virtual package Kamel Bouhara
@ 2021-09-28 22:37 ` Kamel Bouhara
  2021-10-01 14:13 ` [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Thomas Petazzoni
  2021-10-03 21:05 ` Yann E. MORIN
  7 siblings, 0 replies; 16+ messages in thread
From: Kamel Bouhara @ 2021-09-28 22:37 UTC (permalink / raw)
  To: buildroot; +Cc: Paul Kocialkowski, Kamel Bouhara

Add package as a libgbm provider

Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
---
 package/gcnano-binaries/Config.in          | 6 ++++++
 package/gcnano-binaries/gcnano-binaries.mk | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/gcnano-binaries/Config.in b/package/gcnano-binaries/Config.in
index 01e1aacf1d..ade19e2121 100644
--- a/package/gcnano-binaries/Config.in
+++ b/package/gcnano-binaries/Config.in
@@ -15,6 +15,9 @@ config BR2_PACKAGE_GCNANO_BINARIES
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland
 	depends on !BR2_STATIC_LIBS
 	select BR2_PACKAGE_HAS_LIBEGL
+	select BR2_PACKAGE_HAS_LIBGBM
+	select BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
+	select BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
 	select BR2_PACKAGE_HAS_LIBGLES
 	select BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_WAYLAND
@@ -27,6 +30,9 @@ if BR2_PACKAGE_GCNANO_BINARIES
 config BR2_PACKAGE_PROVIDES_LIBEGL
 	default "gcnano-binaries"
 
+config BR2_PACKAGE_PROVIDES_LIBGBM
+	default "gcnano-binaries"
+
 config BR2_PACKAGE_PROVIDES_LIBGLES
 	default "gcnano-binaries"
 
diff --git a/package/gcnano-binaries/gcnano-binaries.mk b/package/gcnano-binaries/gcnano-binaries.mk
index af5fdd1b7e..f6adc36dbd 100644
--- a/package/gcnano-binaries/gcnano-binaries.mk
+++ b/package/gcnano-binaries/gcnano-binaries.mk
@@ -20,7 +20,7 @@ GCNANO_BINARIES_DEPENDENCIES = linux wayland libdrm
 
 GCNANO_BINARIES_INSTALL_STAGING = YES
 
-GCNANO_BINARIES_PROVIDES = libegl libgles
+GCNANO_BINARIES_PROVIDES = libegl libgles libgbm
 
 # The Github repository doesn't contain the source code as-is: it
 # contains a tarball with the kernel driver source code, and a
-- 
2.30.2

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

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

* Re: [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
                   ` (5 preceding siblings ...)
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 7/7] package/gcnano-binaries: provides libgbm Kamel Bouhara
@ 2021-10-01 14:13 ` Thomas Petazzoni
  2021-10-07  9:35   ` Kamel Bouhara
  2021-10-03 21:05 ` Yann E. MORIN
  7 siblings, 1 reply; 16+ messages in thread
From: Thomas Petazzoni @ 2021-10-01 14:13 UTC (permalink / raw)
  To: Kamel Bouhara; +Cc: Paul Kocialkowski, Bernd Kuhls, buildroot

Hello,

On Wed, 29 Sep 2021 00:37:48 +0200
Kamel Bouhara <kamel.bouhara@bootlin.com> wrote:

> From: Bernd Kuhls <bernd.kuhls@t-online.de>
> 
> Kodi 18.0-Leia will implement stand-alone gbm support alongside x11 &
> wayland.  To enable building libgbm in mesa3d without x11 & wayland we
> need to create a virtual package for libgbm.
> 
> Also other packages besides mesa3d may provide libgbm.so, see
> http://patchwork.ozlabs.org/patch/647235/
> http://patchwork.ozlabs.org/patch/939703/
> 
> We also introduce two feature that shall help user choosing the version
> implemented by a libgbm provider. This foresightly avoid building package
> without having the required libgbm version (e.g. kmscube, qt5, sdl2
> etc.)

I would rephrase this as such:

"""
It turns out that libgbm has seen several additions in its API over
time, and therefore not all libgbm implementations provide support for
all features. In order to account for this, this commit adds two hidden
boolean options that allow libgbm providers to indicate which optional
features they support:
BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT and
BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF. These booleans must be selected
by the packages providing libgbm implementations, and depended on by
packages using libgbm.
"""

Question: do we have in the tree some libgbm implementation that
support neither
BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT nor
BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF ?

> diff --git a/package/opengl/libgbm/Config.in b/package/opengl/libgbm/Config.in
> new file mode 100644
> index 0000000000..7aa3efb97a
> --- /dev/null
> +++ b/package/opengl/libgbm/Config.in
> @@ -0,0 +1,24 @@
> +config BR2_PACKAGE_HAS_LIBGBM
> +	bool
> +
> +config BR2_PACKAGE_PROVIDES_LIBGBM
> +	string
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +
> +config BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> +	bool
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +
> +# gbm implementations should select this option 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.

The comment should be before the option.

> +config BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> +	bool
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +
> +# gbm implementations should select this option 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.

Ditto.

Note: no need to resend to address those comments, they can be fixed up
when applying.

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] 16+ messages in thread

* Re: [Buildroot] [PATCH v2 4/7] package/sunxi-mali-mainline: add support for different outputs
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 4/7] package/sunxi-mali-mainline: add support for different outputs Kamel Bouhara
@ 2021-10-01 14:14   ` Thomas Petazzoni
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2021-10-01 14:14 UTC (permalink / raw)
  To: Kamel Bouhara; +Cc: Paul Kocialkowski, buildroot

On Wed, 29 Sep 2021 00:37:51 +0200
Kamel Bouhara <kamel.bouhara@bootlin.com> wrote:

> +	$(INSTALL) -D -m 0644 package/sunxi-mali-mainline/gbm.pc \
> +		$(STAGING_DIR)/usr/lib/pkgconfig/gbm.pc

This needs to go in patch 5/7, as it's patch 5/7 that adds the file
package/sunxi-mali-mainline/gbm.pc.

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] 16+ messages in thread

* Re: [Buildroot] [PATCH v2 5/7] package/sunxi-mali-mainline: provides libgbm
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 5/7] package/sunxi-mali-mainline: provides libgbm Kamel Bouhara
@ 2021-10-01 14:16   ` Thomas Petazzoni
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2021-10-01 14:16 UTC (permalink / raw)
  To: Kamel Bouhara; +Cc: Paul Kocialkowski, buildroot

On Wed, 29 Sep 2021 00:37:52 +0200
Kamel Bouhara <kamel.bouhara@bootlin.com> wrote:

> Registers the package as a libgbm provider.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
> ---
> Changes v1 -> v2:
>  - Fixed gbm features are provided only when wayland is set
> 
>  package/sunxi-mali-mainline/Config.in              |  6 ++++++
>  package/sunxi-mali-mainline/gbm.pc                 | 12 ++++++++++++
>  package/sunxi-mali-mainline/sunxi-mali-mainline.mk |  1 +
>  3 files changed, 19 insertions(+)
>  create mode 100644 package/sunxi-mali-mainline/gbm.pc
> 
> diff --git a/package/sunxi-mali-mainline/Config.in b/package/sunxi-mali-mainline/Config.in
> index 31a9152407..0a32cb456c 100644
> --- a/package/sunxi-mali-mainline/Config.in
> +++ b/package/sunxi-mali-mainline/Config.in
> @@ -3,6 +3,7 @@ config BR2_PACKAGE_SUNXI_MALI_MAINLINE
>  	depends on BR2_aarch64 || (BR2_ARM_EABIHF && BR2_arm)
>  	depends on BR2_TOOLCHAIN_USES_GLIBC
>  	select BR2_PACKAGE_HAS_LIBEGL
> +	select BR2_PACKAGE_HAS_LIBGBM
>  	select BR2_PACKAGE_HAS_LIBGLES
>  	help
>  	  Install userspace Allwinner OpenGL libraries.
> @@ -14,6 +15,9 @@ if BR2_PACKAGE_SUNXI_MALI_MAINLINE
>  config BR2_PACKAGE_PROVIDES_LIBEGL
>  	default "sunxi-mali-mainline"
>  
> +config BR2_PACKAGE_PROVIDES_LIBGBM
> +	default "sunxi-mali-mainline" if BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
> +
>  config BR2_PACKAGE_PROVIDES_LIBGLES
>  	default "sunxi-mali-mainline"
>  
> @@ -26,6 +30,8 @@ config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_FBDEV
>  config BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND
>  	bool "wayland"
>  	depends on BR2_PACKAGE_WAYLAND
> +	select BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> +	select BR2_PACKAGE_HAS_LIBGBM

It still doesn't make sense: you're selecting BR2_PACKAGE_HAS_LIBGBM
both in the main package option and here.

So either libgbm is only provided by the wayland-variant of the
sunxi-mali-mainline OpenGL implementation, or it's provided by all. But
having the "select BR2_PACKAGE_HAS_LIBGBM" in two places doesn't make
sense.

>  ifeq ($(BR2_PACKAGE_SUNXI_MALI_MAINLINE_OUTPUT_WAYLAND),y)
>  SUNXI_MALI_MAINLINE_DEPENDENCIES += wayland
> +SUNXI_MALI_MAINLINE_PROVIDES += libgbm
>  endif

According to this, it's only the wayland-variant that supports libgbm.
So the "select BR2_PACKAGE_HAS_LIBGBM" in
BR2_PACKAGE_SUNXI_MALI_MAINLINE is wrong. I think this was already
pointed out in the review of v1.

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] 16+ messages in thread

* Re: [Buildroot] [PATCH v2 6/7] package/kmscube: use libgbm virtual package
  2021-09-28 22:37 ` [Buildroot] [PATCH v2 6/7] package/kmscube: use libgbm virtual package Kamel Bouhara
@ 2021-10-01 14:18   ` Thomas Petazzoni
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2021-10-01 14:18 UTC (permalink / raw)
  To: Kamel Bouhara; +Cc: Paul Kocialkowski, buildroot

On Wed, 29 Sep 2021 00:37:53 +0200
Kamel Bouhara <kamel.bouhara@bootlin.com> wrote:

> diff --git a/package/kmscube/Config.in b/package/kmscube/Config.in
> index b6ad305bfb..3876f93491 100644
> --- a/package/kmscube/Config.in
> +++ b/package/kmscube/Config.in
> @@ -1,9 +1,19 @@
>  config BR2_PACKAGE_KMSCUBE
>  	bool "kmscube"
> -	# requires libgbm from mesa3d
> -	depends on BR2_PACKAGE_MESA3D_OPENGL_EGL
> -	depends on BR2_PACKAGE_MESA3D_OPENGL_ES
> +	depends on BR2_PACKAGE_HAS_LIBEGL
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> +	depends on BR2_PACKAGE_HAS_LIBGLES
> +	depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm
> +	select BR2_PACKAGE_LIBDRM
>  	help
>  	  kmscube is an application to test kms/drm drivers.
>  
> -	  https://gitlab.freedesktop.org/mesa/kmscube
> +	  https://cgit.freedesktop.org/mesa/kmscube/
> +
> +comment "kmscube needs EGL, GBM and OpenGL ES, and a toolchain w/ thread support"
> +	depends on BR2_PACKAGE_HAS_LIBEGL
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +	depends on BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> +	depends on BR2_PACKAGE_HAS_LIBGLES
> +	depends on !BR2_TOOLCHAIN_HAS_THREADS

This should be:

	depends on !BR2_PACKAGE_HAS_LIBEGL || !BR2_PACKAGE_HAS_LIBGBM || !BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT || !depends on BR2_PACKAGE_HAS_LIBGLES || !BR2_TOOLCHAIN_HAS_THREADS

Indeed, in your current implementation, the comment will only show up
if we have EGL, gbm, OpenGLES available but threads are not available.
This makes a comment suggesting to enable EGL, GBM and OpenGL ES a bit
useless.

Instead what we want is to show the comment if EGL is missing, or if
GBM is missing, or if OpenGL ES is missing, or if threads are missing.

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] 16+ messages in thread

* Re: [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
  2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
                   ` (6 preceding siblings ...)
  2021-10-01 14:13 ` [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Thomas Petazzoni
@ 2021-10-03 21:05 ` Yann E. MORIN
  2021-10-07 10:00   ` Kamel Bouhara
  7 siblings, 1 reply; 16+ messages in thread
From: Yann E. MORIN @ 2021-10-03 21:05 UTC (permalink / raw)
  To: Kamel Bouhara; +Cc: Paul Kocialkowski, Bernd Kuhls, Thomas Petazzoni, buildroot

Kamel, All,

Your series has had a few comments. Most are minor, but one or two need
a bit more insights and can't be fixed while applying. As such, I've
marked it as Changes Requested in Patchwork.

Also, could you write a cover-letter that exlpains the goal behind that
series and how it is organised? A cover letter usually helps reviewers
udnerstand the bigger picture of a series, while the individual patches
describe more localised changes.

Regards,
Yann E. MORIN.

On 2021-09-29 00:37 +0200, Kamel Bouhara spake thusly:
> From: Bernd Kuhls <bernd.kuhls@t-online.de>
> 
> Kodi 18.0-Leia will implement stand-alone gbm support alongside x11 &
> wayland.  To enable building libgbm in mesa3d without x11 & wayland we
> need to create a virtual package for libgbm.
> 
> Also other packages besides mesa3d may provide libgbm.so, see
> http://patchwork.ozlabs.org/patch/647235/
> http://patchwork.ozlabs.org/patch/939703/
> 
> We also introduce two feature that shall help user choosing the version
> implemented by a libgbm provider. This foresightly avoid building package
> without having the required libgbm version (e.g. kmscube, qt5, sdl2
> etc.)
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
> [ Kamel : introduce gbm api features ]
> ---
> Changes v1 -> v2:
>  - Squashed patch 1/2
>  - Added more relevant comment for each features added
> 
>  package/opengl/Config.in        |  1 +
>  package/opengl/libgbm/Config.in | 24 ++++++++++++++++++++++++
>  package/opengl/libgbm/libgbm.mk |  9 +++++++++
>  3 files changed, 34 insertions(+)
>  create mode 100644 package/opengl/libgbm/Config.in
>  create mode 100644 package/opengl/libgbm/libgbm.mk
> 
> diff --git a/package/opengl/Config.in b/package/opengl/Config.in
> index cbc001427d..cfa51def45 100644
> --- a/package/opengl/Config.in
> +++ b/package/opengl/Config.in
> @@ -1,5 +1,6 @@
>  source "package/opengl/libgl/Config.in"
>  source "package/opengl/libegl/Config.in"
> +source "package/opengl/libgbm/Config.in"
>  source "package/opengl/libgles/Config.in"
>  source "package/opengl/libopencl/Config.in"
>  source "package/opengl/libopenvg/Config.in"
> diff --git a/package/opengl/libgbm/Config.in b/package/opengl/libgbm/Config.in
> new file mode 100644
> index 0000000000..7aa3efb97a
> --- /dev/null
> +++ b/package/opengl/libgbm/Config.in
> @@ -0,0 +1,24 @@
> +config BR2_PACKAGE_HAS_LIBGBM
> +	bool
> +
> +config BR2_PACKAGE_PROVIDES_LIBGBM
> +	string
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +
> +config BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> +	bool
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +
> +# gbm implementations should select this option 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_DMA_BUF
> +	bool
> +	depends on BR2_PACKAGE_HAS_LIBGBM
> +
> +# gbm implementations should select this option 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.
> diff --git a/package/opengl/libgbm/libgbm.mk b/package/opengl/libgbm/libgbm.mk
> new file mode 100644
> index 0000000000..ecab234720
> --- /dev/null
> +++ b/package/opengl/libgbm/libgbm.mk
> @@ -0,0 +1,9 @@
> +################################################################################
> +#
> +# libgbm
> +#
> +################################################################################
> +
> +# This package requires to install a gbm.pc which needs
> +# to be provided by GBM providers.
> +$(eval $(virtual-package))
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
  2021-10-01 14:13 ` [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Thomas Petazzoni
@ 2021-10-07  9:35   ` Kamel Bouhara
  2021-10-08 12:40     ` Thomas Petazzoni
  0 siblings, 1 reply; 16+ messages in thread
From: Kamel Bouhara @ 2021-10-07  9:35 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Paul Kocialkowski, Bernd Kuhls, buildroot

On Fri, Oct 01, 2021 at 04:13:54PM +0200, Thomas Petazzoni wrote:
> Hello,
>

Hello Thomas,

> On Wed, 29 Sep 2021 00:37:48 +0200
> Kamel Bouhara <kamel.bouhara@bootlin.com> wrote:
>
> > From: Bernd Kuhls <bernd.kuhls@t-online.de>
> >
> > Kodi 18.0-Leia will implement stand-alone gbm support alongside x11 &
> > wayland.  To enable building libgbm in mesa3d without x11 & wayland we
> > need to create a virtual package for libgbm.
> >
> > Also other packages besides mesa3d may provide libgbm.so, see
> > http://patchwork.ozlabs.org/patch/647235/
> > http://patchwork.ozlabs.org/patch/939703/
> >
> > We also introduce two feature that shall help user choosing the version
> > implemented by a libgbm provider. This foresightly avoid building package
> > without having the required libgbm version (e.g. kmscube, qt5, sdl2
> > etc.)
>
> I would rephrase this as such:
>
> """
> It turns out that libgbm has seen several additions in its API over
> time, and therefore not all libgbm implementations provide support for
> all features. In order to account for this, this commit adds two hidden
> boolean options that allow libgbm providers to indicate which optional
> features they support:
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT and
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF. These booleans must be selected
> by the packages providing libgbm implementations, and depended on by
> packages using libgbm.
> """
>

OK.

> Question: do we have in the tree some libgbm implementation that
> support neither
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT nor
> BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF ?

So far, the dma buf feature (mesa gbm v10) is provided by every
implementation I compared (gcnano, ti, sunxi, imx-gpu).

Thanks for the review, sending a v3 soon.

Kamel

>
> > diff --git a/package/opengl/libgbm/Config.in b/package/opengl/libgbm/Config.in
> > new file mode 100644
> > index 0000000000..7aa3efb97a
> > --- /dev/null
> > +++ b/package/opengl/libgbm/Config.in
> > @@ -0,0 +1,24 @@
> > +config BR2_PACKAGE_HAS_LIBGBM
> > +	bool
> > +
> > +config BR2_PACKAGE_PROVIDES_LIBGBM
> > +	string
> > +	depends on BR2_PACKAGE_HAS_LIBGBM
> > +
> > +config BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> > +	bool
> > +	depends on BR2_PACKAGE_HAS_LIBGBM
> > +
> > +# gbm implementations should select this option 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.
>
> The comment should be before the option.
>
> > +config BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF
> > +	bool
> > +	depends on BR2_PACKAGE_HAS_LIBGBM
> > +
> > +# gbm implementations should select this option 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.
>
> Ditto.
>
> Note: no need to resend to address those comments, they can be fixed up
> when applying.
>
> Best regards,
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com

--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
  2021-10-03 21:05 ` Yann E. MORIN
@ 2021-10-07 10:00   ` Kamel Bouhara
  0 siblings, 0 replies; 16+ messages in thread
From: Kamel Bouhara @ 2021-10-07 10:00 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Paul Kocialkowski, Bernd Kuhls, Thomas Petazzoni, buildroot

On Sun, Oct 03, 2021 at 11:05:17PM +0200, Yann E. MORIN wrote:
> Kamel, All,
>

Hello,

> Your series has had a few comments. Most are minor, but one or two need
> a bit more insights and can't be fixed while applying. As such, I've
> marked it as Changes Requested in Patchwork.
>
> Also, could you write a cover-letter that exlpains the goal behind that
> series and how it is organised? A cover letter usually helps reviewers
> udnerstand the bigger picture of a series, while the individual patches
> describe more localised changes.
>

Of course, I actually sent the cover-letter in the first version and
I tough it was not nececessary to re-sent it again.

"This series introduce a virtual/package for the libgbm.

We also introduce two gbm features so that packages depending on it
can select which version of the api is required.

Note that we only added sunxi, gcnano and mesa3d api but other
implementations can be added later based on this series."

Regards,
Kamel

> Regards,
> Yann E. MORIN.
>
> On 2021-09-29 00:37 +0200, Kamel Bouhara spake thusly:
> > From: Bernd Kuhls <bernd.kuhls@t-online.de>
> >
> > Kodi 18.0-Leia will implement stand-alone gbm support alongside x11 &
> > wayland.  To enable building libgbm in mesa3d without x11 & wayland we
> > need to create a virtual package for libgbm.
> >
> > Also other packages besides mesa3d may provide libgbm.so, see
> > http://patchwork.ozlabs.org/patch/647235/
> > http://patchwork.ozlabs.org/patch/939703/
> >
> > We also introduce two feature that shall help user choosing the version
> > implemented by a libgbm provider. This foresightly avoid building package
> > without having the required libgbm version (e.g. kmscube, qt5, sdl2
> > etc.)
> >
> > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
> > [ Kamel : introduce gbm api features ]
> > ---
> > Changes v1 -> v2:
> >  - Squashed patch 1/2
> >  - Added more relevant comment for each features added
> >
> >  package/opengl/Config.in        |  1 +
> >  package/opengl/libgbm/Config.in | 24 ++++++++++++++++++++++++
> >  package/opengl/libgbm/libgbm.mk |  9 +++++++++
> >  3 files changed, 34 insertions(+)
> >  create mode 100644 package/opengl/libgbm/Config.in
> >  create mode 100644 package/opengl/libgbm/libgbm.mk
> >
> > diff --git a/package/opengl/Config.in b/package/opengl/Config.in
> > index cbc001427d..cfa51def45 100644
> > --- a/package/opengl/Config.in
> > +++ b/package/opengl/Config.in
> > @@ -1,5 +1,6 @@
> >  source "package/opengl/libgl/Config.in"
> >  source "package/opengl/libegl/Config.in"
> > +source "package/opengl/libgbm/Config.in"
> >  source "package/opengl/libgles/Config.in"
> >  source "package/opengl/libopencl/Config.in"
> >  source "package/opengl/libopenvg/Config.in"
> > diff --git a/package/opengl/libgbm/Config.in b/package/opengl/libgbm/Config.in
> > new file mode 100644
> > index 0000000000..7aa3efb97a
> > --- /dev/null
> > +++ b/package/opengl/libgbm/Config.in
> > @@ -0,0 +1,24 @@
> > +config BR2_PACKAGE_HAS_LIBGBM
> > +	bool
> > +
> > +config BR2_PACKAGE_PROVIDES_LIBGBM
> > +	string
> > +	depends on BR2_PACKAGE_HAS_LIBGBM
> > +
> > +config BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT
> > +	bool
> > +	depends on BR2_PACKAGE_HAS_LIBGBM
> > +
> > +# gbm implementations should select this option 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_DMA_BUF
> > +	bool
> > +	depends on BR2_PACKAGE_HAS_LIBGBM
> > +
> > +# gbm implementations should select this option 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.
> > diff --git a/package/opengl/libgbm/libgbm.mk b/package/opengl/libgbm/libgbm.mk
> > new file mode 100644
> > index 0000000000..ecab234720
> > --- /dev/null
> > +++ b/package/opengl/libgbm/libgbm.mk
> > @@ -0,0 +1,9 @@
> > +################################################################################
> > +#
> > +# libgbm
> > +#
> > +################################################################################
> > +
> > +# This package requires to install a gbm.pc which needs
> > +# to be provided by GBM providers.
> > +$(eval $(virtual-package))
> > --
> > 2.30.2
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@buildroot.org
> > https://lists.buildroot.org/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.  |
> '------------------------------^-------^------------------^--------------------'

--
Kamel Bouhara, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
  2021-10-07  9:35   ` Kamel Bouhara
@ 2021-10-08 12:40     ` Thomas Petazzoni
       [not found]       ` <YWA98UOCDjOFh51v@aptenodytes>
  0 siblings, 1 reply; 16+ messages in thread
From: Thomas Petazzoni @ 2021-10-08 12:40 UTC (permalink / raw)
  To: Kamel Bouhara; +Cc: Paul Kocialkowski, Bernd Kuhls, buildroot

Hello Kamel,

On Thu, 7 Oct 2021 11:35:34 +0200
Kamel Bouhara <kamel.bouhara@bootlin.com> wrote:

> > Question: do we have in the tree some libgbm implementation that
> > support neither
> > BR2_PACKAGE_LIBGBM_HAS_FEATURE_FORMAT_MODIFIER_PLANE_COUNT nor
> > BR2_PACKAGE_LIBGBM_HAS_FEATURE_DMA_BUF ?  
> 
> So far, the dma buf feature (mesa gbm v10) is provided by every
> implementation I compared (gcnano, ti, sunxi, imx-gpu).

So what made you think we need to identify this feature separately from
others?

The whole point of this "feature" mechanism is to be able to
distinguish the different GBM implementations in the features they
provide.

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] 16+ messages in thread

* Re: [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package
       [not found]       ` <YWA98UOCDjOFh51v@aptenodytes>
@ 2021-10-08 13:10         ` Thomas Petazzoni
  0 siblings, 0 replies; 16+ messages in thread
From: Thomas Petazzoni @ 2021-10-08 13:10 UTC (permalink / raw)
  To: Paul Kocialkowski; +Cc: Bernd Kuhls, Kamel Bouhara, buildroot

On Fri, 8 Oct 2021 14:47:45 +0200
Paul Kocialkowski <paul.kocialkowski@bootlin.com> wrote:

> > So what made you think we need to identify this feature separately from
> > others?  
> 
> I seem to recall that earlier versions of the sunxi blobs didn't have
> dma-buf support, and they eventually released some that did.
> 
> So my two cents would be that dma-buf is not part of the "base" set of
> features from the GBM API and it makes sense to recognize it as an
> additional feature.

Thanks, useful feedback (should I say "as usual" ?). Should perhaps be
captured "somewhere" (commit log ? comment above the feature option ?).

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] 16+ messages in thread

end of thread, other threads:[~2021-10-08 13:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 22:37 [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Kamel Bouhara
2021-09-28 22:37 ` [Buildroot] [PATCH v2 2/7] package/mesa3d: add gbm api features Kamel Bouhara
2021-09-28 22:37 ` [Buildroot] [PATCH v2 3/7] package/sunxi-mali-mainline: bump version Kamel Bouhara
2021-09-28 22:37 ` [Buildroot] [PATCH v2 4/7] package/sunxi-mali-mainline: add support for different outputs Kamel Bouhara
2021-10-01 14:14   ` Thomas Petazzoni
2021-09-28 22:37 ` [Buildroot] [PATCH v2 5/7] package/sunxi-mali-mainline: provides libgbm Kamel Bouhara
2021-10-01 14:16   ` Thomas Petazzoni
2021-09-28 22:37 ` [Buildroot] [PATCH v2 6/7] package/kmscube: use libgbm virtual package Kamel Bouhara
2021-10-01 14:18   ` Thomas Petazzoni
2021-09-28 22:37 ` [Buildroot] [PATCH v2 7/7] package/gcnano-binaries: provides libgbm Kamel Bouhara
2021-10-01 14:13 ` [Buildroot] [PATCH v2 1/7] package/opengl/libgbm: new virtual package Thomas Petazzoni
2021-10-07  9:35   ` Kamel Bouhara
2021-10-08 12:40     ` Thomas Petazzoni
     [not found]       ` <YWA98UOCDjOFh51v@aptenodytes>
2021-10-08 13:10         ` Thomas Petazzoni
2021-10-03 21:05 ` Yann E. MORIN
2021-10-07 10:00   ` Kamel Bouhara

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.