Skip to contentSkip to conversation

Enable vulkan proper

PATCH Superseded [email protected] 3 participants 8 messages Apr 26, 2023 – Apr 27, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Enable vulkan proper

From: Randolph Sapp <[email protected]>

Properly enable Vulkan with all WSI extensions enabled. Attempt some light packaging changes to the graphics umlibs recipe so we can decrease the number of check we have to skip, and the checks become a little more targeted.

Randolph Sapp (4):
ti-img-rogue-umlibs: bump srcrev, add vulkan, update deps
pvr-mesa: add new vulkan configuration options and wsi
cairo: resolve opengl version
ti-img-rogue-umlibs: package firmware separately

 .../recipes-graphics/cairo/cairo_%.bbappend   |  5 +++
 .../ti-img-rogue-umlibs_23.1.6404501.bb       | 33 +++++++++++++++----
 .../recipes-graphics/mesa/pvr-mesa.inc        |  6 +++-
 3 files changed, 36 insertions(+), 8 deletions(-)
 create mode 100644 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend
Signature · 1 line
2.40.0
#1 lore raw

PATCH 1/4 ti-img-rogue-umlibs: bump srcrev, add vulkan, update deps

From: Randolph Sapp <[email protected]>

Update the source revision for the following upstream changes:
- Drop the included ICD loader. Use the Mesa/Khronos one instead.
- Enable all vulkan window system extensions

Separate the vulkan libs into their own package so people can choose to ignore them if they want, considering the new runtime deps.

---
 .../ti-img-rogue-umlibs_23.1.6404501.bb       | 27 ++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_23.1.6404501.bb +21 -6
index 3ad0cce6..9068d341 100644
@@ -12,7 +12,7 @@ PR = "r2"
 
 BRANCH = "linuxws/kirkstone/k6.1/${PV}"
 SRC_URI = "git://git.ti.com/git/graphics/ti-img-rogue-umlibs.git;protocol=https;branch=${BRANCH}"
-SRCREV = "49958a8e820a321d22ac3c635bd21d4a3118c006"
+SRCREV = "452b0f50d2984171c81d5a0d3b22198177d919ad"
 S = "${WORKDIR}/git/targetfs/${TARGET_PRODUCT}/${PVR_WS}/${PVR_BUILD}"
 
 TARGET_PRODUCT:j721e = "j721e_linux"
@@ -30,14 +30,29 @@ do_install:append() {
         rmdir ${D}/lib
     fi
     rm -rf "${D}/etc/init.d"
-    rm -rf "${D}/usr/lib/libvulkan.so"
-    rm -rf "${D}/usr/lib/libvulkan.so.0"
-    rm -rf "${D}/usr/lib/libvulkan.so.1"
 }
 
-PACKAGES = "${PN}-tools ${PN}"
+PACKAGES = "${PN}-vulkan ${PN}-tools ${PN}"
+
+FILES:${PN}-vulkan = " \
+    ${datadir}/vulkan \
+    ${libdir}/libVK_IMG.so* \
+"
+RDEPENDS:${PN}-vulkan += " \
+    mesa-vulkan-drivers \
+    libdrm \
+    ti-img-rogue-driver \
+    libx11-xcb \
+    wayland \
+"
+INSANE_SKIP:${PN}-vulkan += " \
+    already-stripped \
+    dev-so \
+"
+
 FILES:${PN}-tools = "${bindir}/"
 RDEPENDS:${PN}-tools = "python3-core"
-RRECOMMENDS:${PN} += "${PN}-tools"
+
+RRECOMMENDS:${PN} += "${PN}-vulkan ${PN}-tools"
 
 INSANE_SKIP:${PN} += "ldflags arch already-stripped dev-so"
Signature · 1 line
2.40.0
#2 lore raw

PATCH 2/4 pvr-mesa: add new vulkan configuration options and wsi

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Add the required vulkan configuration options and the new PVR WSI file to the corresponding package.

Also bump the PV to match the version of Mesa actually being shipped.

---
 meta-ti-bsp/recipes-graphics/mesa/pvr-mesa.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta-ti-bsp/recipes-graphics/mesa/pvr-mesa.inc +5 -1
index d938f41c..caf94156 100644
@@ -38,14 +38,18 @@ PACKAGECONFIG:remove = "xvmc"
 PACKAGECONFIG[xvmc] = ""
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
-PV = "22.0.3+pvr"
+PV = "22.3.5+pvr"
 
 GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}"
 GALLIUMDRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'sgx', ',sgx', '', d)}"
 
+VULKAN_DRIVERS:append = "${@bb.utils.contains('PACKAGECONFIG', 'pvr', ',pvr', '', d)}"
+
 do_install:append () {
     # remove pvr custom pkgconfig
     rm -rf ${D}${datadir}/pkgconfig
 }
 
+FILES:mesa-vulkan-drivers += " ${libdir}/libpvr_mesa_wsi.so"
+
 RRECOMMENDS:mesa-megadriver:append:class-target = " ${@d.getVar('PREFERRED_PROVIDER_virtual/gpudriver')}"
Signature · 1 line
2.40.0
#3 lore raw

PATCH 3/4 cairo: resolve opengl version

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Cairo can either be built for use with OpenGL or OpenGLES. By default it assumes it can use OpenGL if X11 is provided as a distro feature. This assumption is not true anymore.

Vulkan libraries need some X libs at runtime now, so we need to manually override the PACKAGECONFIG for cairo to use OpenGLES.

---
 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend
meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend new file +5 -0
new file mode 100644
index 00000000..b41f1a01
@@ -0,0 +1,5 @@
+# This is required since cairo expects the opengl distro feature to refer to
+# the desktop version of OpenGL. Imagination drivers only provide OpenGLES.
+
+PACKAGECONFIG:remove = "opengl"
+PACKAGECONFIG:append = " glesv2"
Signature · 1 line
2.40.0
#4 lore raw

Re: [meta-ti][kirkstone][PATCH 3/4] cairo: resolve opengl version

Quoted 21 lines · On Wed, Apr 26, 2023 at 04:55:37PM -0500, [email protected] wrote:

From: Randolph Sapp <[email protected]>

Cairo can either be built for use with OpenGL or OpenGLES. By default it assumes it can use OpenGL if X11 is provided as a distro feature. This assumption is not true anymore.

Vulkan libraries need some X libs at runtime now, so we need to manually override the PACKAGECONFIG for cairo to use OpenGLES.

---
 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend
meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend new file +0 -0
new file mode 100644
index 00000000..b41f1a01

meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend line 5

Quoted 5 lines
meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend new file +5 -0
@@ -0,0 +1,5 @@
+# This is required since cairo expects the opengl distro feature to refer to
+# the desktop version of OpenGL. Imagination drivers only provide OpenGLES.
+
+PACKAGECONFIG:remove = "opengl"
+PACKAGECONFIG:append = " glesv2"

NAK, this will fail Yocto Project compatibility checks, rendering meta-ti non-compliant!

No bbappends against upstream components should change the defaults unconditionally.

Usually, PACKAGECONFIG changes are Distro-specific:
https://git.yoctoproject.org/meta-arago/tree/meta-arago-distro/conf/distro/arago.conf#n117

If you absoluitely have to do it in a BSP layer, there are other ways to "guard" the change with layer-specific machine overrides, or other conditions.

Signature · 1 line
Denys
#5 lore raw

Re: [EXTERNAL] Re: [meta-ti][kirkstone][PATCH 3/4] cairo: resolve opengl version

Quoted 34 lines · Denys Dmytriyenko
Quoted 21 lines · On Wed, Apr 26, 2023 at 04:55:37PM -0500, [email protected] wrote:

From: Randolph Sapp <[email protected]>

Cairo can either be built for use with OpenGL or OpenGLES. By default it assumes it can use OpenGL if X11 is provided as a distro feature. This assumption is not true anymore.

Vulkan libraries need some X libs at runtime now, so we need to manually override the PACKAGECONFIG for cairo to use OpenGLES.

---
  meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend | 5 +++++
  1 file changed, 5 insertions(+)

create mode 100644 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend

meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend new file +0 -0
new file mode 100644
index 00000000..b41f1a01

meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend line 5

Quoted 5 lines
meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend new file +5 -0
@@ -0,0 +1,5 @@
+# This is required since cairo expects the opengl distro feature to refer to
+# the desktop version of OpenGL. Imagination drivers only provide OpenGLES.
+
+PACKAGECONFIG:remove = "opengl"
+PACKAGECONFIG:append = " glesv2"

NAK, this will fail Yocto Project compatibility checks, rendering meta-ti non-compliant!

No bbappends against upstream components should change the defaults unconditionally.

Quoted 7 lines

Usually, PACKAGECONFIG changes are Distro-specific:
https://git.yoctoproject.org/meta-arago/tree/meta-arago-distro/conf/distro/arago.conf#n117

If you absoluitely have to do it in a BSP layer, there are other ways to "guard" the change with layer-specific machine overrides, or other conditions.

Fair enough. Will tweak cairo conditionally based on selected driver like we've done with Mesa. This should also leave us wiggle room for the open source driver when that comes around, thanks for reminding me! Expect v2.

#6 lore raw

PATCH 4/4 ti-img-rogue-umlibs: package firmware separately

In reply to [email protected]

From: Randolph Sapp <[email protected]>

Split the firmware into it's own package so we can make the insane checks a little more paranoid again.

---
 .../libgles/ti-img-rogue-umlibs_23.1.6404501.bb           | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
meta-ti-bsp/recipes-graphics/libgles/ti-img-rogue-umlibs_23.1.6404501.bb +6 -2
index 9068d341..c33f8ae0 100644
@@ -32,7 +32,7 @@ do_install:append() {
     rm -rf "${D}/etc/init.d"
 }
 
-PACKAGES = "${PN}-vulkan ${PN}-tools ${PN}"
+PACKAGES = "${PN}-vulkan ${PN}-tools ${PN}-firmware ${PN}"
 
 FILES:${PN}-vulkan = " \
     ${datadir}/vulkan \
@@ -53,6 +53,10 @@ INSANE_SKIP:${PN}-vulkan += " \
 FILES:${PN}-tools = "${bindir}/"
 RDEPENDS:${PN}-tools = "python3-core"
 
+FILES:${PN}-firmware = "${base_libdir}/firmware/*"
+INSANE_SKIP:${PN}-firmware += "arch"
+
 RRECOMMENDS:${PN} += "${PN}-vulkan ${PN}-tools"
+RDEPENDS:${PN} += " ${PN}-firmware"
 
-INSANE_SKIP:${PN} += "ldflags arch already-stripped dev-so"
+INSANE_SKIP:${PN} += "already-stripped dev-so"
Signature · 1 line
2.40.0
Reviewed-by on the v1 series
#7 lore raw
In reply to [email protected]
Quoted 7 lines · On 4/26/23 4:55 PM, [email protected] wrote:

From: Randolph Sapp <[email protected]>

Properly enable Vulkan with all WSI extensions enabled. Attempt some light packaging changes to the graphics umlibs recipe so we can decrease the number of check we have to skip, and the checks become a little more targeted.

Nothing too crazy here, for the series,

Quoted 12 lines

Randolph Sapp (4):
ti-img-rogue-umlibs: bump srcrev, add vulkan, update deps
pvr-mesa: add new vulkan configuration options and wsi
cairo: resolve opengl version
ti-img-rogue-umlibs: package firmware separately

  .../recipes-graphics/cairo/cairo_%.bbappend   |  5 +++
  .../ti-img-rogue-umlibs_23.1.6404501.bb       | 33 +++++++++++++++----
  .../recipes-graphics/mesa/pvr-mesa.inc        |  6 +++-
  3 files changed, 36 insertions(+), 8 deletions(-)

create mode 100644 meta-ti-bsp/recipes-graphics/cairo/cairo_%.bbappend