Skip to contentSkip to conversation

vk-gl-cts: allow the user to specify the target

PATCH Superseded Trevor Woerner 2 participants 4 messages Sep 23, 2021

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vk-gl-cts: allow the user to specify the target

When building opengl-es-cts (for example), allow the user to pick which target to build instead of hard-coding the 'surfaceless' target.

---
 .../recipes-graphics/vk-gl-cts/khronos-cts.inc  | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +14 -3
index f61921473..a9c41f1f7 100644
@@ -18,9 +18,9 @@ S = "${WORKDIR}/git"
 
 inherit pkgconfig cmake features_check
 
-REQUIRED_DISTRO_FEATURES += "opengl"
+ANY_OF_DISTRO_FEATURES += "opengl wayland"
 
-DEPENDS += "libpng zlib virtual/libgles2 virtual/egl"
+DEPENDS += "libpng zlib virtual/libgles2"
 
 SRC_URI += "file://0001-Workaround-for-GCC-11-uninit-variable-warnings-946.patch;patchdir=external/amber/src \
             file://0001-Include-limits-header-for-numeric_limits.patch;patchdir=external/vulkancts \
@@ -36,7 +36,18 @@ SRC_URI:append:toolchain-clang = "\
 	file://fix-clang-private-operator.patch \
 "
 
-EXTRA_OECMAKE:append = " -DDEQP_TARGET=surfaceless"
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[surfaceless] = "-DDEQP_TARGET=surfaceless,,"
+PACKAGECONFIG[wayland] = "-DDEQP_TARGET=wayland,,wayland"
+PACKAGECONFIG[x11_egl] = "-DDEQP_TARGET=x11_egl,,virtual/libx11 virtual/egl"
+PACKAGECONFIG[x11_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11"
+PACKAGECONFIG[x11_egl_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11 virtual/egl"
+
+python __anonymous() {
+    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
+    if len(packageconfig) > 1:
+        bb.fatal("only one PACKAGECONFIG of 'surfaceless wayland x11_egl x11_glx x11_egl_glx' can be specified at a time")
+}
 
 CTSDIR = "/usr/lib/${BPN}"
 
Signature · 1 line
2.30.0.rc0
#1 lore raw
Quoted 32 lines · Trevor Woerner

When building opengl-es-cts (for example), allow the user to pick which target to build instead of hard-coding the 'surfaceless' target.

---
  .../recipes-graphics/vk-gl-cts/khronos-cts.inc  | 17 ++++++++++++++---
  1 file changed, 14 insertions(+), 3 deletions(-)
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +5 -3
index f61921473..a9c41f1f7 100644
@@ -18,9 +18,9 @@ S = "${WORKDIR}/git"
 
  inherit pkgconfig cmake features_check
 
-REQUIRED_DISTRO_FEATURES += "opengl"
+ANY_OF_DISTRO_FEATURES += "opengl wayland"
 
-DEPENDS += "libpng zlib virtual/libgles2 virtual/egl"
+DEPENDS += "libpng zlib virtual/libgles2"
 
  SRC_URI += "file://0001-Workaround-for-GCC-11-uninit-variable-warnings-946.patch;patchdir=external/amber/src \
              file://0001-Include-limits-header-for-numeric_limits.patch;patchdir=external/vulkancts \
@@ -36,7 +36,18 @@ SRC_URI:append:toolchain-clang = "\
  	file://fix-clang-private-operator.patch \
  "
 
-EXTRA_OECMAKE:append = " -DDEQP_TARGET=surfaceless"
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[surfaceless] = "-DDEQP_TARGET=surfaceless,,"
+PACKAGECONFIG[wayland] = "-DDEQP_TARGET=wayland,,wayland"

meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc SRC_URI:append:toolchain-clang = "\ · line 51

Quoted 10 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +9 -0
+PACKAGECONFIG[x11_egl] = "-DDEQP_TARGET=x11_egl,,virtual/libx11 virtual/egl"
+PACKAGECONFIG[x11_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11"
+PACKAGECONFIG[x11_egl_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11 virtual/egl"
+
+python __anonymous() {
+    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
+    if len(packageconfig) > 1:
+        bb.fatal("only one PACKAGECONFIG of 'surfaceless wayland x11_egl x11_glx x11_egl_glx' can be specified at a time")
+}
 

Looks an improvement, but there is no default now, so what will happen by default, and can be make some intelligent defaults based on wayland/x11 distro features etc.

Quoted 7 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +0 -0
  CTSDIR = "/usr/lib/${BPN}"
 
#2 lore raw
Quoted 20 lines · Khem Raj
Quoted 17 lines · Trevor Woerner

When building opengl-es-cts (for example), allow the user to pick which target to build instead of hard-coding the 'surfaceless' target.

---
  .../recipes-graphics/vk-gl-cts/khronos-cts.inc  | 17 ++++++++++++++---
  1 file changed, 14 insertions(+), 3 deletions(-)
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +1 -2
index f61921473..a9c41f1f7 100644
@@ -18,9 +18,9 @@ S = "${WORKDIR}/git"
  inherit pkgconfig cmake features_check
-REQUIRED_DISTRO_FEATURES += "opengl"
+ANY_OF_DISTRO_FEATURES += "opengl wayland"
-DEPENDS += "libpng zlib virtual/libgles2 virtual/egl"
Quoted 8 lines

meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc SRC_URI:append:toolchain-clang = "\ · line 38

Quoted 8 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +2 -1
+DEPENDS += "libpng zlib virtual/libgles2"
  SRC_URI += "file://0001-Workaround-for-GCC-11-uninit-variable-warnings-946.patch;patchdir=external/amber/src \
              file://0001-Include-limits-header-for-numeric_limits.patch;patchdir=external/vulkancts \
@@ -36,7 +36,18 @@ SRC_URI:append:toolchain-clang = "\
  	file://fix-clang-private-operator.patch \
  "
-EXTRA_OECMAKE:append = " -DDEQP_TARGET=surfaceless"
+PACKAGECONFIG ??= ""

^^ the default is to not specify anything, which picks the "Default" target, in which case the cmake scripts in the source try to automatically detect what's in your sysroot and make sensible decisions.

So the best option for users is to not specify anything. But I added PACKAGECONFIGs in case users want to force an option.

…hmm but then the dependencies won't get handled correctly, unless I either:
1) try to do the detection myself based on IMAGE_FEATURES etc
2) add all dependencies to DEPENDS, although that might confuse the cmake probing

Quoted 22 lines

meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc SRC_URI:append:toolchain-clang = "\ · line 50

Quoted 11 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +11 -0
+PACKAGECONFIG[surfaceless] = "-DDEQP_TARGET=surfaceless,,"
+PACKAGECONFIG[wayland] = "-DDEQP_TARGET=wayland,,wayland"
+PACKAGECONFIG[x11_egl] = "-DDEQP_TARGET=x11_egl,,virtual/libx11 virtual/egl"
+PACKAGECONFIG[x11_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11"
+PACKAGECONFIG[x11_egl_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11 virtual/egl"
+
+python __anonymous() {
+    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
+    if len(packageconfig) > 1:
+        bb.fatal("only one PACKAGECONFIG of 'surfaceless wayland x11_egl x11_glx x11_egl_glx' can be specified at a time")
+}

Looks an improvement, but there is no default now, so what will happen by default, and can be make some intelligent defaults based on wayland/x11 distro features etc.

Quoted 6 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +0 -0
  CTSDIR = "/usr/lib/${BPN}"
 
 
 
#3 lore raw
Quoted 35 lines · Trevor Woerner
Quoted 20 lines · Khem Raj
Quoted 17 lines · Trevor Woerner

When building opengl-es-cts (for example), allow the user to pick which target to build instead of hard-coding the 'surfaceless' target.

---
  .../recipes-graphics/vk-gl-cts/khronos-cts.inc  | 17 ++++++++++++++---
  1 file changed, 14 insertions(+), 3 deletions(-)
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +1 -2
index f61921473..a9c41f1f7 100644
@@ -18,9 +18,9 @@ S = "${WORKDIR}/git"
  inherit pkgconfig cmake features_check
-REQUIRED_DISTRO_FEATURES += "opengl"
+ANY_OF_DISTRO_FEATURES += "opengl wayland"
-DEPENDS += "libpng zlib virtual/libgles2 virtual/egl"
Quoted 8 lines

meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc SRC_URI:append:toolchain-clang = "\ · line 38

Quoted 8 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +2 -1
+DEPENDS += "libpng zlib virtual/libgles2"
  SRC_URI += "file://0001-Workaround-for-GCC-11-uninit-variable-warnings-946.patch;patchdir=external/amber/src \
              file://0001-Include-limits-header-for-numeric_limits.patch;patchdir=external/vulkancts \
@@ -36,7 +36,18 @@ SRC_URI:append:toolchain-clang = "\
    file://fix-clang-private-operator.patch \
  "
-EXTRA_OECMAKE:append = " -DDEQP_TARGET=surfaceless"
+PACKAGECONFIG ??= ""

^^ the default is to not specify anything, which picks the "Default" target, in which case the cmake scripts in the source try to automatically detect what's in your sysroot and make sensible decisions.

Quoted 3 lines

So the best option for users is to not specify anything. But I added PACKAGECONFIGs in case users want to force an option.

Please add this commentary to the recipe as well so users can use it in right way.

Quoted 26 lines

…hmm but then the dependencies won't get handled correctly, unless I either:
1) try to do the detection myself based on IMAGE_FEATURES etc
2) add all dependencies to DEPENDS, although that might confuse the cmake probing

Quoted 22 lines

meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc SRC_URI:append:toolchain-clang = "\ · line 50

Quoted 11 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +11 -0
+PACKAGECONFIG[surfaceless] = "-DDEQP_TARGET=surfaceless,,"
+PACKAGECONFIG[wayland] = "-DDEQP_TARGET=wayland,,wayland"
+PACKAGECONFIG[x11_egl] = "-DDEQP_TARGET=x11_egl,,virtual/libx11 virtual/egl"
+PACKAGECONFIG[x11_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11"
+PACKAGECONFIG[x11_egl_glx] = "-DDEQP_TARGET=x11_glx,,virtual/libx11 virtual/egl"
+
+python __anonymous() {
+    packageconfig = (d.getVar("PACKAGECONFIG") or "").split()
+    if len(packageconfig) > 1:
+        bb.fatal("only one PACKAGECONFIG of 'surfaceless wayland x11_egl x11_glx x11_egl_glx' can be specified at a time")
+}

Looks an improvement, but there is no default now, so what will happen by default, and can be make some intelligent defaults based on wayland/x11 distro features etc.

Quoted 6 lines
meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc +0 -0
  CTSDIR = "/usr/lib/${BPN}"