#include "util/u_math.h"
-#include "registers/adreno_pm4.xml.h"
-#include "registers/adreno_common.xml.h"
-#include "registers/a6xx.xml.h"
+#include "adreno_pm4.xml.h"
+#include "adreno_common.xml.h"
+#include "a6xx.xml.h"
#include "main.h"
#include "ir3_asm.h"
#include "drm/freedreno_drmif.h"
#include "drm/freedreno_ringbuffer.h"
-#include "registers/adreno_pm4.xml.h"
-#include "registers/adreno_common.xml.h"
+#include "adreno_pm4.xml.h"
+#include "adreno_common.xml.h"
#define MAX_BUFS 4
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-inc_freedreno = include_directories(['.', './registers', './common'])
+inc_freedreno = include_directories(['.', './registers', './registers/adreno', './common'])
inc_freedreno_rnn = include_directories('rnn')
rnn_src_path = meson.source_root() + '/src/freedreno/registers'
--- /dev/null
+# Copyright © 2019 Google, Inc
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+xml_files = [
+ 'a2xx.xml',
+ 'a3xx.xml',
+ 'a4xx.xml',
+ 'a5xx.xml',
+ 'a6xx.xml',
+ 'adreno_common.xml',
+ 'adreno_pm4.xml',
+]
+
+foreach f : xml_files
+ _name = f + '.h'
+ freedreno_xml_header_files += custom_target(
+ _name,
+ input: [gen_header_py, f],
+ output: _name,
+ command: [prog_python, '@INPUT0@', rnn_src_path, '@INPUT1@'],
+ capture: true,
+ )
+endforeach
+
+freedreno_xml_header_files += custom_target(
+ 'a6xx-pack.xml.h',
+ input: [gen_header_py, 'a6xx.xml'],
+ output: 'a6xx-pack.xml.h',
+ command: [prog_python, '@INPUT0@', rnn_src_path, '@INPUT1@', '--pack-structs'],
+ capture: true,
+)
+
+freedreno_xml_header_files += custom_target(
+ 'adreno-pm4-pack.xml.h',
+ input: [gen_header_py, 'adreno_pm4.xml'],
+ output: 'adreno-pm4-pack.xml.h',
+ command: [prog_python, '@INPUT0@', rnn_src_path, '@INPUT1@', '--pack-structs'],
+ capture: true,
+)
raise self.error(e);
def do_parse(self, filename):
- try:
- file = open(filename, "rb")
- except FileNotFoundError as e:
- # Look for the file in the parent directory if not
- # found in same directory:
- path = os.path.dirname(filename)
- base = os.path.basename(filename)
- file = open(path + "/../" + base, "rb")
+ file = open(filename, "rb")
parser = xml.parsers.expat.ParserCreate()
self.stack.append((parser, filename))
parser.StartElementHandler = self.start_element
self.stack.pop()
file.close()
- def parse(self, filename):
- self.path = os.path.dirname(filename)
+ def parse(self, rnn_path, filename):
+ self.path = rnn_path
self.stack = []
self.do_parse(filename)
def start_element(self, name, attrs):
if name == "import":
- filename = os.path.basename(attrs["file"])
+ filename = attrs["file"]
self.do_parse(os.path.join(self.path, filename))
elif name == "domain":
self.current_domain = attrs["name"]
def main():
p = Parser()
- xml_file = sys.argv[1]
- if len(sys.argv) > 2 and sys.argv[2] == '--pack-structs':
+ rnn_path = sys.argv[1]
+ xml_file = sys.argv[2]
+ if len(sys.argv) > 3 and sys.argv[3] == '--pack-structs':
do_structs = True
guard = str.replace(os.path.basename(xml_file), '.', '_').upper() + '_STRUCTS'
else:
print("#ifndef %s\n#define %s\n" % (guard, guard))
try:
- p.parse(xml_file)
+ p.parse(rnn_path, xml_file)
except Error as e:
print(e)
exit(1)
# SOFTWARE.
xml_files = [
- 'a2xx.xml',
- 'a3xx.xml',
- 'a4xx.xml',
- 'a5xx.xml',
- 'a6xx.xml',
- 'adreno_common.xml',
- 'adreno_pm4.xml',
+ 'adreno.xml',
]
+gen_header_py = files('gen_header.py')
+
freedreno_xml_header_files = []
+
foreach f : xml_files
_name = f + '.h'
freedreno_xml_header_files += custom_target(
_name,
- input : ['gen_header.py', 'adreno/' + f],
- output : _name,
- command : [prog_python, '@INPUT@'],
- capture : true,
+ input: [gen_header_py, f],
+ output: _name,
+ command: [prog_python, '@INPUT0@', rnn_src_path, '@INPUT1@'],
+ capture: true,
)
endforeach
-freedreno_xml_header_files += custom_target(
- 'a6xx-pack.xml.h',
- input : ['gen_header.py', 'adreno/a6xx.xml'],
- output : 'a6xx-pack.xml.h',
- command : [prog_python, '@INPUT@', '--pack-structs'],
- capture : true,
- )
-freedreno_xml_header_files += custom_target(
- 'adreno-pm4-pack.xml.h',
- input : ['gen_header.py', 'adreno/adreno_pm4.xml'],
- output : 'adreno-pm4-pack.xml.h',
- command : [prog_python, '@INPUT@', '--pack-structs'],
- capture : true,
- )
+subdir('adreno')
#include "tu_private.h"
-#include "registers/adreno_pm4.xml.h"
-#include "registers/adreno_common.xml.h"
+#include "adreno_pm4.xml.h"
+#include "adreno_common.xml.h"
#include "vk_format.h"
#include "tu_private.h"
-#include "registers/adreno_pm4.xml.h"
+#include "adreno_pm4.xml.h"
void
tu_cs_init(struct tu_cs *cs,
#include "tu_private.h"
-#include "registers/adreno_common.xml.h"
-#include "registers/a6xx.xml.h"
+#include "adreno_common.xml.h"
+#include "a6xx.xml.h"
#include "vk_format.h"
#include "vk_util.h"
#include <string.h>
#include <unistd.h>
-#include "registers/adreno_pm4.xml.h"
-#include "registers/adreno_common.xml.h"
-#include "registers/a6xx.xml.h"
+#include "adreno_pm4.xml.h"
+#include "adreno_common.xml.h"
+#include "a6xx.xml.h"
#include "nir/nir_builder.h"
#include "util/os_time.h"