Mesa (master): freedreno/rnn: rework RNN_DEF_PATH construction

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 3 20:04:24 UTC 2020


Module: Mesa
Branch: master
Commit: 24f55eb6e808cab74ff21aa809742dc644c5c900
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=24f55eb6e808cab74ff21aa809742dc644c5c900

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Aug  2 10:16:47 2020 -0700

freedreno/rnn: rework RNN_DEF_PATH construction

No need for rnn_path.h, just construct the whole thing in meson and pass
via c_args.  Also move where the path is constructed up one level.  This
will be needed for syncing back to envytools, where the path will be
different.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6154>

---

 src/freedreno/meson.build     | 4 ++++
 src/freedreno/rnn/meson.build | 5 +----
 src/freedreno/rnn/rnn.c       | 1 -
 src/freedreno/rnn/rnn_path.h  | 1 -
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/freedreno/meson.build b/src/freedreno/meson.build
index 0517c404ff4..4350aa8d526 100644
--- a/src/freedreno/meson.build
+++ b/src/freedreno/meson.build
@@ -21,6 +21,10 @@
 inc_freedreno = include_directories(['.', './registers', './common'])
 inc_freedreno_rnn = include_directories('rnn')
 
+rnn_src_path = meson.source_root() + '/src/freedreno/registers'
+rnn_install_path = get_option('datadir') + '/freedreno/registers'
+rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path
+
 subdir('common')
 subdir('registers')
 subdir('drm')
diff --git a/src/freedreno/rnn/meson.build b/src/freedreno/rnn/meson.build
index 678683a8797..4711d8f3198 100644
--- a/src/freedreno/rnn/meson.build
+++ b/src/freedreno/rnn/meson.build
@@ -27,7 +27,6 @@ libfreedreno_rnn_files = files(
   'rnn.h',
   'rnndec.c',
   'rnndec.h',
-  'rnn_path.h',
   'util.h',
 )
 
@@ -40,9 +39,7 @@ libfreedreno_rnn = static_library(
   ],
   c_args : [
     no_override_init_args,
-    '-DSOURCE_DIR="' + meson.source_root() + '"',
-# TODO how do we get install prefix??
-    '-DINSTALL_DIR=""',
+    '-DRNN_DEF_PATH="' + rnn_path + '"',
   ],
   gnu_symbol_visibility: 'hidden',
   dependencies: [ dep_libxml2 ],
diff --git a/src/freedreno/rnn/rnn.c b/src/freedreno/rnn/rnn.c
index 5c6897e40b9..d82d2a561b0 100644
--- a/src/freedreno/rnn/rnn.c
+++ b/src/freedreno/rnn/rnn.c
@@ -39,7 +39,6 @@
 #include <ctype.h>
 #include <stdio.h>
 #include "rnn.h"
-#include "rnn_path.h"
 #include "util.h"
 
 #include "util/u_debug.h"
diff --git a/src/freedreno/rnn/rnn_path.h b/src/freedreno/rnn/rnn_path.h
deleted file mode 100644
index 3582425f3f1..00000000000
--- a/src/freedreno/rnn/rnn_path.h
+++ /dev/null
@@ -1 +0,0 @@
-#define RNN_DEF_PATH SOURCE_DIR "/src/freedreno/registers:" INSTALL_DIR "share/mesa/freedreno/registers"



More information about the mesa-commit mailing list