drm: Branch 'master' - 13 commits

[email protected] (GitLab Mirror) Mon, 11 Nov 2019 23:00:51 +0000 (UTC)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 amdgpu/amdgpu-symbols.txt       |   19 -----
 amdgpu/meson.build              |   11 ++-
 etnaviv/etnaviv-symbols.txt     |   19 -----
 etnaviv/meson.build             |   11 ++-
 exynos/exynos-symbol-check      |   42 ------------
 exynos/exynos-symbols.txt       |   23 +++++++
 exynos/meson.build              |   11 ++-
 freedreno/freedreno-symbols.txt |   20 ------
 freedreno/meson.build           |   11 ++-
 intel/intel-symbols.txt         |   19 -----
 intel/meson.build               |   12 ++-
 libkms/kms-symbol-check         |   27 --------
 libkms/kms-symbols.txt          |    8 ++
 libkms/meson.build              |   11 ++-
 meson.build                     |    6 -
 nouveau/meson.build             |   11 ++-
 nouveau/nouveau-symbols.txt     |   19 -----
 omap/meson.build                |   11 ++-
 omap/omap-symbol-check          |   37 -----------
 omap/omap-symbols.txt           |   18 +++++
 radeon/meson.build              |   11 ++-
 radeon/radeon-symbols.txt       |   19 -----
 symbols-check.py                |  130 ++++++++++++++++++++++++++++++++++++++++
 tegra/meson.build               |   11 ++-
 tegra/tegra-symbol-check        |   35 ----------
 tegra/tegra-symbols.txt         |   13 ++++
 26 files changed, 266 insertions(+), 299 deletions(-)

New commits:
commit 73d826be4d2d2777cd32484dbece7f3f6a420b6f
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:34:43 2019 +0100

    meson: drop old symbols check environment
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/meson.build b/meson.build
index 319f9783..677ff4f3 100644
--- a/meson.build
+++ b/meson.build
@@ -334,9 +334,6 @@ pkg.generate(
   description : 'Userspace interface to kernel DRM services',
 )
 
-env_test = environment()
-env_test.set('NM', find_program('nm').path())
-
 if with_libkms
   subdir('libkms')
 endif
commit dbd4320ad6dd89fee8f2e4b965e2fed17fc946f9
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:55 2019 +0100

    tegra: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/tegra/meson.build b/tegra/meson.build
index ce56ddcf..88613b9c 100644
--- a/tegra/meson.build
+++ b/tegra/meson.build
@@ -46,8 +46,11 @@ pkg.generate(
 )
 
 test(
-  'tegra-symbol-check',
-  find_program('tegra-symbol-check'),
-  env : env_test,
-  args : libdrm_tegra,
+  'tegra-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_tegra,
+    '--symbols-file', files('tegra-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
diff --git a/tegra/tegra-symbol-check b/tegra/tegra-symbol-check
deleted file mode 100755
index a74d9749..00000000
--- a/tegra/tegra-symbol-check
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first nine) are taken from tegra.h.
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_end__
-__bss_start__
-__bss_start
-__end__
-_bss_end__
-_edata
-_end
-_fini
-_init
-drm_tegra_bo_get_flags
-drm_tegra_bo_get_handle
-drm_tegra_bo_get_tiling
-drm_tegra_bo_map
-drm_tegra_bo_new
-drm_tegra_bo_ref
-drm_tegra_bo_set_flags
-drm_tegra_bo_set_tiling
-drm_tegra_bo_unmap
-drm_tegra_bo_unref
-drm_tegra_bo_wrap
-drm_tegra_close
-drm_tegra_new
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/tegra/tegra-symbols.txt b/tegra/tegra-symbols.txt
new file mode 100644
index 00000000..5e3e955f
--- /dev/null
+++ b/tegra/tegra-symbols.txt
@@ -0,0 +1,13 @@
+drm_tegra_bo_get_flags
+drm_tegra_bo_get_handle
+drm_tegra_bo_get_tiling
+drm_tegra_bo_map
+drm_tegra_bo_new
+drm_tegra_bo_ref
+drm_tegra_bo_set_flags
+drm_tegra_bo_set_tiling
+drm_tegra_bo_unmap
+drm_tegra_bo_unref
+drm_tegra_bo_wrap
+drm_tegra_close
+drm_tegra_new
commit 451e0543280c6cfcea4d9a53cb018999fe94de9c
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    radeon: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/radeon/meson.build b/radeon/meson.build
index 662b5bce..ca128329 100644
--- a/radeon/meson.build
+++ b/radeon/meson.build
@@ -57,8 +57,11 @@ pkg.generate(
 )
 
 test(
-  'radeon-symbol-check',
-  find_program('radeon-symbol-check'),
-  env : env_test,
-  args : libdrm_radeon,
+  'radeon-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_radeon,
+    '--symbols-file', files('radeon-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
diff --git a/radeon/radeon-symbol-check b/radeon/radeon-symbols.txt
old mode 100755
new mode 100644
similarity index 68%
rename from radeon/radeon-symbol-check
rename to radeon/radeon-symbols.txt
index 7b69f9a4..5a532d83
--- a/radeon/radeon-symbol-check
+++ b/radeon/radeon-symbols.txt
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBDRM_RADEON_H_FILES
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_radeon.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
 radeon_bo_debug
 radeon_bo_get_handle
 radeon_bo_get_src_domain
@@ -56,8 +42,3 @@ radeon_surface_best
 radeon_surface_init
 radeon_surface_manager_free
 radeon_surface_manager_new
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
commit 0cfa21d55ec78eafc544d502e2e52ba4a196c4ae
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    omap: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/omap/meson.build b/omap/meson.build
index f3ea36db..53330b61 100644
--- a/omap/meson.build
+++ b/omap/meson.build
@@ -47,8 +47,11 @@ pkg.generate(
 )
 
 test(
-  'omap-symbol-check',
-  find_program('omap-symbol-check'),
-  env : env_test,
-  args : libdrm_omap,
+  'omap-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_omap,
+    '--symbols-file', files('omap-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
diff --git a/omap/omap-symbol-check b/omap/omap-symbol-check
deleted file mode 100755
index 21522ba0..00000000
--- a/omap/omap-symbol-check
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.am/libdrm_omap*HEADERS
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_omap.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
-omap_bo_cpu_fini
-omap_bo_cpu_prep
-omap_bo_del
-omap_bo_dmabuf
-omap_bo_from_dmabuf
-omap_bo_from_name
-omap_bo_get_name
-omap_bo_handle
-omap_bo_map
-omap_bo_new
-omap_bo_new_tiled
-omap_bo_ref
-omap_bo_size
-omap_device_del
-omap_device_new
-omap_device_ref
-omap_get_param
-omap_set_param
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/omap/omap-symbols.txt b/omap/omap-symbols.txt
new file mode 100644
index 00000000..749d0f7c
--- /dev/null
+++ b/omap/omap-symbols.txt
@@ -0,0 +1,18 @@
+omap_bo_cpu_fini
+omap_bo_cpu_prep
+omap_bo_del
+omap_bo_dmabuf
+omap_bo_from_dmabuf
+omap_bo_from_name
+omap_bo_get_name
+omap_bo_handle
+omap_bo_map
+omap_bo_new
+omap_bo_new_tiled
+omap_bo_ref
+omap_bo_size
+omap_device_del
+omap_device_new
+omap_device_ref
+omap_get_param
+omap_set_param
commit 574778100e5a3320216120512b8adbf1ea76fd8a
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    nouveau: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/nouveau/meson.build b/nouveau/meson.build
index 56e952ca..9bd58fca 100644
--- a/nouveau/meson.build
+++ b/nouveau/meson.build
@@ -52,8 +52,11 @@ pkg.generate(
 )
 
 test(
-  'nouveau-symbol-check',
-  find_program('nouveau-symbol-check'),
-  env : env_test,
-  args : libdrm_nouveau,
+  'nouveau-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_nouveau,
+    '--symbols-file', files('nouveau-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
diff --git a/nouveau/nouveau-symbol-check b/nouveau/nouveau-symbols.txt
old mode 100755
new mode 100644
similarity index 65%
rename from nouveau/nouveau-symbol-check
rename to nouveau/nouveau-symbols.txt
index 36703a3e..ef8032f2
--- a/nouveau/nouveau-symbol-check
+++ b/nouveau/nouveau-symbols.txt
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBDRM_NOUVEAU_H_FILES
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_nouveau.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
 nouveau_bo_map
 nouveau_bo_name_get
 nouveau_bo_name_ref
@@ -53,8 +39,3 @@ nouveau_pushbuf_reloc
 nouveau_pushbuf_space
 nouveau_pushbuf_validate
 nouveau_setparam
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
commit 35fa20f1fd477b600c756dbeee1008c6a929a368
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    libkms: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/libkms/kms-symbol-check b/libkms/kms-symbol-check
deleted file mode 100755
index 7d3426f6..00000000
--- a/libkms/kms-symbol-check
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBKMS_H_FILES
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
-kms_bo_create
-kms_bo_destroy
-kms_bo_get_prop
-kms_bo_map
-kms_bo_unmap
-kms_create
-kms_destroy
-kms_get_prop
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/libkms/kms-symbols.txt b/libkms/kms-symbols.txt
new file mode 100644
index 00000000..e0ba8c91
--- /dev/null
+++ b/libkms/kms-symbols.txt
@@ -0,0 +1,8 @@
+kms_bo_create
+kms_bo_destroy
+kms_bo_get_prop
+kms_bo_map
+kms_bo_unmap
+kms_create
+kms_destroy
+kms_get_prop
diff --git a/libkms/meson.build b/libkms/meson.build
index 04f018af..216be4df 100644
--- a/libkms/meson.build
+++ b/libkms/meson.build
@@ -68,8 +68,11 @@ pkg.generate(
 )
 
 test(
-  'kms-symbol-check',
-  find_program('kms-symbol-check'),
-  env : env_test,
-  args : libkms,
+  'kms-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libkms,
+    '--symbols-file', files('kms-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
commit 1386b99027bd6af26a6149f32dc6f2e2c1476f1a
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    intel: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/intel/intel-symbol-check b/intel/intel-symbols.txt
old mode 100755
new mode 100644
similarity index 84%
rename from intel/intel-symbol-check
rename to intel/intel-symbols.txt
index 2f355321..132df96a
--- a/intel/intel-symbol-check
+++ b/intel/intel-symbols.txt
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBDRM_INTEL_H_FILES
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_intel.so} | awk '{print $3}' | while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
 drm_intel_bo_alloc
 drm_intel_bo_alloc_for_render
 drm_intel_bo_alloc_tiled
@@ -95,8 +81,3 @@ drm_intel_get_pooled_eu
 drm_intel_get_reset_stats
 drm_intel_get_subslice_total
 drm_intel_reg_read
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/intel/meson.build b/intel/meson.build
index 355bf35d..4d3f1ebd 100644
--- a/intel/meson.build
+++ b/intel/meson.build
@@ -92,9 +92,13 @@ test(
   find_program('tests/gen7-2d-copy.batch.sh'),
   workdir : meson.current_build_dir(),
 )
+
 test(
-  'intel-symbol-check',
-  find_program('intel-symbol-check'),
-  env : env_test,
-  args : libdrm_intel,
+  'intel-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_intel,
+    '--symbols-file', files('intel-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
commit 6c819350af20df1c4a0182934036faf8ad4c8b9e
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    freedreno: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/freedreno/freedreno-symbol-check b/freedreno/freedreno-symbols.txt
old mode 100755
new mode 100644
similarity index 63%
rename from freedreno/freedreno-symbol-check
rename to freedreno/freedreno-symbols.txt
index 18eb8bdc..471ca997
--- a/freedreno/freedreno-symbol-check
+++ b/freedreno/freedreno-symbols.txt
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBDRM_FREEDRENO_H_FILES
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
 fd_bo_cpu_fini
 fd_bo_cpu_prep
 fd_bo_del
@@ -57,8 +43,3 @@ fd_ringbuffer_set_parent
 fd_ringbuffer_size
 fd_ringbuffer_timestamp
 fd_ringbuffer_flush2
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/freedreno/meson.build b/freedreno/meson.build
index 5d8d8e9b..63b84fc9 100644
--- a/freedreno/meson.build
+++ b/freedreno/meson.build
@@ -70,8 +70,11 @@ pkg.generate(
 )
 
 test(
-  'freedreno-symbol-check',
-  find_program('freedreno-symbol-check'),
-  env : env_test,
-  args : libdrm_freedreno,
+  'freedreno-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_freedreno,
+    '--symbols-file', files('freedreno-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
commit 2763cd390eea8e5bda0b289acb9b40c6571d6729
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    exynos: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/exynos/exynos-symbol-check b/exynos/exynos-symbol-check
deleted file mode 100755
index d2c362e1..00000000
--- a/exynos/exynos-symbol-check
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.am/libdrm_exynos*_HEADERS
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
-exynos_bo_create
-exynos_bo_destroy
-exynos_bo_from_name
-exynos_bo_get_info
-exynos_bo_get_name
-exynos_bo_handle
-exynos_bo_map
-exynos_device_create
-exynos_device_destroy
-exynos_prime_fd_to_handle
-exynos_prime_handle_to_fd
-exynos_vidi_connection
-exynos_handle_event
-g2d_blend
-g2d_copy
-g2d_copy_with_scale
-g2d_exec
-g2d_config_event
-g2d_fini
-g2d_init
-g2d_move
-g2d_scale_and_blend
-g2d_solid_fill
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/exynos/exynos-symbols.txt b/exynos/exynos-symbols.txt
new file mode 100644
index 00000000..c6748414
--- /dev/null
+++ b/exynos/exynos-symbols.txt
@@ -0,0 +1,23 @@
+exynos_bo_create
+exynos_bo_destroy
+exynos_bo_from_name
+exynos_bo_get_info
+exynos_bo_get_name
+exynos_bo_handle
+exynos_bo_map
+exynos_device_create
+exynos_device_destroy
+exynos_prime_fd_to_handle
+exynos_prime_handle_to_fd
+exynos_vidi_connection
+exynos_handle_event
+g2d_blend
+g2d_copy
+g2d_copy_with_scale
+g2d_exec
+g2d_config_event
+g2d_fini
+g2d_init
+g2d_move
+g2d_scale_and_blend
+g2d_solid_fill
diff --git a/exynos/meson.build b/exynos/meson.build
index 0136cb2a..40d66fc1 100644
--- a/exynos/meson.build
+++ b/exynos/meson.build
@@ -47,8 +47,11 @@ pkg.generate(
 )
 
 test(
-  'exynos-symbol-check',
-  find_program('exynos-symbol-check'),
-  env : env_test,
-  args : libdrm_exynos,
+  'exynos-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_exynos,
+    '--symbols-file', files('exynos-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
commit ff832d734b91e4a9f400102d4383d16d5f0b8c46
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    etnaviv: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/etnaviv/etnaviv-symbol-check b/etnaviv/etnaviv-symbols.txt
old mode 100755
new mode 100644
similarity index 59%
rename from etnaviv/etnaviv-symbol-check
rename to etnaviv/etnaviv-symbols.txt
index b3f3dda7..f48cecea
--- a/etnaviv/etnaviv-symbol-check
+++ b/etnaviv/etnaviv-symbols.txt
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.sources/LIBDRM_ETNAVIV_H_FILES
-
-FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_etnaviv.so} | awk '{print $3}'| while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
 etna_device_new
 etna_device_new_dup
 etna_device_ref
@@ -48,8 +34,3 @@ etna_perfmon_create
 etna_perfmon_del
 etna_perfmon_get_dom_by_name
 etna_perfmon_get_sig_by_name
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/etnaviv/meson.build b/etnaviv/meson.build
index 1ecf2940..6040cf63 100644
--- a/etnaviv/meson.build
+++ b/etnaviv/meson.build
@@ -53,8 +53,11 @@ ext_libdrm_etnaviv = declare_dependency(
 )
 
 test(
-  'etnaviv-symbol-check',
-  find_program('etnaviv-symbol-check'),
-  env : env_test,
-  args : libdrm_etnaviv,
+  'etnaviv-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_etnaviv,
+    '--symbols-file', files('etnaviv-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
commit 791297e94d8863ebca351090fe6c83e09e4f4fe4
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:32:54 2019 +0100

    amdgpu: convert to new symbols check
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbols.txt
old mode 100755
new mode 100644
similarity index 80%
rename from amdgpu/amdgpu-symbol-check
rename to amdgpu/amdgpu-symbols.txt
index c5085731..e3bafaab
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-symbols.txt
@@ -1,17 +1,3 @@
-#!/bin/sh
-
-set -u
-
-# The following symbols (past the first five) are taken from the public headers.
-# A list of the latter should be available Makefile.am/libdrm_amdgpuinclude_HEADERS
-
-FUNCS=$($NM -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk '{print $3}' | while read func; do
-( grep -q "^$func$" || echo $func )  <<EOF
-__bss_start
-_edata
-_end
-_fini
-_init
 amdgpu_bo_alloc
 amdgpu_bo_cpu_map
 amdgpu_bo_cpu_unmap
@@ -86,8 +72,3 @@ amdgpu_va_range_free
 amdgpu_va_range_query
 amdgpu_vm_reserve_vmid
 amdgpu_vm_unreserve_vmid
-EOF
-done)
-
-test ! -n "$FUNCS" || echo $FUNCS
-test ! -n "$FUNCS"
diff --git a/amdgpu/meson.build b/amdgpu/meson.build
index 8168993a..a1781f59 100644
--- a/amdgpu/meson.build
+++ b/amdgpu/meson.build
@@ -58,8 +58,11 @@ ext_libdrm_amdgpu = declare_dependency(
 )
 
 test(
-  'amdgpu-symbol-check',
-  find_program('amdgpu-symbol-check'),
-  env : env_test,
-  args : libdrm_amdgpu,
+  'amdgpu-symbols-check',
+  symbols_check,
+  args : [
+    '--lib', libdrm_amdgpu,
+    '--symbols-file', files('amdgpu-symbols.txt'),
+    '--nm', prog_nm.path(),
+  ],
 )
commit 303cf6bbf3522cfba19a5950198183b75d195beb
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 22:57:51 2019 +0100

    meson: import Mesa's symbols check script
    
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/meson.build b/meson.build
index fc02f552..319f9783 100644
--- a/meson.build
+++ b/meson.build
@@ -44,6 +44,9 @@ dep_threads = dependency('threads')
 
 cc = meson.get_compiler('c')
 
+symbols_check = find_program('symbols-check.py')
+prog_nm = find_program('nm')
+
 # Check for atomics
 intel_atomics = false
 lib_atomics = false
diff --git a/symbols-check.py b/symbols-check.py
new file mode 100644
index 00000000..2e7ba68d
--- /dev/null
+++ b/symbols-check.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python3
+
+import argparse
+import os
+import platform
+import subprocess
+
+# This list contains symbols that _might_ be exported for some platforms
+PLATFORM_SYMBOLS = [
+    '__bss_end__',
+    '__bss_start__',
+    '__bss_start',
+    '__end__',
+    '_bss_end__',
+    '_edata',
+    '_end',
+    '_fini',
+    '_init',
+]
+
+
+def get_symbols(nm, lib):
+    '''
+    List all the (non platform-specific) symbols exported by the library
+    '''
+    symbols = []
+    platform_name = platform.system()
+    output = subprocess.check_output([nm, '-gP', lib],
+                                     stderr=open(os.devnull, 'w')).decode("ascii")
+    for line in output.splitlines():
+        fields = line.split()
+        if len(fields) == 2 or fields[1] == 'U':
+            continue
+        symbol_name = fields[0]
+        if platform_name == 'Linux':
+            if symbol_name in PLATFORM_SYMBOLS:
+                continue
+        elif platform_name == 'Darwin':
+            assert symbol_name[0] == '_'
+            symbol_name = symbol_name[1:]
+        symbols.append(symbol_name)
+
+    return symbols
+
+
+def main():
+    parser = argparse.ArgumentParser()
+    parser.add_argument('--symbols-file',
+                        action='store',
+                        required=True,
+                        help='path to file containing symbols')
+    parser.add_argument('--lib',
+                        action='store',
+                        required=True,
+                        help='path to library')
+    parser.add_argument('--nm',
+                        action='store',
+                        required=True,
+                        help='path to binary (or name in $PATH)')
+    args = parser.parse_args()
+
+    try:
+        lib_symbols = get_symbols(args.nm, args.lib)
+    except:
+        # We can't run this test, but we haven't technically failed it either
+        # Return the GNU "skip" error code
+        exit(77)
+    mandatory_symbols = []
+    optional_symbols = []
+    with open(args.symbols_file) as symbols_file:
+        qualifier_optional = '(optional)'
+        for line in symbols_file.readlines():
+
+            # Strip comments
+            line = line.split('#')[0]
+            line = line.strip()
+            if not line:
+                continue
+
+            # Line format:
+            # [qualifier] symbol
+            qualifier = None
+            symbol = None
+
+            fields = line.split()
+            if len(fields) == 1:
+                symbol = fields[0]
+            elif len(fields) == 2:
+                qualifier = fields[0]
+                symbol = fields[1]
+            else:
+                print(args.symbols_file + ': invalid format: ' + line)
+                exit(1)
+
+            # The only supported qualifier is 'optional', which means the
+            # symbol doesn't have to be exported by the library
+            if qualifier and not qualifier == qualifier_optional:
+                print(args.symbols_file + ': invalid qualifier: ' + qualifier)
+                exit(1)
+
+            if qualifier == qualifier_optional:
+                optional_symbols.append(symbol)
+            else:
+                mandatory_symbols.append(symbol)
+
+    unknown_symbols = []
+    for symbol in lib_symbols:
+        if symbol in mandatory_symbols:
+            continue
+        if symbol in optional_symbols:
+            continue
+        unknown_symbols.append(symbol)
+
+    missing_symbols = [
+        sym for sym in mandatory_symbols if sym not in lib_symbols
+    ]
+
+    for symbol in unknown_symbols:
+        print(args.lib + ': unknown symbol exported: ' + symbol)
+
+    for symbol in missing_symbols:
+        print(args.lib + ': missing symbol: ' + symbol)
+
+    if unknown_symbols or missing_symbols:
+        exit(1)
+    exit(0)
+
+
+if __name__ == '__main__':
+    main()
commit a7996fda4c344d21b673002f349eb79d5ec955c8
Author: Eric Engestrom <[email protected]>
Date:   Wed Oct 23 23:29:27 2019 +0100

    freedreno: drop leftover symbol from the export list
    
    Fixes: 09cbccff558988c57e52 ("freedreno: remove deprecated ringmarker API")
    Signed-off-by: Eric Engestrom <[email protected]>

diff --git a/freedreno/freedreno-symbol-check b/freedreno/freedreno-symbol-check
index 987e38fa..18eb8bdc 100755
--- a/freedreno/freedreno-symbol-check
+++ b/freedreno/freedreno-symbol-check
@@ -43,7 +43,6 @@ fd_pipe_wait
 fd_pipe_wait_timeout
 fd_ringbuffer_cmd_count
 fd_ringbuffer_del
-fd_ringbuffer_emit_reloc_ring
 fd_ringbuffer_emit_reloc_ring_full
 fd_ringbuffer_flush
 fd_ringbuffer_grow


--