[2/3] mesa: Replace dri-native with dri for native and nativesdk classes

Submitted by Fabio Berton on Feb. 18, 2019, 1:29 p.m. | Patch ID: 158806

Details

Message ID 20190218132948.27668-2-fabio.berton@ossystems.com.br
State Master Next
Commit aa720b88b10418a0e5e663d01529262e7bf0826f
Headers show

Commit Message

Fabio Berton Feb. 18, 2019, 1:29 p.m.
Instead of using a native specific packageconfig option, we now set
the swrast as the supported driver.

Based on https://patchwork.openembedded.org/patch/158748/

Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
---
 meta/recipes-graphics/mesa/mesa.inc | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index a57438b295..8d3e976481 100644
--- a/meta/recipes-graphics/mesa/mesa.inc
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -49,8 +49,8 @@  PACKAGECONFIG_class-target ??= "${@bb.utils.filter('DISTRO_FEATURES', 'wayland v
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 vulkan', 'dri3', '', d)} \
 		   "
-PACKAGECONFIG_class-native ?= "gbm dri-native egl"
-PACKAGECONFIG_class-nativesdk ?= "gbm dri-native egl"
+PACKAGECONFIG_class-native ?= "gbm dri egl"
+PACKAGECONFIG_class-nativesdk ?= "gbm dri egl"
 
 # "gbm" requires "dri", "opengl"
 PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm"
@@ -61,13 +61,12 @@  PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
 PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
 PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
 
-DRIDRIVERS = "swrast"
-DRIDRIVERS_append_x86_class-target = ",radeon,r200,nouveau,i965,i915"
-DRIDRIVERS_append_x86-64_class-target = ",radeon,r200,nouveau,i965,i915"
+DRIDRIVERS_class-native = "swrast"
+DRIDRIVERS_class-nativesdk = "swrast"
+DRIDRIVERS_append_x86_class-target = ",r100,r200,nouveau,i965,i915"
+DRIDRIVERS_append_x86-64_class-target = ",r100,r200,nouveau,i965,i915"
 # "dri" requires "opengl"
 PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, xorgproto libdrm"
-# On the native builds we use host's dri drivers
-PACKAGECONFIG[dri-native] = "--enable-dri, , xorgproto libdrm"
 PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, xorgproto libxshmfence"
 
 # Vulkan drivers need dri3 enabled

Comments

Otavio Salvador Feb. 18, 2019, 1:42 p.m.
On Mon, Feb 18, 2019 at 10:30 AM Fabio Berton
<fabio.berton@ossystems.com.br> wrote:
>
> Instead of using a native specific packageconfig option, we now set
> the swrast as the supported driver.
>
> Based on https://patchwork.openembedded.org/patch/158748/
>
> Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>

Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Richard Purdie Feb. 18, 2019, 2:18 p.m.
On Mon, 2019-02-18 at 10:29 -0300, Fabio Berton wrote:
> @@ -61,13 +61,12 @@ PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-
> glx,${X11_DEPS}"
>  PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
>  PACKAGECONFIG[wayland] = ",,wayland-native wayland libdrm wayland-protocols"
>  
> -DRIDRIVERS = "swrast"
> -DRIDRIVERS_append_x86_class-target = ",radeon,r200,nouveau,i965,i915"
> -DRIDRIVERS_append_x86-64_class-target = ",radeon,r200,nouveau,i965,i915"
> +DRIDRIVERS_class-native = "swrast"
> +DRIDRIVERS_class-nativesdk = "swrast"
> +DRIDRIVERS_append_x86_class-target = ",r100,r200,nouveau,i965,i915"
> +DRIDRIVERS_append_x86-64_class-target = ",r100,r200,nouveau,i965,i915"

I think you need to leave DRIDRIVERS = "swrast" here or the x86 appends
wouldn't have swrast listed?

Do we really want to limit the native version to swrast only? This
seems a fairly major change of behaviour and not what the original code
was intending?

Cheers,

Richard
Alexander Kanavin Feb. 18, 2019, 2:58 p.m.
On Mon, 18 Feb 2019 at 15:18, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:

> I think you need to leave DRIDRIVERS = "swrast" here or the x86 appends
> wouldn't have swrast listed?
>
> Do we really want to limit the native version to swrast only? This
> seems a fairly major change of behaviour and not what the original code
> was intending?

Currently the native version does not build any dri drivers at all.
This is intentional: mesa-native is used only by virgl, so I made the
most minimal possible configuration for mesa-native so that a) virgl
works; and b) build time is as short as possible.

With the switchover to meson, dri support is enabled only if also at
least one dri driver is enabled. swrast seemed like the best choice.

If/when we have more use cases for mesa-native than virgl, we can add
other bits to the configuration.

Hope this makes sense.

Cheers,
Alex
Richard Purdie Feb. 18, 2019, 6:12 p.m.
On Mon, 2019-02-18 at 15:58 +0100, Alexander Kanavin wrote:
> On Mon, 18 Feb 2019 at 15:18, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> 
> > I think you need to leave DRIDRIVERS = "swrast" here or the x86
> > appends
> > wouldn't have swrast listed?
> > 
> > Do we really want to limit the native version to swrast only? This
> > seems a fairly major change of behaviour and not what the original
> > code
> > was intending?
> 
> Currently the native version does not build any dri drivers at all.
> This is intentional: mesa-native is used only by virgl, so I made the
> most minimal possible configuration for mesa-native so that a) virgl
> works; and b) build time is as short as possible.
> 
> With the switchover to meson, dri support is enabled only if also at
> least one dri driver is enabled. swrast seemed like the best choice.
> 
> If/when we have more use cases for mesa-native than virgl, we can add
> other bits to the configuration.
> 
> Hope this makes sense.

That does, I think the patch still needs DRIDRIVERS = "swrast" though?
The details here should be in the commit message too.

Cheers,

Richard
Alexander Kanavin Feb. 18, 2019, 6:20 p.m.
On Mon, 18 Feb 2019 at 19:12, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:

> That does, I think the patch still needs DRIDRIVERS = "swrast" though?
> The details here should be in the commit message too.

Ah, I forgot one more detail which explains the above: there are two
swrast drivers, one dri-based, another gallium-based. Autotools lets
you build both (not sure which one is installed then), meson forces
you to choose. Thus DRIDRIVERS = "swrast" is only set for _native, as
for _target we get the gallium driver instead.

Alex
Alexander Kanavin Feb. 18, 2019, 9:38 p.m.
Also, mesa 18.3.4 is out :) so you could add that in as well in v2.

Alex

On Mon, 18 Feb 2019 at 19:20, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> On Mon, 18 Feb 2019 at 19:12, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>
> > That does, I think the patch still needs DRIDRIVERS = "swrast" though?
> > The details here should be in the commit message too.
>
> Ah, I forgot one more detail which explains the above: there are two
> swrast drivers, one dri-based, another gallium-based. Autotools lets
> you build both (not sure which one is installed then), meson forces
> you to choose. Thus DRIDRIVERS = "swrast" is only set for _native, as
> for _target we get the gallium driver instead.
>
> Alex