Skip to contentSkip to conversation

meson: fix 'auto' handling of drivers and simplify code

PATCH Superseded Eric Engestrom 3 participants 57 messages Mar 20, 2018 – Apr 5, 2018 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover meson: fix 'auto' handling of drivers and simplify code

First 5 patches fix a bug where $driver=auto could end up being turned on even though a dependency (with_atomic) is missing.

Next 4 are turning auto=false into auto=true, which I guess might not be what we want. I'm happy to change or drop them if people want, the rebase would be quite easy.

Then a couple aesthetic patches because I find the code easier to read like this; again, I can drop if people disagree.

The diffstat until then is mostly adding code, but that's about to change:

 meson.build | 126 ++++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 75 insertions(+), 51 deletions(-)

After that, I'm introducing a loop to handle all the copy/pasted code for all the driver options, and then adding them to the list one by one to make it easier to review and/or bisect if I mess it up.

 meson.build | 140 ++++++++++++++----------------------------------------------
 1 file changed, 31 insertions(+), 109 deletions(-)

---

Eric Engestrom (23):
meson: don't enable libdrm_intel without atomic support
meson: don't enable libdrm_radeon without atomic support
meson: don't enable libdrm_amdgpu without atomic support
meson: don't enable libdrm_nouveau without atomic support
meson: don't enable libdrm_freedreno without atomic support
meson: fix omap=auto detection (was always false)
meson: fix exynos=auto detection (was always false)
meson: fix tegra=auto detection (was always false)
meson: fix entaviv=auto detection (was always false)
meson: split vc4=auto logic to make it easier to read
meson: split libkms=auto logic to make it easier to read
meson: introduce simpler way to handle driver options
meson: use simple option handling for intel
meson: use simple option handling for radeon
meson: use simple option handling for amdgpu
meson: use simple option handling for nouveau
meson: use simple option handling for vmwgfx
meson: use simple option handling for omap
meson: use simple option handling for exynos
meson: use simple option handling for freedreno
meson: use simple option handling for tegra
meson: use simple option handling for vc4
meson: use simple option handling for etnaviv

 meson.build | 120 +++++++++++++++++-------------------------------------------
 1 file changed, 33 insertions(+), 87 deletions(-)
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/23 meson: don't enable libdrm_intel without atomic support

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meson.build +7 -6
index 961ee59cff6dc3c2cbb9..e762dcc44bff5deac4d1 100644
@@ -71,12 +71,13 @@ config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
 with_intel = false
 _intel = get_option('intel')
-if _intel != 'false'
-  if _intel == 'true' and not with_atomics
-    error('libdrm_intel requires atomics.')
-  else
-    with_intel = _intel == 'true' or host_machine.cpu_family().startswith('x86')
-  endif
+if _intel == 'auto'
+  with_intel = with_atomics and host_machine.cpu_family().startswith('x86')
+else
+  with_intel = _intel == 'true'
+endif
+if with_intel and not with_atomics
+  error('libdrm_intel requires atomics.')
 endif
 
 with_radeon = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/23 meson: don't enable libdrm_radeon without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index e762dcc44bff5deac4d1..72cdd14a3ba834abde4d 100644
@@ -82,11 +82,13 @@ endif
 
 with_radeon = false
 _radeon = get_option('radeon')
-if _radeon != 'false'
-  if _radeon == 'true' and not with_atomics
-    error('libdrm_radeon requires atomics.')
-  endif
-  with_radeon = true
+if _radeon == 'auto'
+  with_radeon = with_atomics
+else
+  with_radeon = _radeon == 'true'
+endif
+if with_radeon and not with_atomics
+  error('libdrm_radeon requires atomics.')
 endif
 
 with_amdgpu = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/23 meson: don't enable libdrm_amdgpu without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index 72cdd14a3ba834abde4d..4bc088bacdd8120c1508 100644
@@ -93,11 +93,13 @@ endif
 
 with_amdgpu = false
 _amdgpu = get_option('amdgpu')
-if _amdgpu != 'false'
-  if _amdgpu == 'true' and not with_atomics
-    error('libdrm_amdgpu requires atomics.')
-  endif
-  with_amdgpu = true
+if _amdgpu == 'auto'
+  with_amdgpu = with_atomics
+else
+  with_amdgpu = _amdgpu == 'true'
+endif
+if with_amdgpu and not with_atomics
+  error('libdrm_amdgpu requires atomics.')
 endif
 
 with_nouveau = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/23 meson: don't enable libdrm_nouveau without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index 4bc088bacdd8120c1508..edcc7e8ddc39b1760868 100644
@@ -104,11 +104,13 @@ endif
 
 with_nouveau = false
 _nouveau = get_option('nouveau')
-if _nouveau != 'false'
-  if _nouveau == 'true' and not with_atomics
-    error('libdrm_nouveau requires atomics.')
-  endif
-  with_nouveau = true
+if _nouveau == 'auto'
+  with_nouveau = with_atomics
+else
+  with_nouveau = _nouveau == 'true'
+endif
+if with_nouveau and not with_atomics
+  error('libdrm_nouveau requires atomics.')
 endif
 
 with_vmwgfx = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 5/23 meson: don't enable libdrm_freedreno without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meson.build +7 -6
index edcc7e8ddc39b1760868..55ad207b6de349863be3 100644
@@ -130,12 +130,13 @@ endif
 
 with_freedreno = false
 _freedreno = get_option('freedreno')
-if _freedreno != 'false'
-  if _freedreno == 'true' and not with_atomics
-    error('libdrm_freedreno requires atomics.')
-  else
-    with_freedreno = _freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  endif
+if _freedreno == 'auto'
+  with_freedreno =  with_atomics and ['arm', 'aarch64'].contains(host_machine.cpu_family())
+else
+  with_freedreno = _freedreno == 'true'
+endif
+if with_freedreno and not with_atomics
+  error('libdrm_freedreno requires atomics.')
 endif
 
 with_tegra = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 6/23 meson: fix omap=auto detection (was always false)

In reply to Eric Engestrom
---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index 55ad207b6de349863be3..51f2a214e1d9715a053d 100644
@@ -121,11 +121,13 @@ endif
 
 with_omap = false
 _omap = get_option('omap')
-if _omap == 'true'
-  if not with_atomics
-    error('libdrm_omap requires atomics.')
-  endif
-  with_omap = true
+if _omap == 'auto'
+  with_omap = with_atomics
+else
+  with_omap = _omap == 'true'
+endif
+if with_omap and not with_atomics
+  error('libdrm_omap requires atomics.')
 endif
 
 with_freedreno = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

PATCH 7/23 meson: fix exynos=auto detection (was always false)

In reply to Eric Engestrom
---
 meson.build | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
meson.build +8 -2
index 51f2a214e1d9715a053d..76eefaeca20ad80ba1ef 100644
@@ -130,6 +130,14 @@ if with_omap and not with_atomics
   error('libdrm_omap requires atomics.')
 endif
 
+with_exynos = false
+_exynos = get_option('exynos')
+if _exynos == 'auto'
+  with_exynos = true
+else
+  with_exynos = _exynos == 'true'
+endif
+
 with_freedreno = false
 _freedreno = get_option('freedreno')
 if _freedreno == 'auto'
@@ -159,8 +167,6 @@ if _etnaviv == 'true'
   with_etnaviv = true
 endif
 
-with_exynos = get_option('exynos') == 'true'
-
 with_vc4 = false
 _vc4 = get_option('vc4')
 if _vc4 != 'false'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

PATCH 8/23 meson: fix tegra=auto detection (was always false)

In reply to Eric Engestrom
---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index 76eefaeca20ad80ba1ef..a5b71c5e8fb55600458e 100644
@@ -151,11 +151,13 @@ endif
 
 with_tegra = false
 _tegra = get_option('tegra')
-if _tegra == 'true'
-  if not with_atomics
-    error('libdrm_tegra requires atomics.')
-  endif
-  with_tegra = true
+if _tegra == 'auto'
+  with_tegra = with_atomics
+else
+  with_tegra = _tegra == 'true'
+endif
+if with_tegra and not with_atomics
+  error('libdrm_tegra requires atomics.')
 endif
 
 with_etnaviv = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH 9/23 meson: fix entaviv=auto detection (was always false)

In reply to Eric Engestrom
---
 meson.build | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
meson.build +10 -9
index a5b71c5e8fb55600458e..0c26e11dc4bb64325f3c 100644
@@ -160,19 +160,20 @@ if with_tegra and not with_atomics
   error('libdrm_tegra requires atomics.')
 endif
 
-with_etnaviv = false
-_etnaviv = get_option('etnaviv')
-if _etnaviv == 'true'
-  if not with_atomics
-    error('libdrm_etnaviv requires atomics.')
-  endif
-  with_etnaviv = true
-endif
-
 with_vc4 = false
 _vc4 = get_option('vc4')
 if _vc4 != 'false'
   with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
+
+with_etnaviv = false
+_etnaviv = get_option('etnaviv')
+if _etnaviv == 'auto'
+  with_etnaviv = with_atomics
+else
+  with_etnaviv = _etnaviv == 'true'
+endif
+if with_etnaviv and not with_atomics
+  error('libdrm_etnaviv requires atomics.')
 endif
 
 # XXX: Aparently only freebsd and dragonfly bsd actually need this (and
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw

PATCH 10/23 meson: split vc4=auto logic to make it easier to read

In reply to Eric Engestrom
---
 meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meson.build +5 -2
index 0c26e11dc4bb64325f3c..c84e8cdde19d56912ac3 100644
@@ -162,8 +162,11 @@ endif
 
 with_vc4 = false
 _vc4 = get_option('vc4')
-if _vc4 != 'false'
-  with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
+if _vc4 == 'auto'
+  with_vc4 = ['arm', 'aarch64'].contains(host_machine.cpu_family())
+else
+  with_vc4 = _vc4 == 'true'
+endif
 
 with_etnaviv = false
 _etnaviv = get_option('etnaviv')
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw

PATCH 11/23 meson: split libkms=auto logic to make it easier to read

In reply to Eric Engestrom
---
 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
index c84e8cdde19d56912ac3..748a413862dcbe7252c3 100644
@@ -183,8 +183,10 @@ endif
 # gnu/kfreebsd), not openbsd and netbsd
 with_libkms = false
 _libkms = get_option('libkms')
-if _libkms != 'false'
-  with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system())
+if _libkms == 'auto'
+  with_libkms = ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system())
+else
+  with_libkms = _libkms == 'true'
 endif
 
 # Among others FreeBSD does not have a separate dl library.
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#12 lore raw

PATCH 12/23 meson: introduce simpler way to handle driver options

In reply to Eric Engestrom
---
 meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
meson.build +21 -0
index 748a413862dcbe7252c3..c8b17c6cb988ed8f9330 100644
@@ -69,6 +69,27 @@ endif
 config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
 config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
+foreach d : [
+]
+  driver = d[0]
+  require_atomics = d[1]
+  default = d[2]
+  _option = get_option(driver)
+
+  if _option == 'auto'
+    if with_atomics or not require_atomics
+      set_variable('with_' + driver, default)
+    else
+      set_variable('with_' + driver, false)
+    endif
+  else
+    if _option == 'true' and require_atomics and not with_atomics
+      error('libdrm_' + driver + ' requires atomics.')
+    endif
+    set_variable('with_' + driver, _option == 'true')
+  endif
+endforeach
+
 with_intel = false
 _intel = get_option('intel')
 if _intel == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#13 lore raw

PATCH 13/23 meson: use simple option handling for intel

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index c8b17c6cb988ed8f9330..5f88c7d5fe55249798a2 100644
@@ -70,6 +70,7 @@ config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
 config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
 foreach d : [
+  ['intel', true, host_machine.cpu_family().startswith('x86')],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -90,17 +91,6 @@ foreach d : [
   endif
 endforeach
 
-with_intel = false
-_intel = get_option('intel')
-if _intel == 'auto'
-  with_intel = with_atomics and host_machine.cpu_family().startswith('x86')
-else
-  with_intel = _intel == 'true'
-endif
-if with_intel and not with_atomics
-  error('libdrm_intel requires atomics.')
-endif
-
 with_radeon = false
 _radeon = get_option('radeon')
 if _radeon == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#14 lore raw

PATCH 14/23 meson: use simple option handling for radeon

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 5f88c7d5fe55249798a2..fc38685b59045988b149 100644
@@ -71,6 +71,7 @@ config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
 foreach d : [
   ['intel', true, host_machine.cpu_family().startswith('x86')],
+  ['radeon', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -91,17 +92,6 @@ foreach d : [
   endif
 endforeach
 
-with_radeon = false
-_radeon = get_option('radeon')
-if _radeon == 'auto'
-  with_radeon = with_atomics
-else
-  with_radeon = _radeon == 'true'
-endif
-if with_radeon and not with_atomics
-  error('libdrm_radeon requires atomics.')
-endif
-
 with_amdgpu = false
 _amdgpu = get_option('amdgpu')
 if _amdgpu == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#15 lore raw

PATCH 15/23 meson: use simple option handling for amdgpu

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index fc38685b59045988b149..08685debfc28894424cf 100644
@@ -72,6 +72,7 @@ config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 foreach d : [
   ['intel', true, host_machine.cpu_family().startswith('x86')],
   ['radeon', true, true],
+  ['amdgpu', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -92,17 +93,6 @@ foreach d : [
   endif
 endforeach
 
-with_amdgpu = false
-_amdgpu = get_option('amdgpu')
-if _amdgpu == 'auto'
-  with_amdgpu = with_atomics
-else
-  with_amdgpu = _amdgpu == 'true'
-endif
-if with_amdgpu and not with_atomics
-  error('libdrm_amdgpu requires atomics.')
-endif
-
 with_nouveau = false
 _nouveau = get_option('nouveau')
 if _nouveau == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#16 lore raw

PATCH 16/23 meson: use simple option handling for nouveau

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 08685debfc28894424cf..f07aa0010f150be70f46 100644
@@ -73,6 +73,7 @@ foreach d : [
   ['intel', true, host_machine.cpu_family().startswith('x86')],
   ['radeon', true, true],
   ['amdgpu', true, true],
+  ['nouveau', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -93,17 +94,6 @@ foreach d : [
   endif
 endforeach
 
-with_nouveau = false
-_nouveau = get_option('nouveau')
-if _nouveau == 'auto'
-  with_nouveau = with_atomics
-else
-  with_nouveau = _nouveau == 'true'
-endif
-if with_nouveau and not with_atomics
-  error('libdrm_nouveau requires atomics.')
-endif
-
 with_vmwgfx = false
 _vmwgfx = get_option('vmwgfx')
 if _vmwgfx != 'false'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#17 lore raw

PATCH 17/23 meson: use simple option handling for vmwgfx

In reply to Eric Engestrom
---
 meson.build | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
meson.build +1 -6
index f07aa0010f150be70f46..5c4b223f5a36255f492f 100644
@@ -74,6 +74,7 @@ foreach d : [
   ['radeon', true, true],
   ['amdgpu', true, true],
   ['nouveau', true, true],
+  ['vmwgfx', false, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -94,12 +95,6 @@ foreach d : [
   endif
 endforeach
 
-with_vmwgfx = false
-_vmwgfx = get_option('vmwgfx')
-if _vmwgfx != 'false'
-  with_vmwgfx = true
-endif
-
 with_omap = false
 _omap = get_option('omap')
 if _omap == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#18 lore raw

PATCH 18/23 meson: use simple option handling for omap

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 5c4b223f5a36255f492f..16f205f01a61ab2241f1 100644
@@ -75,6 +75,7 @@ foreach d : [
   ['amdgpu', true, true],
   ['nouveau', true, true],
   ['vmwgfx', false, true],
+  ['omap', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -95,17 +96,6 @@ foreach d : [
   endif
 endforeach
 
-with_omap = false
-_omap = get_option('omap')
-if _omap == 'auto'
-  with_omap = with_atomics
-else
-  with_omap = _omap == 'true'
-endif
-if with_omap and not with_atomics
-  error('libdrm_omap requires atomics.')
-endif
-
 with_exynos = false
 _exynos = get_option('exynos')
 if _exynos == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#19 lore raw

PATCH 19/23 meson: use simple option handling for exynos

In reply to Eric Engestrom
---
 meson.build | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
meson.build +1 -8
index 16f205f01a61ab2241f1..46099e5913547af7eed9 100644
@@ -76,6 +76,7 @@ foreach d : [
   ['nouveau', true, true],
   ['vmwgfx', false, true],
   ['omap', true, true],
+  ['exynos', false, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -96,14 +97,6 @@ foreach d : [
   endif
 endforeach
 
-with_exynos = false
-_exynos = get_option('exynos')
-if _exynos == 'auto'
-  with_exynos = true
-else
-  with_exynos = _exynos == 'true'
-endif
-
 with_freedreno = false
 _freedreno = get_option('freedreno')
 if _freedreno == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#20 lore raw

PATCH 20/23 meson: use simple option handling for freedreno

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 46099e5913547af7eed9..761ba442ad4d26259ae5 100644
@@ -77,6 +77,7 @@ foreach d : [
   ['vmwgfx', false, true],
   ['omap', true, true],
   ['exynos', false, true],
+  ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -97,17 +98,6 @@ foreach d : [
   endif
 endforeach
 
-with_freedreno = false
-_freedreno = get_option('freedreno')
-if _freedreno == 'auto'
-  with_freedreno =  with_atomics and ['arm', 'aarch64'].contains(host_machine.cpu_family())
-else
-  with_freedreno = _freedreno == 'true'
-endif
-if with_freedreno and not with_atomics
-  error('libdrm_freedreno requires atomics.')
-endif
-
 with_tegra = false
 _tegra = get_option('tegra')
 if _tegra == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#21 lore raw

PATCH 21/23 meson: use simple option handling for tegra

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 761ba442ad4d26259ae5..5410b03015747e3eb7cf 100644
@@ -78,6 +78,7 @@ foreach d : [
   ['omap', true, true],
   ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
+  ['tegra', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -98,17 +99,6 @@ foreach d : [
   endif
 endforeach
 
-with_tegra = false
-_tegra = get_option('tegra')
-if _tegra == 'auto'
-  with_tegra = with_atomics
-else
-  with_tegra = _tegra == 'true'
-endif
-if with_tegra and not with_atomics
-  error('libdrm_tegra requires atomics.')
-endif
-
 with_vc4 = false
 _vc4 = get_option('vc4')
 if _vc4 == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#22 lore raw

PATCH 22/23 meson: use simple option handling for vc4

In reply to Eric Engestrom
---
 meson.build | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
meson.build +1 -8
index 5410b03015747e3eb7cf..e3df4cd8e8dc475ba373 100644
@@ -79,6 +79,7 @@ foreach d : [
   ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, true],
+  ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -99,14 +100,6 @@ foreach d : [
   endif
 endforeach
 
-with_vc4 = false
-_vc4 = get_option('vc4')
-if _vc4 == 'auto'
-  with_vc4 = ['arm', 'aarch64'].contains(host_machine.cpu_family())
-else
-  with_vc4 = _vc4 == 'true'
-endif
-
 with_etnaviv = false
 _etnaviv = get_option('etnaviv')
 if _etnaviv == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#23 lore raw

PATCH 23/23 meson: use simple option handling for etnaviv

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index e3df4cd8e8dc475ba373..1dc9a1dd0d310d369f1a 100644
@@ -80,6 +80,7 @@ foreach d : [
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, true],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
+  ['etnaviv', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -100,17 +101,6 @@ foreach d : [
   endif
 endforeach
 
-with_etnaviv = false
-_etnaviv = get_option('etnaviv')
-if _etnaviv == 'auto'
-  with_etnaviv = with_atomics
-else
-  with_etnaviv = _etnaviv == 'true'
-endif
-if with_etnaviv and not with_atomics
-  error('libdrm_etnaviv requires atomics.')
-endif
-
 # XXX: Aparently only freebsd and dragonfly bsd actually need this (and
 # gnu/kfreebsd), not openbsd and netbsd
 with_libkms = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#24 lore raw
In reply to Eric Engestrom
Quoted 6 lines · Eric Engestrom

First 5 patches fix a bug where $driver=auto could end up being turned on even though a dependency (with_atomic) is missing.

Next 4 are turning auto=false into auto=true, which I guess might not be what we want. I'm happy to change or drop them if people want, the rebase would be quite easy.

Yeah, thinking about it a bit more, the new code makes it much easier to change the default value if that's something we want, so for now I'll move these at the end (ie. make them turn true into false in the last column of their respective line), and send this as a v2 tomorrow, with any other comment I would've received in the mean time addressed, that way they'll be trivial to drop without affecting the code.

Quoted 42 lines

Then a couple aesthetic patches because I find the code easier to read like this; again, I can drop if people disagree.

The diffstat until then is mostly adding code, but that's about to change:

 meson.build | 126 ++++++++++++++++++++++++++++++++++++------------------------
 1 file changed, 75 insertions(+), 51 deletions(-)

After that, I'm introducing a loop to handle all the copy/pasted code for all the driver options, and then adding them to the list one by one to make it easier to review and/or bisect if I mess it up.

 meson.build | 140 ++++++++++++++----------------------------------------------
 1 file changed, 31 insertions(+), 109 deletions(-)

---

Eric Engestrom (23):
meson: don't enable libdrm_intel without atomic support
meson: don't enable libdrm_radeon without atomic support
meson: don't enable libdrm_amdgpu without atomic support
meson: don't enable libdrm_nouveau without atomic support
meson: don't enable libdrm_freedreno without atomic support
meson: fix omap=auto detection (was always false)
meson: fix exynos=auto detection (was always false)
meson: fix tegra=auto detection (was always false)
meson: fix entaviv=auto detection (was always false)
meson: split vc4=auto logic to make it easier to read
meson: split libkms=auto logic to make it easier to read
meson: introduce simpler way to handle driver options
meson: use simple option handling for intel
meson: use simple option handling for radeon
meson: use simple option handling for amdgpu
meson: use simple option handling for nouveau
meson: use simple option handling for vmwgfx
meson: use simple option handling for omap
meson: use simple option handling for exynos
meson: use simple option handling for freedreno
meson: use simple option handling for tegra
meson: use simple option handling for vc4
meson: use simple option handling for etnaviv

Quoted 7 lines
 meson.build | 120 +++++++++++++++++-------------------------------------------
 1 file changed, 33 insertions(+), 87 deletions(-)
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#25 lore raw

PATCH v2 1/23 meson: don't enable libdrm_intel without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meson.build +7 -6
index 961ee59cff6dc3c2cbb9..e762dcc44bff5deac4d1 100644
@@ -71,12 +71,13 @@ config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
 with_intel = false
 _intel = get_option('intel')
-if _intel != 'false'
-  if _intel == 'true' and not with_atomics
-    error('libdrm_intel requires atomics.')
-  else
-    with_intel = _intel == 'true' or host_machine.cpu_family().startswith('x86')
-  endif
+if _intel == 'auto'
+  with_intel = with_atomics and host_machine.cpu_family().startswith('x86')
+else
+  with_intel = _intel == 'true'
+endif
+if with_intel and not with_atomics
+  error('libdrm_intel requires atomics.')
 endif
 
 with_radeon = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#26 lore raw

PATCH v2 2/23 meson: don't enable libdrm_radeon without atomic support

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index e762dcc44bff5deac4d1..72cdd14a3ba834abde4d 100644
@@ -82,11 +82,13 @@ endif
 
 with_radeon = false
 _radeon = get_option('radeon')
-if _radeon != 'false'
-  if _radeon == 'true' and not with_atomics
-    error('libdrm_radeon requires atomics.')
-  endif
-  with_radeon = true
+if _radeon == 'auto'
+  with_radeon = with_atomics
+else
+  with_radeon = _radeon == 'true'
+endif
+if with_radeon and not with_atomics
+  error('libdrm_radeon requires atomics.')
 endif
 
 with_amdgpu = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#27 lore raw

Re: [PATCH libdrm v2 02/23] meson: don't enable libdrm_radeon without atomic support

Quoting Eric Engestrom (2018-04-04 08:37:57)

Quoted 12 lines

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +0 -0
index e762dcc44bff5deac4d1..72cdd14a3ba834abde4d 100644

meson.build endif · line 89

Quoted 8 lines
meson.build +0 -5
@@ -82,11 +82,13 @@ endif
 
 with_radeon = false
 _radeon = get_option('radeon')
-if _radeon != 'false'
-  if _radeon == 'true' and not with_atomics
-    error('libdrm_radeon requires atomics.')
-  endif
-  with_radeon = true

What about just change this to with_radeon = with_atomics? We've already verified that if radeon == true that atomics are present.

Quoted 14 lines
meson.build +7 -0
+if _radeon == 'auto'
+  with_radeon = with_atomics
+else
+  with_radeon = _radeon == 'true'
+endif
+if with_radeon and not with_atomics
+  error('libdrm_radeon requires atomics.')
 endif
 
 with_amdgpu = false
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#28 lore raw

PATCH v2 3/23 meson: don't enable libdrm_amdgpu without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index 72cdd14a3ba834abde4d..4bc088bacdd8120c1508 100644
@@ -93,11 +93,13 @@ endif
 
 with_amdgpu = false
 _amdgpu = get_option('amdgpu')
-if _amdgpu != 'false'
-  if _amdgpu == 'true' and not with_atomics
-    error('libdrm_amdgpu requires atomics.')
-  endif
-  with_amdgpu = true
+if _amdgpu == 'auto'
+  with_amdgpu = with_atomics
+else
+  with_amdgpu = _amdgpu == 'true'
+endif
+if with_amdgpu and not with_atomics
+  error('libdrm_amdgpu requires atomics.')
 endif
 
 with_nouveau = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#29 lore raw

PATCH v2 4/23 meson: don't enable libdrm_nouveau without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
meson.build +7 -5
index 4bc088bacdd8120c1508..edcc7e8ddc39b1760868 100644
@@ -104,11 +104,13 @@ endif
 
 with_nouveau = false
 _nouveau = get_option('nouveau')
-if _nouveau != 'false'
-  if _nouveau == 'true' and not with_atomics
-    error('libdrm_nouveau requires atomics.')
-  endif
-  with_nouveau = true
+if _nouveau == 'auto'
+  with_nouveau = with_atomics
+else
+  with_nouveau = _nouveau == 'true'
+endif
+if with_nouveau and not with_atomics
+  error('libdrm_nouveau requires atomics.')
 endif
 
 with_vmwgfx = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#30 lore raw

PATCH v2 5/23 meson: don't enable libdrm_freedreno without atomic support

In reply to Eric Engestrom

In the 'auto' case, the with_atomic check was bypassed.

---
 meson.build | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meson.build +7 -6
index edcc7e8ddc39b1760868..55ad207b6de349863be3 100644
@@ -130,12 +130,13 @@ endif
 
 with_freedreno = false
 _freedreno = get_option('freedreno')
-if _freedreno != 'false'
-  if _freedreno == 'true' and not with_atomics
-    error('libdrm_freedreno requires atomics.')
-  else
-    with_freedreno = _freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
-  endif
+if _freedreno == 'auto'
+  with_freedreno =  with_atomics and ['arm', 'aarch64'].contains(host_machine.cpu_family())
+else
+  with_freedreno = _freedreno == 'true'
+endif
+if with_freedreno and not with_atomics
+  error('libdrm_freedreno requires atomics.')
 endif
 
 with_tegra = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#31 lore raw

PATCH v2 6/23 meson: split vc4=auto logic to make it easier to read

In reply to Eric Engestrom
---
 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
index 55ad207b6de349863be3..ba8072a19515f8d7aaa4 100644
@@ -161,8 +161,10 @@ with_exynos = get_option('exynos') == 'true'
 
 with_vc4 = false
 _vc4 = get_option('vc4')
-if _vc4 != 'false'
-  with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
+if _vc4 == 'auto'
+  with_vc4 = ['arm', 'aarch64'].contains(host_machine.cpu_family())
+else
+  with_vc4 = _vc4 == 'true'
 endif
 
 # XXX: Aparently only freebsd and dragonfly bsd actually need this (and
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#32 lore raw

PATCH v2 7/23 meson: split libkms=auto logic to make it easier to read

In reply to Eric Engestrom
---
 meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meson.build +4 -2
index ba8072a19515f8d7aaa4..5b6710ee8dc16b02dbed 100644
@@ -171,8 +171,10 @@ endif
 # gnu/kfreebsd), not openbsd and netbsd
 with_libkms = false
 _libkms = get_option('libkms')
-if _libkms != 'false'
-  with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system())
+if _libkms == 'auto'
+  with_libkms = ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system())
+else
+  with_libkms = _libkms == 'true'
 endif
 
 # Among others FreeBSD does not have a separate dl library.
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#33 lore raw

PATCH v2 8/23 meson: introduce simpler way to handle driver options

In reply to Eric Engestrom
---
 meson.build | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
meson.build +21 -0
index 5b6710ee8dc16b02dbed..8efa99b54e6a108b8255 100644
@@ -69,6 +69,27 @@ endif
 config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
 config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
+foreach d : [
+]
+  driver = d[0]
+  require_atomics = d[1]
+  default = d[2]
+  _option = get_option(driver)
+
+  if _option == 'auto'
+    if with_atomics or not require_atomics
+      set_variable('with_' + driver, default)
+    else
+      set_variable('with_' + driver, false)
+    endif
+  else
+    if _option == 'true' and require_atomics and not with_atomics
+      error('libdrm_' + driver + ' requires atomics.')
+    endif
+    set_variable('with_' + driver, _option == 'true')
+  endif
+endforeach
+
 with_intel = false
 _intel = get_option('intel')
 if _intel == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#34 lore raw

PATCH v2 9/23 meson: use simple option handling for intel

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 8efa99b54e6a108b8255..12cf96157b2789df3a55 100644
@@ -70,6 +70,7 @@ config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
 config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
 foreach d : [
+  ['intel', true, host_machine.cpu_family().startswith('x86')],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -90,17 +91,6 @@ foreach d : [
   endif
 endforeach
 
-with_intel = false
-_intel = get_option('intel')
-if _intel == 'auto'
-  with_intel = with_atomics and host_machine.cpu_family().startswith('x86')
-else
-  with_intel = _intel == 'true'
-endif
-if with_intel and not with_atomics
-  error('libdrm_intel requires atomics.')
-endif
-
 with_radeon = false
 _radeon = get_option('radeon')
 if _radeon == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#35 lore raw

PATCH v2 10/23 meson: use simple option handling for radeon

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 12cf96157b2789df3a55..035ac8cf2f1130d0b799 100644
@@ -71,6 +71,7 @@ config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 
 foreach d : [
   ['intel', true, host_machine.cpu_family().startswith('x86')],
+  ['radeon', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -91,17 +92,6 @@ foreach d : [
   endif
 endforeach
 
-with_radeon = false
-_radeon = get_option('radeon')
-if _radeon == 'auto'
-  with_radeon = with_atomics
-else
-  with_radeon = _radeon == 'true'
-endif
-if with_radeon and not with_atomics
-  error('libdrm_radeon requires atomics.')
-endif
-
 with_amdgpu = false
 _amdgpu = get_option('amdgpu')
 if _amdgpu == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#36 lore raw

PATCH v2 11/23 meson: use simple option handling for amdgpu

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index 035ac8cf2f1130d0b799..da52f5c078c3d2f47397 100644
@@ -72,6 +72,7 @@ config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
 foreach d : [
   ['intel', true, host_machine.cpu_family().startswith('x86')],
   ['radeon', true, true],
+  ['amdgpu', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -92,17 +93,6 @@ foreach d : [
   endif
 endforeach
 
-with_amdgpu = false
-_amdgpu = get_option('amdgpu')
-if _amdgpu == 'auto'
-  with_amdgpu = with_atomics
-else
-  with_amdgpu = _amdgpu == 'true'
-endif
-if with_amdgpu and not with_atomics
-  error('libdrm_amdgpu requires atomics.')
-endif
-
 with_nouveau = false
 _nouveau = get_option('nouveau')
 if _nouveau == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#37 lore raw

PATCH v2 12/23 meson: use simple option handling for nouveau

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index da52f5c078c3d2f47397..e871c77c9860a84eed8f 100644
@@ -73,6 +73,7 @@ foreach d : [
   ['intel', true, host_machine.cpu_family().startswith('x86')],
   ['radeon', true, true],
   ['amdgpu', true, true],
+  ['nouveau', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -93,17 +94,6 @@ foreach d : [
   endif
 endforeach
 
-with_nouveau = false
-_nouveau = get_option('nouveau')
-if _nouveau == 'auto'
-  with_nouveau = with_atomics
-else
-  with_nouveau = _nouveau == 'true'
-endif
-if with_nouveau and not with_atomics
-  error('libdrm_nouveau requires atomics.')
-endif
-
 with_vmwgfx = false
 _vmwgfx = get_option('vmwgfx')
 if _vmwgfx != 'false'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#38 lore raw

PATCH v2 13/23 meson: use simple option handling for vmwgfx

In reply to Eric Engestrom
---
 meson.build | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
meson.build +1 -6
index e871c77c9860a84eed8f..6786a44e3df1a2e00540 100644
@@ -74,6 +74,7 @@ foreach d : [
   ['radeon', true, true],
   ['amdgpu', true, true],
   ['nouveau', true, true],
+  ['vmwgfx', false, true],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -94,12 +95,6 @@ foreach d : [
   endif
 endforeach
 
-with_vmwgfx = false
-_vmwgfx = get_option('vmwgfx')
-if _vmwgfx != 'false'
-  with_vmwgfx = true
-endif
-
 with_omap = false
 _omap = get_option('omap')
 if _omap == 'true'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#39 lore raw

PATCH v2 14/23 meson: use simple option handling for omap

In reply to Eric Engestrom
---
 meson.build | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
meson.build +7 -7
index 6786a44e3df1a2e00540..29f91ee9f6eb96b05f0d 100644
@@ -75,6 +75,7 @@ foreach d : [
   ['amdgpu', true, true],
   ['nouveau', true, true],
   ['vmwgfx', false, true],
+  ['omap', true, false],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -95,13 +96,12 @@ foreach d : [
   endif
 endforeach
 
-with_omap = false
-_omap = get_option('omap')
-if _omap == 'true'
-  if not with_atomics
-    error('libdrm_omap requires atomics.')
-  endif
-  with_omap = true
+with_exynos = false
+_exynos = get_option('exynos')
+if _exynos == 'auto'
+  with_exynos = true
+else
+  with_exynos = _exynos == 'true'
 endif
 
 with_freedreno = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#40 lore raw

Re: [PATCH libdrm v2 14/23] meson: use simple option handling for omap

Hi,

Quoted 6 lines · Eric Engestrom

[...]

meson.build +0 -4
-with_omap = false
-_omap = get_option('omap')
-if _omap == 'true'
-  if not with_atomics

meson.build foreach d : [ · line 105

Quoted 10 lines
meson.build +6 -3
-    error('libdrm_omap requires atomics.')
-  endif
-  with_omap = true
+with_exynos = false
+_exynos = get_option('exynos')
+if _exynos == 'auto'
+  with_exynos = true
+else
+  with_exynos = _exynos == 'true'
 endif

Looks like some patch rebasing went wrong with this one (it simplifies omap, but also adds some exynos stuff)?

-- Sebastian

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#41 lore raw

Re: [PATCH libdrm v2 14/23] meson: use simple option handling for omap

Quoted 14 lines · Sebastian Reichel

Hi,

Quoted 11 lines · Eric Engestrom

[...]

meson.build +2 -7
-with_omap = false
-_omap = get_option('omap')
-if _omap == 'true'
-  if not with_atomics
-    error('libdrm_omap requires atomics.')
-  endif
-  with_omap = true
+with_exynos = false
+_exynos = get_option('exynos')
Quoted 8 lines

meson.build foreach d : [ · line 105

Quoted 5 lines
meson.build +4 -0
+if _exynos == 'auto'
+  with_exynos = true
+else
+  with_exynos = _exynos == 'true'
 endif

Looks like some patch rebasing went wrong with this one (it simplifies omap, but also adds some exynos stuff)?

Indeed, that's a complete rebase fail...
Thanks for not letting me push this unaware :)

I'll send a v3 of 8-19 next week, after landing the first bits (1-7). I think I'll defer 20-23 to after everything else has landed.

Quoted 2 lines

-- Sebastian

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#42 lore raw

PATCH v2 15/23 meson: use simple option handling for exynos

In reply to Eric Engestrom
---
 meson.build | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
meson.build +1 -8
index 29f91ee9f6eb96b05f0d..f0804fc5a0a1d907313f 100644
@@ -76,6 +76,7 @@ foreach d : [
   ['nouveau', true, true],
   ['vmwgfx', false, true],
   ['omap', true, false],
+  ['exynos', false, false],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -96,14 +97,6 @@ foreach d : [
   endif
 endforeach
 
-with_exynos = false
-_exynos = get_option('exynos')
-if _exynos == 'auto'
-  with_exynos = true
-else
-  with_exynos = _exynos == 'true'
-endif
-
 with_freedreno = false
 _freedreno = get_option('freedreno')
 if _freedreno == 'auto'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#43 lore raw

PATCH v2 16/23 meson: use simple option handling for freedreno

In reply to Eric Engestrom
---
 meson.build | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
meson.build +1 -11
index f0804fc5a0a1d907313f..72e5836e78bd239584b3 100644
@@ -77,6 +77,7 @@ foreach d : [
   ['vmwgfx', false, true],
   ['omap', true, false],
   ['exynos', false, false],
+  ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -97,17 +98,6 @@ foreach d : [
   endif
 endforeach
 
-with_freedreno = false
-_freedreno = get_option('freedreno')
-if _freedreno == 'auto'
-  with_freedreno =  with_atomics and ['arm', 'aarch64'].contains(host_machine.cpu_family())
-else
-  with_freedreno = _freedreno == 'true'
-endif
-if with_freedreno and not with_atomics
-  error('libdrm_freedreno requires atomics.')
-endif
-
 with_tegra = false
 _tegra = get_option('tegra')
 if _tegra == 'true'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#44 lore raw

PATCH v2 17/23 meson: use simple option handling for tegra

In reply to Eric Engestrom
---
 meson.build | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
meson.build +1 -9
index 72e5836e78bd239584b3..a469bdbff1743f796bdf 100644
@@ -78,6 +78,7 @@ foreach d : [
   ['omap', true, false],
   ['exynos', false, false],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
+  ['tegra', true, false],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -98,15 +99,6 @@ foreach d : [
   endif
 endforeach
 
-with_tegra = false
-_tegra = get_option('tegra')
-if _tegra == 'true'
-  if not with_atomics
-    error('libdrm_tegra requires atomics.')
-  endif
-  with_tegra = true
-endif
-
 with_etnaviv = false
 _etnaviv = get_option('etnaviv')
 if _etnaviv == 'true'
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#45 lore raw

PATCH v2 18/23 meson: use simple option handling for vc4

In reply to Eric Engestrom
---
 meson.build | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
meson.build +1 -8
index a469bdbff1743f796bdf..f3747736f5bed7c01143 100644
@@ -79,6 +79,7 @@ foreach d : [
   ['exynos', false, false],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
+  ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -110,14 +111,6 @@ endif
 
 with_exynos = get_option('exynos') == 'true'
 
-with_vc4 = false
-_vc4 = get_option('vc4')
-if _vc4 == 'auto'
-  with_vc4 = ['arm', 'aarch64'].contains(host_machine.cpu_family())
-else
-  with_vc4 = _vc4 == 'true'
-endif
-
 # XXX: Aparently only freebsd and dragonfly bsd actually need this (and
 # gnu/kfreebsd), not openbsd and netbsd
 with_libkms = false
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#46 lore raw

PATCH v2 19/23 meson: use simple option handling for etnaviv

In reply to Eric Engestrom
---
 meson.build | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
meson.build +1 -9
index f3747736f5bed7c01143..f659c02bc82660d038cc 100644
@@ -80,6 +80,7 @@ foreach d : [
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
+  ['etnaviv', true, false],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -100,15 +101,6 @@ foreach d : [
   endif
 endforeach
 
-with_etnaviv = false
-_etnaviv = get_option('etnaviv')
-if _etnaviv == 'true'
-  if not with_atomics
-    error('libdrm_etnaviv requires atomics.')
-  endif
-  with_etnaviv = true
-endif
-
 with_exynos = get_option('exynos') == 'true'
 
 # XXX: Aparently only freebsd and dragonfly bsd actually need this (and
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v2 19/23
#47 lore raw

Re: [PATCH libdrm v2 19/23] meson: use simple option handling for etnaviv

You can ignore my comments on the first couple of patches if you like, I think the result is much nicer anyway.

1-19 are:

Quoting Eric Engestrom (2018-04-04 08:38:14)

Quoted 37 lines
---
 meson.build | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
meson.build +1 -9
index f3747736f5bed7c01143..f659c02bc82660d038cc 100644
@@ -80,6 +80,7 @@ foreach d : [
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
+  ['etnaviv', true, false],
 ]
   driver = d[0]
   require_atomics = d[1]
@@ -100,15 +101,6 @@ foreach d : [
   endif
 endforeach
 
-with_etnaviv = false
-_etnaviv = get_option('etnaviv')
-if _etnaviv == 'true'
-  if not with_atomics
-    error('libdrm_etnaviv requires atomics.')
-  endif
-  with_etnaviv = true
-endif
-
 with_exynos = get_option('exynos') == 'true'
 
 # XXX: Aparently only freebsd and dragonfly bsd actually need this (and
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#48 lore raw

PATCH v2 20/23 meson: build omap by default

In reply to Eric Engestrom
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index f659c02bc82660d038cc..24688535a329ac530c10 100644
@@ -75,7 +75,7 @@ foreach d : [
   ['amdgpu', true, true],
   ['nouveau', true, true],
   ['vmwgfx', false, true],
-  ['omap', true, false],
+  ['omap', true, true],
   ['exynos', false, false],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#49 lore raw

PATCH v2 21/23 meson: build exynos by default

In reply to Eric Engestrom
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index 24688535a329ac530c10..7b26977a9e84290fdd37 100644
@@ -76,7 +76,7 @@ foreach d : [
   ['nouveau', true, true],
   ['vmwgfx', false, true],
   ['omap', true, true],
-  ['exynos', false, false],
+  ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#50 lore raw

Re: [PATCH libdrm v2 21/23] meson: build exynos by default

For exynos and omap, are they in active use anymore? I'm pretty sure that development of omap (the hardware) stopped, and others have told me exynos has stopped too. I also don't think there's any open source consumer, since there is no mesa driver for either of these.

Dylan

Quoting Eric Engestrom (2018-04-04 08:38:16)

Quoted 22 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index 24688535a329ac530c10..7b26977a9e84290fdd37 100644
@@ -76,7 +76,7 @@ foreach d : [
   ['nouveau', true, true],
   ['vmwgfx', false, true],
   ['omap', true, true],
-  ['exynos', false, false],
+  ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#51 lore raw

Re: [PATCH libdrm v2 21/23] meson: build exynos by default

Quoted 4 lines · Dylan Baker

For exynos and omap, are they in active use anymore? I'm pretty sure that development of omap (the hardware) stopped, and others have told me exynos has stopped too. I also don't think there's any open source consumer, since there is no mesa driver for either of these.

Happy to drop these enablement patches; I just like to have everything possible built by default, but if these are dead I'm fine with leaving them disabled by default.

Quoted 18 lines

Dylan

Quoting Eric Engestrom (2018-04-04 08:38:16)

Quoted 14 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +0 -1
index 24688535a329ac530c10..7b26977a9e84290fdd37 100644
@@ -76,7 +76,7 @@ foreach d : [
   ['nouveau', true, true],
   ['vmwgfx', false, true],
   ['omap', true, true],
-  ['exynos', false, false],
Quoted 8 lines
Quoted 8 lines
meson.build +1 -0
+  ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, false],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#52 lore raw

Re: [PATCH libdrm v2 21/23] meson: build exynos by default

Quoting Eric Engestrom (2018-04-05 02:48:50)

Quoted 10 lines · Dylan Baker
Quoted 4 lines

For exynos and omap, are they in active use anymore? I'm pretty sure that development of omap (the hardware) stopped, and others have told me exynos has stopped too. I also don't think there's any open source consumer, since there is no mesa driver for either of these.

Happy to drop these enablement patches; I just like to have everything possible built by default, but if these are dead I'm fine with leaving them disabled by default.

Yeah, I just don't know what the right thing is, it just seems like a bad idea to enable something by default that never really got anywhere.

Dylan

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#53 lore raw

PATCH v2 22/23 meson: build tegra by default

In reply to Eric Engestrom
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index 7b26977a9e84290fdd37..e816740cb240922bf98a 100644
@@ -78,7 +78,7 @@ foreach d : [
   ['omap', true, true],
   ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
-  ['tegra', true, false],
+  ['tegra', true, true],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['etnaviv', true, false],
 ]
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#54 lore raw

Re: [PATCH libdrm v2 22/23] meson: build tegra by default

Please CC Thierry or someone else from nvidia about this, Also I think this should be ['arm', 'aarch64'], like vc4 and freedreno.

Quoting Eric Engestrom (2018-04-04 08:38:17)

Quoted 22 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index 7b26977a9e84290fdd37..e816740cb240922bf98a 100644
@@ -78,7 +78,7 @@ foreach d : [
   ['omap', true, true],
   ['exynos', false, true],
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
-  ['tegra', true, false],
+  ['tegra', true, true],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['etnaviv', true, false],
 ]
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#55 lore raw

PATCH v2 23/23 meson: build etnaviv by default

In reply to Eric Engestrom
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index e816740cb240922bf98a..a725f05d342bbec4df18 100644
@@ -80,7 +80,7 @@ foreach d : [
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, true],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
-  ['etnaviv', true, false],
+  ['etnaviv', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
Signature · 7 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#56 lore raw

Re: [PATCH libdrm v2 23/23] meson: build etnaviv by default

Please CC the etnaviv maintainers on this as well.

I think this should be ['arm', 'aarch64']... like vc4 and fredreno

Quoting Eric Engestrom (2018-04-04 08:38:18)

Quoted 22 lines
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
index e816740cb240922bf98a..a725f05d342bbec4df18 100644
@@ -80,7 +80,7 @@ foreach d : [
   ['freedreno', true, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
   ['tegra', true, true],
   ['vc4', false, ['arm', 'aarch64'].contains(host_machine.cpu_family())],
-  ['etnaviv', true, false],
+  ['etnaviv', true, true],
 ]
   driver = d[0]
   require_atomics = d[1]
Signature · 2 lines
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel