All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] mesa: enable glvnd support
@ 2022-10-26 15:22 Vincent Davis Jr
  2022-11-04 15:31 ` Vincent Davis Jr
  2022-11-23 12:37 ` [OE-core] " Ross Burton
  0 siblings, 2 replies; 5+ messages in thread
From: Vincent Davis Jr @ 2022-10-26 15:22 UTC (permalink / raw)
  To: openembedded-core; +Cc: Vincent Davis Jr

Allows mesa to be built with glvnd support.
Thus, creates libEGL_mesa.so* and libGLX_mesa.so*
libraries meant to coexist with vendor neutral
dispatch libraries from libglvnd.

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
---
 .../conf/distro/include/default-providers.inc |  1 +
 meta/recipes-graphics/mesa/mesa.inc           | 20 +++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
index 6defdca12d..3a4e989c1f 100644
--- a/meta/conf/distro/include/default-providers.inc
+++ b/meta/conf/distro/include/default-providers.inc
@@ -5,6 +5,7 @@ PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
 PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
 PREFERRED_PROVIDER_virtual/egl ?= "mesa"
 PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libglx ?= "mesa"
 PREFERRED_PROVIDER_virtual/libgl-native ?= "mesa-native"
 PREFERRED_PROVIDER_virtual/nativesdk-libgl ?= "nativesdk-mesa"
 PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 04d78a6aa5..45a3f7a3cd 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -32,15 +32,18 @@ UPSTREAM_CHECK_GITTAGREGEX = "mesa-(?P<pver>\d+(\.\d+)+)"
 #because we cannot rely on the fact that all apps will use pkgconfig,
 #make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
 do_install:append() {
-    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
-        sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
-    fi
+  # sed can't find EGL/eglplatform.h as it doesn't get installed when glvnd enabled.
+  # So, check if EGL/eglplatform.h exists before running sed.
+  if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)} && [ -f ${D}${includedir}/EGL/eglplatform.h ]; then
+      sed -i -e 's/^#elif defined(__unix__) && defined(EGL_NO_X11)$/#elif defined(__unix__) \&\& defined(EGL_NO_X11) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+  fi
 }
 
 DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native zlib chrpath-replacement-native python3-mako-native gettext-native"
 EXTRANATIVEPATH += "chrpath-native"
 PROVIDES = " \
     ${@bb.utils.contains('PACKAGECONFIG', 'opengl', 'virtual/libgl', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'glvnd', 'virtual/libglx', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'gles', 'virtual/libgles1 virtual/libgles2 virtual/libgles3', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'virtual/egl', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'gbm', 'virtual/libgbm', '', d)} \
@@ -119,6 +122,7 @@ VULKAN_DRIVERS:append ="${@bb.utils.contains('PACKAGECONFIG', 'broadcom', ',broa
 PACKAGECONFIG[vulkan] = "-Dvulkan-drivers=${@strip_comma('${VULKAN_DRIVERS}')}, -Dvulkan-drivers='',glslang-native vulkan-loader vulkan-headers"
 
 PACKAGECONFIG[opengl] = "-Dopengl=true, -Dopengl=false"
+PACKAGECONFIG[glvnd] = "-Dglvnd=true, -Dglvnd=false,libglvnd"
 
 # "gles" requires "opengl"
 PACKAGECONFIG[gles] = "-Dgles1=enabled -Dgles2=enabled, -Dgles1=disabled -Dgles2=disabled"
@@ -207,6 +211,7 @@ RDEPENDS:libopencl-mesa += "${@bb.utils.contains('PACKAGECONFIG', 'opencl', 'lib
 PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libosmesa libosmesa-dev \
              libgl-mesa libgl-mesa-dev \
+             libglx-mesa libglx-mesa-dev \
              libglapi libglapi-dev \
              libgbm libgbm-dev \
              libgles1-mesa libgles1-mesa-dev \
@@ -225,7 +230,7 @@ do_install:append () {
     rm -f ${D}${libdir}/gallium-pipe/*.la
     rm -f ${D}${libdir}/gbm/*.la
 
-    # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used 
+    # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used
     chrpath --delete ${D}${libdir}/dri/*_dri.so || true
 
     # libwayland-egl has been moved to wayland 1.15+
@@ -243,6 +248,7 @@ python __anonymous() {
         suffix = "-native"
     for p in (("egl", "libegl", "libegl1"),
               ("opengl", "libgl", "libgl1"),
+              ("glvnd", "libglx",),
               ("gles", "libgles1", "libglesv1-cm1"),
               ("gles", "libgles2", "libglesv2-2"),
               ("gles", "libgles3",),
@@ -301,20 +307,22 @@ PACKAGES_DYNAMIC:class-native = "^mesa-driver-.*-native"
 FILES:mesa-megadriver = "${libdir}/dri/* ${datadir}/drirc.d"
 FILES:mesa-vulkan-drivers = "${libdir}/libvulkan_*.so ${datadir}/vulkan"
 FILES:${PN}-vdpau-drivers = "${libdir}/vdpau/*.so.*"
-FILES:libegl-mesa = "${libdir}/libEGL.so.*"
+FILES:libegl-mesa = "${libdir}/libEGL*.so.*"
 FILES:libgbm = "${libdir}/libgbm.so.*"
 FILES:libgles1-mesa = "${libdir}/libGLESv1*.so.*"
 FILES:libgles2-mesa = "${libdir}/libGLESv2.so.*"
 FILES:libgl-mesa = "${libdir}/libGL.so.*"
+FILES:libglx-mesa = "${libdir}/libGLX*.so.* ${datadir}/glvnd"
 FILES:libopencl-mesa = "${libdir}/libMesaOpenCL.so.* ${libdir}/gallium-pipe/*.so ${sysconfdir}/OpenCL/vendors/mesa.icd"
 FILES:libglapi = "${libdir}/libglapi.so.*"
 FILES:libosmesa = "${libdir}/libOSMesa.so.*"
 FILES:libxatracker = "${libdir}/libxatracker.so.*"
 
 FILES:${PN}-dev = "${libdir}/pkgconfig/dri.pc ${includedir}/vulkan ${libdir}/vdpau/*.so"
-FILES:libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
+FILES:libegl-mesa-dev = "${libdir}/libEGL*.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
 FILES:libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
 FILES:libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
+FILES:libglx-mesa-dev = "${libdir}/libGLX*.*"
 FILES:libglapi-dev = "${libdir}/libglapi.*"
 FILES:libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
 FILES:libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
-- 
2.34.1



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

* Re: [PATCH v3] mesa: enable glvnd support
  2022-10-26 15:22 [PATCH v3] mesa: enable glvnd support Vincent Davis Jr
@ 2022-11-04 15:31 ` Vincent Davis Jr
  2022-11-22  1:36   ` Vincent Davis Jr
  2022-11-23 12:37 ` [OE-core] " Ross Burton
  1 sibling, 1 reply; 5+ messages in thread
From: Vincent Davis Jr @ 2022-11-04 15:31 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

Hi,

Are there any autobuilder updates on this?
Know last patch I didn't realize I wasn't packaging the EGL .so in development package.

FILES:libegl-mesa-dev = "${libdir}/libEGL*.so.*..."

Patch updates to

FILES:libegl-mesa-dev = "${libdir}/libEGL*.* ..."

[-- Attachment #2: Type: text/html, Size: 304 bytes --]

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

* Re: [PATCH v3] mesa: enable glvnd support
  2022-11-04 15:31 ` Vincent Davis Jr
@ 2022-11-22  1:36   ` Vincent Davis Jr
  0 siblings, 0 replies; 5+ messages in thread
From: Vincent Davis Jr @ 2022-11-22  1:36 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 48 bytes --]

Hello,

Is there any status on merging this?

[-- Attachment #2: Type: text/html, Size: 56 bytes --]

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

* Re: [OE-core] [PATCH v3] mesa: enable glvnd support
  2022-10-26 15:22 [PATCH v3] mesa: enable glvnd support Vincent Davis Jr
  2022-11-04 15:31 ` Vincent Davis Jr
@ 2022-11-23 12:37 ` Ross Burton
  2022-11-24  7:41   ` Vincent Davis Jr
  1 sibling, 1 reply; 5+ messages in thread
From: Ross Burton @ 2022-11-23 12:37 UTC (permalink / raw)
  To: vince; +Cc: openembedded-core

> +PREFERRED_PROVIDER_virtual/libglx ?= "mesa"

Is there a real need for another preferred provider here?

> +  if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)} && [ -f ${D}${includedir}/EGL/eglplatform.h ]; then

Might as well just do the test, and not bother looking at PACKAGECONFIG too.

> +FILES:libglx-mesa = "${libdir}/libGLX*.so.* ${datadir}/glvnd"

Is this the right place for the JSON file? What if X11 is disabled: does this package still exist? Is the file GLX specific or needed for all backends? The fact that the file is called egl_vendor.d/ makes me think it’s not related to GLX but EGL, so this would be the wrong place.

Ross

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

* Re: [PATCH v3] mesa: enable glvnd support
  2022-11-23 12:37 ` [OE-core] " Ross Burton
@ 2022-11-24  7:41   ` Vincent Davis Jr
  0 siblings, 0 replies; 5+ messages in thread
From: Vincent Davis Jr @ 2022-11-24  7:41 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 705 bytes --]

Will have change for placing /usr/share/glvnd/egl_vendor.d/50_mesa.json into FILES:libegl-mesa next patch.

To answer first question. I'd say yes, there may be multiple recipes that contain an implementation of libGLX_VENDOR library
(libGLX_mesa.so, libGLX_nvidia.so, etc...). Although mesa recipe builds libGLX_mesa.so* another recipe may have code or a
link to build/download libGLX_nvidia.so* and package. Would be good to have a PREFERRED_PROVIDER in such cases to
allow for easier selection.

As, for the second question not sure of the history behind

if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)

Believe it's still required as PACKAGECONFIG may not contain egl.

[-- Attachment #2: Type: text/html, Size: 757 bytes --]

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

end of thread, other threads:[~2022-11-24  7:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 15:22 [PATCH v3] mesa: enable glvnd support Vincent Davis Jr
2022-11-04 15:31 ` Vincent Davis Jr
2022-11-22  1:36   ` Vincent Davis Jr
2022-11-23 12:37 ` [OE-core] " Ross Burton
2022-11-24  7:41   ` Vincent Davis Jr

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.