Discussion:
[Mesa-dev] [PATCH 1/3] meson: Use system_has_kms_drm in default driver selection
Greg V
2018-03-06 19:16:03 UTC
Permalink
---
meson.build | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index d68460231c..e71f4ddd73 100644
--- a/meson.build
+++ b/meson.build
@@ -87,6 +87,8 @@ if (with_gles1 or with_gles2) and not with_opengl
error('building OpenGL ES without OpenGL is not supported.')
endif

+system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly', 'linux'].contains(host_machine.system())
+
with_dri = false
with_dri_i915 = false
with_dri_i965 = false
@@ -96,7 +98,7 @@ with_dri_nouveau = false
with_dri_swrast = false
_drivers = get_option('dri-drivers')
if _drivers == 'auto'
- if host_machine.system() == 'linux'
+ if system_has_kms_drm
# TODO: PPC, Sparc
if ['x86', 'x86_64'].contains(host_machine.cpu_family())
_drivers = 'i915,i965,r100,r200,nouveau'
@@ -139,7 +141,7 @@ with_gallium_virgl = false
with_gallium_swr = false
_drivers = get_option('gallium-drivers')
if _drivers == 'auto'
- if host_machine.system() == 'linux'
+ if system_has_kms_drm
# TODO: PPC, Sparc
if ['x86', 'x86_64'].contains(host_machine.cpu_family())
_drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
@@ -179,7 +181,7 @@ with_amd_vk = false
with_any_vk = false
_vulkan_drivers = get_option('vulkan-drivers')
if _vulkan_drivers == 'auto'
- if host_machine.system() == 'linux'
+ if system_has_kms_drm
if host_machine.cpu_family().startswith('x86')
_vulkan_drivers = 'amd,intel'
else
@@ -217,8 +219,6 @@ if with_dri_i915 or with_gallium_i915
dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
endif

-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly', 'linux'].contains(host_machine.system())
-
if host_machine.system() == 'darwin'
with_dri_platform = 'apple'
elif ['windows', 'cygwin'].contains(host_machine.system())
--
2.16.2
Greg V
2018-03-06 19:16:04 UTC
Permalink
e.g. libvdpau_radeonsi.so(.1(.0)) were pointing to the absolute
build-time path of libvdpau_radeonsi.so.1.0.0, which caused trouble
when packaging the libraries.
---
bin/install_megadrivers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 86bfa35918..ce947b4332 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -58,7 +58,7 @@ def main():
while ext != '.so':
if os.path.exists(name):
os.unlink(name)
- os.symlink(driver, name)
+ os.symlink(os.path.relpath(driver), name)
name, ext = os.path.splitext(name)
finally:
os.chdir(ret)
--
2.16.2
Emil Velikov
2018-03-08 18:47:43 UTC
Permalink
Post by Greg V
e.g. libvdpau_radeonsi.so(.1(.0)) were pointing to the absolute
build-time path of libvdpau_radeonsi.so.1.0.0, which caused trouble
when packaging the libraries.
Patch looks correct, although CC-ing Dylan as our resident python expert.

Fixes: f7f1b30f81e ("meson: extend install_megadrivers script to
handle symmlinking")
Reviewed-by: Emil Velikov <***@collabora.com>

-Emil
Dylan Baker
2018-03-08 19:10:30 UTC
Permalink
Quoting Greg V (2018-03-06 11:16:04)
Post by Greg V
e.g. libvdpau_radeonsi.so(.1(.0)) were pointing to the absolute
build-time path of libvdpau_radeonsi.so.1.0.0, which caused trouble
when packaging the libraries.
---
bin/install_megadrivers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 86bfa35918..ce947b4332 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
os.unlink(name)
- os.symlink(driver, name)
+ os.symlink(os.path.relpath(driver), name)
name, ext = os.path.splitext(name)
os.chdir(ret)
--
2.16.2
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
I'm looking at this right now, my gut is telling me this is wrong, but I don't
know why. I'm looking at it right now.
Dylan Baker
2018-03-08 19:25:20 UTC
Permalink
Quoting Greg V (2018-03-06 11:16:04)
Post by Greg V
e.g. libvdpau_radeonsi.so(.1(.0)) were pointing to the absolute
build-time path of libvdpau_radeonsi.so.1.0.0, which caused trouble
when packaging the libraries.
---
bin/install_megadrivers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 86bfa35918..ce947b4332 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
os.unlink(name)
- os.symlink(driver, name)
+ os.symlink(os.path.relpath(driver), name)
I think that driver is wrong here, I think that this should be
`os.symlink(each, name)`

In my testing these generated the same code.

Dylan
Post by Greg V
name, ext = os.path.splitext(name)
os.chdir(ret)
--
2.16.2
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Dylan Baker
2018-03-08 19:28:51 UTC
Permalink
Quoting Dylan Baker (2018-03-08 11:25:20)
Post by Dylan Baker
Quoting Greg V (2018-03-06 11:16:04)
Post by Greg V
e.g. libvdpau_radeonsi.so(.1(.0)) were pointing to the absolute
build-time path of libvdpau_radeonsi.so.1.0.0, which caused trouble
when packaging the libraries.
---
bin/install_megadrivers.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 86bfa35918..ce947b4332 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
os.unlink(name)
- os.symlink(driver, name)
+ os.symlink(os.path.relpath(driver), name)
I think that driver is wrong here, I think that this should be
`os.symlink(each, name)`
In my testing these generated the same code.
By "these" I mean os.path.relpath(driver) and each
Post by Dylan Baker
Dylan
Post by Greg V
name, ext = os.path.splitext(name)
os.chdir(ret)
--
2.16.2
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Greg V
2018-03-06 19:16:05 UTC
Permalink
FreeBSD builds Mesa with --disable-glx-tls in autotools because:
https://github.com/dumbbell/test-tls-initial-exec

Add the equivalent option to Meson.
---
meson.build | 5 ++++-
meson_options.txt | 6 ++++++
2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index e71f4ddd73..1c4293d464 100644
--- a/meson.build
+++ b/meson.build
@@ -329,7 +329,10 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless)
endif
endif

-pre_args += '-DGLX_USE_TLS'
+if get_option('glx-tls')
+ pre_args += '-DGLX_USE_TLS'
+endif
+
if with_glx != 'disabled'
if not (with_platform_x11 and with_any_opengl)
if with_glx == 'auto'
diff --git a/meson_options.txt b/meson_options.txt
index 7fafe2deaa..eaf23f6988 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -280,6 +280,12 @@ option(
value : 'avx,avx2',
description : 'Comma delemited swr architectures. choices : avx,avx2,knl,skx'
)
+option(
+ 'glx-tls',
+ type : 'boolean',
+ value : true,
+ description : 'Enable thread-local storage in GLX and EGL'
+)
option(
'tools',
type : 'string',
--
2.16.2
Eric Anholt
2018-03-08 18:12:02 UTC
Permalink
Post by Greg V
https://github.com/dumbbell/test-tls-initial-exec
Add the equivalent option to Meson.
---
meson.build | 5 ++++-
meson_options.txt | 6 ++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e71f4ddd73..1c4293d464 100644
--- a/meson.build
+++ b/meson.build
@@ -329,7 +329,10 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless)
endif
endif
-pre_args += '-DGLX_USE_TLS'
+if get_option('glx-tls')
+ pre_args += '-DGLX_USE_TLS'
+endif
Instead of introducing an option, could we just test
host_machine.system() for freebsd here, so that nobody on any OS can
choose the wrong value?
Emil Velikov
2018-03-08 18:18:07 UTC
Permalink
Post by Eric Anholt
Post by Greg V
https://github.com/dumbbell/test-tls-initial-exec
Add the equivalent option to Meson.
---
meson.build | 5 ++++-
meson_options.txt | 6 ++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e71f4ddd73..1c4293d464 100644
--- a/meson.build
+++ b/meson.build
@@ -329,7 +329,10 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless)
endif
endif
-pre_args += '-DGLX_USE_TLS'
+if get_option('glx-tls')
+ pre_args += '-DGLX_USE_TLS'
+endif
Instead of introducing an option, could we just test
host_machine.system() for freebsd here, so that nobody on any OS can
choose the wrong value?
This please. Other platforms also have this problem but it's something
they should sit down and address.

Thanks
Emil
Dylan Baker
2018-03-08 18:40:09 UTC
Permalink
Quoting Eric Anholt (2018-03-08 10:12:02)
Post by Eric Anholt
Post by Greg V
https://github.com/dumbbell/test-tls-initial-exec
Add the equivalent option to Meson.
---
meson.build | 5 ++++-
meson_options.txt | 6 ++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index e71f4ddd73..1c4293d464 100644
--- a/meson.build
+++ b/meson.build
@@ -329,7 +329,10 @@ if with_egl and not (with_platform_drm or with_platform_surfaceless)
endif
endif
-pre_args += '-DGLX_USE_TLS'
+if get_option('glx-tls')
+ pre_args += '-DGLX_USE_TLS'
+endif
Instead of introducing an option, could we just test
host_machine.system() for freebsd here, so that nobody on any OS can
choose the wrong value?
I third this, this was always my plan for the meson build if someone needed to
turn off GLX_USE_TLS.

Dylan
Dylan Baker
2018-03-08 18:41:53 UTC
Permalink
Quoting Greg V (2018-03-06 11:16:03)
Post by Greg V
---
meson.build | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/meson.build b/meson.build
index d68460231c..e71f4ddd73 100644
--- a/meson.build
+++ b/meson.build
@@ -87,6 +87,8 @@ if (with_gles1 or with_gles2) and not with_opengl
error('building OpenGL ES without OpenGL is not supported.')
endif
+system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly', 'linux'].contains(host_machine.system())
+
with_dri = false
with_dri_i915 = false
with_dri_i965 = false
@@ -96,7 +98,7 @@ with_dri_nouveau = false
with_dri_swrast = false
_drivers = get_option('dri-drivers')
if _drivers == 'auto'
- if host_machine.system() == 'linux'
+ if system_has_kms_drm
# TODO: PPC, Sparc
if ['x86', 'x86_64'].contains(host_machine.cpu_family())
_drivers = 'i915,i965,r100,r200,nouveau'
@@ -139,7 +141,7 @@ with_gallium_virgl = false
with_gallium_swr = false
_drivers = get_option('gallium-drivers')
if _drivers == 'auto'
- if host_machine.system() == 'linux'
+ if system_has_kms_drm
# TODO: PPC, Sparc
if ['x86', 'x86_64'].contains(host_machine.cpu_family())
_drivers = 'r300,r600,radeonsi,nouveau,virgl,svga,swrast'
@@ -179,7 +181,7 @@ with_amd_vk = false
with_any_vk = false
_vulkan_drivers = get_option('vulkan-drivers')
if _vulkan_drivers == 'auto'
- if host_machine.system() == 'linux'
+ if system_has_kms_drm
Do vulkan drivers work on all of the BSDs?
Post by Greg V
if host_machine.cpu_family().startswith('x86')
_vulkan_drivers = 'amd,intel'
else
@@ -217,8 +219,6 @@ if with_dri_i915 or with_gallium_i915
dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
endif
-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'dragonfly', 'linux'].contains(host_machine.system())
-
if host_machine.system() == 'darwin'
with_dri_platform = 'apple'
elif ['windows', 'cygwin'].contains(host_machine.system())
--
2.16.2
_______________________________________________
mesa-dev mailing list
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Greg V
2018-03-08 19:23:02 UTC
Permalink
Post by Dylan Baker
Do vulkan drivers work on all of the BSDs?
I don't think anyone tried them on anything other than FreeBSD, but why
add extra conditionals?
Building them by default makes them more noticeable for e.g. package
maintainers :)
Dylan Baker
2018-03-08 20:53:08 UTC
Permalink
Yeah, I guess. Do we know for certain they don't work on any of the BSDs? If not
then I guess this is fine, and the other BSD maintainers can submit patches to
fix it.

Reviewed-by: Dylan Baker <***@pnwbakers.com>

Quoting Greg V (2018-03-08 11:23:02)
Post by Greg V
Post by Dylan Baker
Do vulkan drivers work on all of the BSDs?
I don't think anyone tried them on anything other than FreeBSD, but why
add extra conditionals?
Building them by default makes them more noticeable for e.g. package
maintainers :)
Eric Anholt
2018-03-09 18:25:21 UTC
Permalink
---
I've pushed this patch with Dylan's and my review on it.
Matt Turner
2018-03-16 02:39:14 UTC
Permalink
Hi! Here's a few more patches that let me successfully build, package
and install fully working Meson-built Mesa-git on my FreeBSD box.
meson: Use system_has_kms_drm in default driver selection
meson: use relative paths in megadriver symlinks
meson: make GLX_USE_TLS optional
bin/install_megadrivers.py | 2 +-
meson.build | 15 +++++++++------
meson_options.txt | 6 ++++++
3 files changed, 16 insertions(+), 7 deletions(-)
This message has a from address in unrelenting.technology but has failed unrelenting.technology's required tests for authentication. Learn more
I wouldn't expect anyone to review until you fix your mail server.
Emil Velikov
2018-03-16 15:07:11 UTC
Permalink
Post by Matt Turner
Hi! Here's a few more patches that let me successfully build, package
and install fully working Meson-built Mesa-git on my FreeBSD box.
meson: Use system_has_kms_drm in default driver selection
meson: use relative paths in megadriver symlinks
meson: make GLX_USE_TLS optional
bin/install_megadrivers.py | 2 +-
meson.build | 15 +++++++++------
meson_options.txt | 6 ++++++
3 files changed, 16 insertions(+), 7 deletions(-)
Setting up a filter for 'list:"mesa-dev.lists.freedesktop.org"' will help there.
Post by Matt Turner
This message has a from address in unrelenting.technology but has failed unrelenting.technology's required tests for authentication. Learn more
I wouldn't expect anyone to review until you fix your mail server.
Me+Dylan actually spotted the emails, despite the funky server ;-)
Regardless, fixing that up is a must have IMHO.

-Emil
Matt Turner
2018-03-16 15:23:46 UTC
Permalink
Post by Emil Velikov
Hi! Here's a few more patches that let me successfully build, package
and install fully working Meson-built Mesa-git on my FreeBSD box.
meson: Use system_has_kms_drm in default driver selection
meson: use relative paths in megadriver symlinks
meson: make GLX_USE_TLS optional
bin/install_megadrivers.py | 2 +-
meson.build | 15 +++++++++------
meson_options.txt | 6 ++++++
3 files changed, 16 insertions(+), 7 deletions(-)
Setting up a filter for 'list:"mesa-dev.lists.freedesktop.org"' will help there.
I have that.
Daniel Stone
2018-03-16 15:47:42 UTC
Permalink
Hi,
Post by Matt Turner
Post by Emil Velikov
Setting up a filter for 'list:"mesa-dev.lists.freedesktop.org"' will help there.
I have that.
Yeah, I have the same. I missed Greg's messages to Wayland for quite a
long time for this reason. unrelenting.technology has DKIM set up,
meaning that no-one is allowed to send email from that domain but his
mail server. This completely breaks Mailman, and GMail is so strict
about it that it marks it as spam with either red or yellow warnings,
no matter what you do. There's no way to train it out of it.

Cheers,
Daniel

Loading...