Skip to contentSkip to conversation

refactor mesa packageconfig

PATCH In review Trevor Woerner 2 participants 11 messages May 30, 2025 – Jun 3, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 refactor mesa packageconfig

Add a new variable, RK_MESA_DRIVER, to allow the user to choose which mesa "driver" they want to use for their mesa backend. By default set it to either "panfrost" or "lima" depending on the SoC family being used.

---
 README                              | 5 +++++
 conf/machine/include/px30.inc       | 1 +
 conf/machine/include/rk3288.inc     | 1 +
 conf/machine/include/rk3328.inc     | 1 +
 conf/machine/include/rk3399.inc     | 1 +
 conf/machine/include/rk3566.inc     | 1 +
 conf/machine/include/rk3568.inc     | 1 +
 conf/machine/include/rk3588s.inc    | 1 +
 recipes-graphics/mesa/mesa.bbappend | 9 ++-------
 9 files changed, 14 insertions(+), 7 deletions(-)
README +5 -0
index 9672c6ab8d5b..97d06eaefd63 100644
@@ -159,6 +159,11 @@ Notes:
 	compatible (see Rockchip Media Process Platform (MPP) and
 	downstream gstreamer-rockchip plugin for those kernels).
 
+  mesa backend
+	Use the variable RK_MESA_DRIVER to select which mesa backend to use
+	for mesa. By default it is set to either "panfrost" or "lima"
+	depending on SoC.
+
 U-Boot Environment:
 ------------------
 	In order to configure U-Boot to be able to store its environment into the
conf/machine/include/px30.inc +1 -0
index 8173cb19be2c..4918ee45d1ab 100644
@@ -21,3 +21,4 @@ UBOOT_SUFFIX ?= "itb"
 UBOOT_ENTRYPOINT ?= "0x06000000"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3288.inc +1 -0
index 06fda69a3eb7..0fccae7896aa 100644
@@ -16,3 +16,4 @@ KERNEL_IMAGETYPE ?= "zImage"
 UBOOT_SUFFIX ?= "bin"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3328.inc +1 -0
index e6f810dcd2ca..cdc2e2df2703 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
 UBOOT_ENTRYPOINT ?= "0x06000000"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "lima"
conf/machine/include/rk3399.inc +1 -0
index cd1be49064ed..06326946f1e3 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
 UBOOT_ENTRYPOINT ?= "0x06000000"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3566.inc +1 -0
index 6386ec7eb51c..4d84bf8a11a2 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
 TFA_BUILD_TARGET = "bl31"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3568.inc +1 -0
index bcf9dd8b0f44..dedda3b8f47e 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
 TFA_BUILD_TARGET = "bl31"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3588s.inc +1 -0
index 6ec344abae5b..5a085ab29ebc 100644
@@ -23,3 +23,4 @@ TFA_PLATFORM = "rk3588"
 TFA_BUILD_TARGET = "bl31"
 
 ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
recipes-graphics/mesa/mesa.bbappend +2 -7
index f22280754a14..9e9bf9afc4a0 100644
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"
-PACKAGECONFIG:append:px30 = " panfrost"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'panfrost', 'panfrost', '', d)}"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'lima', 'lima', '', d)}"
 
 RRECOMMENDS:mesa-megadriver:append:rk3588s = " linux-firmware-mali-csffw-arch108"
Signature · 1 line
2.44.0.478.g7774cfed6261
#1 lore raw

PATCH 2/3 mesa: enable libclc for panfrost

When building the panfrost mesa driver, also enable libclc in order for the build to succeed.

---
 recipes-graphics/mesa/mesa.bbappend | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-graphics/mesa/mesa.bbappend +1 -1
index 9e9bf9afc4a0..ae68fbe680a5 100644
@@ -1,4 +1,4 @@
-PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'panfrost', 'panfrost', '', d)}"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'panfrost', 'libclc panfrost', '', d)}"
 PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'lima', 'lima', '', d)}"
 
 RRECOMMENDS:mesa-megadriver:append:rk3588s = " linux-firmware-mali-csffw-arch108"
Signature · 1 line
2.44.0.478.g7774cfed6261
#2 lore raw

PATCH 3/3 rauc-conf: adjust PACKAGE_ARCH only when using the demo

In reply to Trevor Woerner

Make setting the PACKAGE_ARCH occur only when the user has enabled the rk-rauc-demo feature.

---
 .../rk-rauc-demo/recipes-core/rauc/rauc-conf.bbappend           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dynamic-layers/rk-rauc-demo/recipes-core/rauc/rauc-conf.bbappend +1 -1
index e19db234b9b5..323b63b01f40 100644
@@ -1,6 +1,6 @@
 inherit rk-rauc-demo-features-check
 
-PACKAGE_ARCH = "${MACHINE_ARCH}"
+PACKAGE_ARCH:rk-rauc-demo = "${MACHINE_ARCH}"
 
 FILESEXTRAPATHS:prepend:rk-rauc-demo := "${THISDIR}/files:"
 
Signature · 1 line
2.44.0.478.g7774cfed6261
Reviewed-by on v1 3/3
#3 lore raw

Re: [yocto-patches] [PATCH 3/3] rauc-conf: adjust PACKAGE_ARCH only when using the demo

Hi Trevor,

Quoted 4 lines · Trevor Woerner via lists.yoctoproject.org

Make setting the PACKAGE_ARCH occur only when the user has enabled the rk-rauc-demo feature.

I assume we want that for walnascar as well? (i saw the patch for scarthgap already :) )

Thanks!
Quentin

#4 lore raw
In reply to Trevor Woerner

Hi Trevor,

Quoted 22 lines · Trevor Woerner via lists.yoctoproject.org

Add a new variable, RK_MESA_DRIVER, to allow the user to choose which mesa "driver" they want to use for their mesa backend. By default set it to either "panfrost" or "lima" depending on the SoC family being used.

---
  README                              | 5 +++++
  conf/machine/include/px30.inc       | 1 +
  conf/machine/include/rk3288.inc     | 1 +
  conf/machine/include/rk3328.inc     | 1 +
  conf/machine/include/rk3399.inc     | 1 +
  conf/machine/include/rk3566.inc     | 1 +
  conf/machine/include/rk3568.inc     | 1 +
  conf/machine/include/rk3588s.inc    | 1 +
  recipes-graphics/mesa/mesa.bbappend | 9 ++-------
  9 files changed, 14 insertions(+), 7 deletions(-)
README +0 -0
index 9672c6ab8d5b..97d06eaefd63 100644

README Notes: · line 166

Quoted 8 lines
README +5 -0
@@ -159,6 +159,11 @@ Notes:
  	compatible (see Rockchip Media Process Platform (MPP) and
  	downstream gstreamer-rockchip plugin for those kernels).
 
+  mesa backend
+	Use the variable RK_MESA_DRIVER to select which mesa backend to use
+	for mesa. By default it is set to either "panfrost" or "lima"
+	depending on SoC.
+

I don't think it makes sense to make it user modifiable. You cannot pick which driver you want to use as lima will only work with a specific family and panfrost with another one, they don't intersect.

So I wouldn't actually document that at all.

conf/machine/include/px30.inc UBOOT_SUFFIX ?= "itb" · line 24

Quoted 12 lines
README +0 -0
  U-Boot Environment:
  ------------------
  	In order to configure U-Boot to be able to store its environment into the
conf/machine/include/px30.inc +1 -0
index 8173cb19be2c..4918ee45d1ab 100644
@@ -21,3 +21,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"

I would also make it = instead of ?= as there's no reason to override it? (and you could anyway if you wanted from a confi machine file including this SoC .inc file.

Quoted 59 lines
conf/machine/include/rk3288.inc +1 -0
index 06fda69a3eb7..0fccae7896aa 100644
@@ -16,3 +16,4 @@ KERNEL_IMAGETYPE ?= "zImage"
  UBOOT_SUFFIX ?= "bin"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3328.inc +1 -0
index e6f810dcd2ca..cdc2e2df2703 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "lima"
conf/machine/include/rk3399.inc +1 -0
index cd1be49064ed..06326946f1e3 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3566.inc +1 -0
index 6386ec7eb51c..4d84bf8a11a2 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3568.inc +1 -0
index bcf9dd8b0f44..dedda3b8f47e 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3588s.inc +1 -0
index 6ec344abae5b..5a085ab29ebc 100644
@@ -23,3 +23,4 @@ TFA_PLATFORM = "rk3588"
  TFA_BUILD_TARGET = "bl31"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
recipes-graphics/mesa/mesa.bbappend +0 -0
index f22280754a14..9e9bf9afc4a0 100644

recipes-graphics/mesa/mesa.bbappend line 3

Quoted 10 lines
recipes-graphics/mesa/mesa.bbappend +2 -7
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"
-PACKAGECONFIG:append:px30 = " panfrost"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'panfrost', 'panfrost', '', d)}"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'lima', 'lima', '', d)}"
 

This is fine though :)

I'm wondering if we shouldn't simply make panfrost the default for all SoCs and only override it to lima for older SoCs (and I believe some have some Imagination GPUs too (like the RK3368?)). I guess for GPU-less systems we would need to unset the variable. Not sure what's best here :)

Cheers,
Quentin

#7 lore raw
In reply to Trevor Woerner

Hi Trevor,

Missing [meta-rockchip] in the subject :)

Quoted 101 lines · Trevor Woerner via lists.yoctoproject.org

Add a new variable, RK_MESA_DRIVER, to allow the user to choose which mesa "driver" they want to use for their mesa backend. By default set it to either "panfrost" or "lima" depending on the SoC family being used.

---
  README                              | 5 +++++
  conf/machine/include/px30.inc       | 1 +
  conf/machine/include/rk3288.inc     | 1 +
  conf/machine/include/rk3328.inc     | 1 +
  conf/machine/include/rk3399.inc     | 1 +
  conf/machine/include/rk3566.inc     | 1 +
  conf/machine/include/rk3568.inc     | 1 +
  conf/machine/include/rk3588s.inc    | 1 +
  recipes-graphics/mesa/mesa.bbappend | 9 ++-------
  9 files changed, 14 insertions(+), 7 deletions(-)
README +5 -0
index 9672c6ab8d5b..97d06eaefd63 100644
@@ -159,6 +159,11 @@ Notes:
  	compatible (see Rockchip Media Process Platform (MPP) and
  	downstream gstreamer-rockchip plugin for those kernels).
 
+  mesa backend
+	Use the variable RK_MESA_DRIVER to select which mesa backend to use
+	for mesa. By default it is set to either "panfrost" or "lima"
+	depending on SoC.
+
  U-Boot Environment:
  ------------------
  	In order to configure U-Boot to be able to store its environment into the
conf/machine/include/px30.inc +1 -0
index 8173cb19be2c..4918ee45d1ab 100644
@@ -21,3 +21,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3288.inc +1 -0
index 06fda69a3eb7..0fccae7896aa 100644
@@ -16,3 +16,4 @@ KERNEL_IMAGETYPE ?= "zImage"
  UBOOT_SUFFIX ?= "bin"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3328.inc +1 -0
index e6f810dcd2ca..cdc2e2df2703 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "lima"
conf/machine/include/rk3399.inc +1 -0
index cd1be49064ed..06326946f1e3 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3566.inc +1 -0
index 6386ec7eb51c..4d84bf8a11a2 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3568.inc +1 -0
index bcf9dd8b0f44..dedda3b8f47e 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3588s.inc +1 -0
index 6ec344abae5b..5a085ab29ebc 100644
@@ -23,3 +23,4 @@ TFA_PLATFORM = "rk3588"
  TFA_BUILD_TARGET = "bl31"
 
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
recipes-graphics/mesa/mesa.bbappend +0 -0
index f22280754a14..9e9bf9afc4a0 100644

recipes-graphics/mesa/mesa.bbappend line 6

Quoted 6 lines
recipes-graphics/mesa/mesa.bbappend +0 -6
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"

It seems like this is based on my Panthor patch series but it isn't explicitly listed in the dependency of this patch series? I'm fine if you want to take over my patch series, but I guess it'd make sense to have the patches (even reworked/squashed/fixed up) as part of this patch series now?

Cheers,
Quentin

#8 lore raw
Quoted 4 lines · Quentin Schulz via lists.yoctoproject.org

Hi Trevor,

Missing [meta-rockchip] in the subject :)

:-O

Quoted 95 lines · Trevor Woerner via lists.yoctoproject.org
Quoted 94 lines

Add a new variable, RK_MESA_DRIVER, to allow the user to choose which mesa "driver" they want to use for their mesa backend. By default set it to either "panfrost" or "lima" depending on the SoC family being used.

---
  README                              | 5 +++++
  conf/machine/include/px30.inc       | 1 +
  conf/machine/include/rk3288.inc     | 1 +
  conf/machine/include/rk3328.inc     | 1 +
  conf/machine/include/rk3399.inc     | 1 +
  conf/machine/include/rk3566.inc     | 1 +
  conf/machine/include/rk3568.inc     | 1 +
  conf/machine/include/rk3588s.inc    | 1 +
  recipes-graphics/mesa/mesa.bbappend | 9 ++-------
  9 files changed, 14 insertions(+), 7 deletions(-)
README +5 -0
index 9672c6ab8d5b..97d06eaefd63 100644
@@ -159,6 +159,11 @@ Notes:
  	compatible (see Rockchip Media Process Platform (MPP) and
  	downstream gstreamer-rockchip plugin for those kernels).
+  mesa backend
+	Use the variable RK_MESA_DRIVER to select which mesa backend to use
+	for mesa. By default it is set to either "panfrost" or "lima"
+	depending on SoC.
+
  U-Boot Environment:
  ------------------
  	In order to configure U-Boot to be able to store its environment into the
conf/machine/include/px30.inc +1 -0
index 8173cb19be2c..4918ee45d1ab 100644
@@ -21,3 +21,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3288.inc +1 -0
index 06fda69a3eb7..0fccae7896aa 100644
@@ -16,3 +16,4 @@ KERNEL_IMAGETYPE ?= "zImage"
  UBOOT_SUFFIX ?= "bin"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3328.inc +1 -0
index e6f810dcd2ca..cdc2e2df2703 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "lima"
conf/machine/include/rk3399.inc +1 -0
index cd1be49064ed..06326946f1e3 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3566.inc +1 -0
index 6386ec7eb51c..4d84bf8a11a2 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3568.inc +1 -0
index bcf9dd8b0f44..dedda3b8f47e 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3588s.inc +1 -0
index 6ec344abae5b..5a085ab29ebc 100644
@@ -23,3 +23,4 @@ TFA_PLATFORM = "rk3588"
  TFA_BUILD_TARGET = "bl31"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
recipes-graphics/mesa/mesa.bbappend +0 -1
index f22280754a14..9e9bf9afc4a0 100644
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
Quoted 8 lines

recipes-graphics/mesa/mesa.bbappend line 6

Quoted 5 lines
recipes-graphics/mesa/mesa.bbappend +0 -5
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"

It seems like this is based on my Panthor patch series but it isn't explicitly listed in the dependency of this patch series?

True; what's the easiest way to express this?

Quoted 3 lines

I'm fine if you
want to take over my patch series, but I guess it'd make sense to have the patches (even reworked/squashed/fixed up) as part of this patch series now?

I was just going to add this update (whatever form it takes) immediately after applying your patches. Your patches worked at the time they were submitted, so I'm okay applying your patches on their own, then adding something else as a separate commit.

#9 lore raw

Hi Trevor,

Quoted 1 line · Trevor Woerner via lists.yoctoproject.org

On Mon 2025-06-02 @ 02:39:58 PM, Quentin Schulz via lists.yoctoproject.org wrote:

[...]

Quoted 1 line
Quoted 1 line · Trevor Woerner via lists.yoctoproject.org

[...]

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
recipes-graphics/mesa/mesa.bbappend +0 -1
index f22280754a14..9e9bf9afc4a0 100644
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
Quoted 8 lines

recipes-graphics/mesa/mesa.bbappend line 6

Quoted 5 lines
recipes-graphics/mesa/mesa.bbappend +0 -5
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"

It seems like this is based on my Panthor patch series but it isn't explicitly listed in the dependency of this patch series?

Quoted 2 lines

True; what's the easiest way to express this?

If you use b4, https://b4.docs.kernel.org/en/latest/contributor/prep.html#working-with-series-dependencies

Otherwise just in the cover-letter say that it depends on another series and then provide the link on lore.kernel.org or patchwork or wherever someone can get the patches :)

Quoted 9 lines
Quoted 3 lines

I'm fine if you
want to take over my patch series, but I guess it'd make sense to have the patches (even reworked/squashed/fixed up) as part of this patch series now?

I was just going to add this update (whatever form it takes) immediately after applying your patches. Your patches worked at the time they were submitted, so I'm okay applying your patches on their own, then adding something else as a separate commit.

Meh, they don't work at all anymore, so the pedantic me doesn't like merging patches we know are broken :) (but I'm not the one hitting the merge button, so that isn't something I need to worry about :) ).

Cheers,
Quentin

#5 lore raw
In reply to Quentin Schulz
Quoted 20 lines · Quentin Schulz via lists.yoctoproject.org

Hi Trevor,

Quoted 17 lines · Trevor Woerner via lists.yoctoproject.org

Add a new variable, RK_MESA_DRIVER, to allow the user to choose which mesa "driver" they want to use for their mesa backend. By default set it to either "panfrost" or "lima" depending on the SoC family being used.

---
  README                              | 5 +++++
  conf/machine/include/px30.inc       | 1 +
  conf/machine/include/rk3288.inc     | 1 +
  conf/machine/include/rk3328.inc     | 1 +
  conf/machine/include/rk3399.inc     | 1 +
  conf/machine/include/rk3566.inc     | 1 +
  conf/machine/include/rk3568.inc     | 1 +
  conf/machine/include/rk3588s.inc    | 1 +
  recipes-graphics/mesa/mesa.bbappend | 9 ++-------
  9 files changed, 14 insertions(+), 7 deletions(-)
Quoted 16 lines

README Notes: · line 165

Quoted 12 lines
README +5 -0
index 9672c6ab8d5b..97d06eaefd63 100644
@@ -159,6 +159,11 @@ Notes:
  	compatible (see Rockchip Media Process Platform (MPP) and
  	downstream gstreamer-rockchip plugin for those kernels).
+  mesa backend
+	Use the variable RK_MESA_DRIVER to select which mesa backend to use
+	for mesa. By default it is set to either "panfrost" or "lima"
+	depending on SoC.
+

I don't think it makes sense to make it user modifiable. You cannot pick which driver you want to use as lima will only work with a specific family and panfrost with another one, they don't intersect.

Right, but what if someone wants to use mali? That's the use-case I had in mind for making this user-modifiable.

Quoted 83 lines

So I wouldn't actually document that at all.

conf/machine/include/px30.inc UBOOT_SUFFIX ?= "itb" · line 23

Quoted 11 lines
README +0 -0
  U-Boot Environment:
  ------------------
  	In order to configure U-Boot to be able to store its environment into the
conf/machine/include/px30.inc +1 -0
index 8173cb19be2c..4918ee45d1ab 100644
@@ -21,3 +21,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"

I would also make it = instead of ?= as there's no reason to override it? (and you could anyway if you wanted from a confi machine file including this SoC .inc file.

Quoted 53 lines
conf/machine/include/rk3288.inc +1 -0
index 06fda69a3eb7..0fccae7896aa 100644
@@ -16,3 +16,4 @@ KERNEL_IMAGETYPE ?= "zImage"
  UBOOT_SUFFIX ?= "bin"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3328.inc +1 -0
index e6f810dcd2ca..cdc2e2df2703 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "lima"
conf/machine/include/rk3399.inc +1 -0
index cd1be49064ed..06326946f1e3 100644
@@ -22,3 +22,4 @@ UBOOT_SUFFIX ?= "itb"
  UBOOT_ENTRYPOINT ?= "0x06000000"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3566.inc +1 -0
index 6386ec7eb51c..4d84bf8a11a2 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3568.inc +1 -0
index bcf9dd8b0f44..dedda3b8f47e 100644
@@ -24,3 +24,4 @@ TFA_PLATFORM = "rk3568"
  TFA_BUILD_TARGET = "bl31"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
conf/machine/include/rk3588s.inc +1 -0
index 6ec344abae5b..5a085ab29ebc 100644
@@ -23,3 +23,4 @@ TFA_PLATFORM = "rk3588"
  TFA_BUILD_TARGET = "bl31"
  ENABLE_STATELESS_VPU_GST ?= "1"
+RK_MESA_DRIVER ?= "panfrost"
recipes-graphics/mesa/mesa.bbappend +0 -0
index f22280754a14..9e9bf9afc4a0 100644

recipes-graphics/mesa/mesa.bbappend line 2

Quoted 9 lines
recipes-graphics/mesa/mesa.bbappend +2 -7
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"
-PACKAGECONFIG:append:px30 = " panfrost"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'panfrost', 'panfrost', '', d)}"
+PACKAGECONFIG:append:rockchip = " ${@bb.utils.contains('RK_MESA_DRIVER', 'lima', 'lima', '', d)}"

This is fine though :)

Quoted 4 lines

I'm wondering if we shouldn't simply make panfrost the default for all SoCs and only override it to lima for older SoCs (and I believe some have some Imagination GPUs too (like the RK3368?)). I guess for GPU-less systems we would need to unset the variable. Not sure what's best here :)

I agree that within the Yocto/OE community, the idiom is normally to set a default then override it where needed. I tend to prefer listing/setting each one explicitly, but that's just my preference.

#10 lore raw
In reply to Quentin Schulz
Quoted 41 lines · Quentin Schulz via lists.yoctoproject.org

Hi Trevor,

Quoted 1 line · Trevor Woerner via lists.yoctoproject.org

On Mon 2025-06-02 @ 02:39:58 PM, Quentin Schulz via lists.yoctoproject.org wrote:

[...]

Quoted 1 line
Quoted 1 line · Trevor Woerner via lists.yoctoproject.org

[...]

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
recipes-graphics/mesa/mesa.bbappend +0 -1
index f22280754a14..9e9bf9afc4a0 100644
@@ -1,9 +1,4 @@
-PACKAGECONFIG:append:rk3288 = " panfrost"
Quoted 8 lines

recipes-graphics/mesa/mesa.bbappend line 6

Quoted 5 lines
recipes-graphics/mesa/mesa.bbappend +0 -5
-PACKAGECONFIG:append:rk3328 = " lima"
-PACKAGECONFIG:append:rk3399 = " panfrost"
-PACKAGECONFIG:append:rk3566 = " panfrost"
-PACKAGECONFIG:append:rk3568 = " panfrost"
-PACKAGECONFIG:append:rk3588s = " panfrost"

It seems like this is based on my Panthor patch series but it isn't explicitly listed in the dependency of this patch series?

Quoted 2 lines

True; what's the easiest way to express this?

If you use b4, https://b4.docs.kernel.org/en/latest/contributor/prep.html#working-with-series-dependencies

Otherwise just in the cover-letter say that it depends on another series and then provide the link on lore.kernel.org or patchwork or wherever someone can get the patches :)

Quoted 9 lines
Quoted 3 lines

I'm fine if you
want to take over my patch series, but I guess it'd make sense to have the patches (even reworked/squashed/fixed up) as part of this patch series now?

I was just going to add this update (whatever form it takes) immediately after applying your patches. Your patches worked at the time they were submitted, so I'm okay applying your patches on their own, then adding something else as a separate commit.

Quoted 3 lines

Meh, they don't work at all anymore, so the pedantic me doesn't like merging patches we know are broken :) (but I'm not the one hitting the merge button, so that isn't something I need to worry about :) ).

I'm okay with squashing them. I'll keep your SoB line (of course).

#6 lore raw
In reply to Trevor Woerner
Quoted 38 lines · Trevor Woerner via lists.yoctoproject.org
Quoted 20 lines · Quentin Schulz via lists.yoctoproject.org

Hi Trevor,

Quoted 17 lines · Trevor Woerner via lists.yoctoproject.org

Add a new variable, RK_MESA_DRIVER, to allow the user to choose which mesa "driver" they want to use for their mesa backend. By default set it to either "panfrost" or "lima" depending on the SoC family being used.

---
   README                              | 5 +++++
   conf/machine/include/px30.inc       | 1 +
   conf/machine/include/rk3288.inc     | 1 +
   conf/machine/include/rk3328.inc     | 1 +
   conf/machine/include/rk3399.inc     | 1 +
   conf/machine/include/rk3566.inc     | 1 +
   conf/machine/include/rk3568.inc     | 1 +
   conf/machine/include/rk3588s.inc    | 1 +
   recipes-graphics/mesa/mesa.bbappend | 9 ++-------
   9 files changed, 14 insertions(+), 7 deletions(-)
Quoted 16 lines

README Notes: · line 165

Quoted 12 lines
README +5 -0
index 9672c6ab8d5b..97d06eaefd63 100644
@@ -159,6 +159,11 @@ Notes:
   	compatible (see Rockchip Media Process Platform (MPP) and
   	downstream gstreamer-rockchip plugin for those kernels).
+  mesa backend
+	Use the variable RK_MESA_DRIVER to select which mesa backend to use
+	for mesa. By default it is set to either "panfrost" or "lima"
+	depending on SoC.
+

I don't think it makes sense to make it user modifiable. You cannot pick which driver you want to use as lima will only work with a specific family and panfrost with another one, they don't intersect.

Quoted 3 lines

Right, but what if someone wants to use mali? That's the use-case I had in mind for making this user-modifiable.

PREFERRED_PROVIDER for libgles/libgl/... maybe?

In any case, for Rockchip I believe you'd need the rockchip-libmali recipe, see https://github.com/JeffyCN/meta-rockchip/blob/scarthgap/recipes-graphics/rockchip-libmali/rockchip-libmali.bb, for this to be useful?

So I believe you rather want a knob between mesa recipe and libmali recipe. I am not sure this is important until we get a libmali recipe?

Cheers,
Quentin