Mesa (master): freedreno: move a2xx disasm out of gallium

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 28 10:04:38 UTC 2020


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

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Jul 26 09:44:01 2020 -0700

freedreno: move a2xx disasm out of gallium

So that it can be reused by the decode tools.

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

---

 .gitlab-ci/test-source-dep.yml                     |  1 +
 .../freedreno/a2xx => freedreno/ir2}/disasm-a2xx.c |  3 ++
 .../freedreno/a2xx => freedreno/ir2}/instr-a2xx.h  |  0
 src/freedreno/ir2/meson.build                      | 37 ++++++++++++++++++++++
 src/freedreno/meson.build                          |  1 +
 src/gallium/drivers/freedreno/a2xx/fd2_gmem.c      |  2 +-
 src/gallium/drivers/freedreno/a2xx/fd2_program.c   |  2 +-
 src/gallium/drivers/freedreno/a2xx/ir2_private.h   |  2 +-
 src/gallium/drivers/freedreno/meson.build          |  4 +--
 9 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml
index 23561445a53..6a006b8d6c3 100644
--- a/.gitlab-ci/test-source-dep.yml
+++ b/.gitlab-ci/test-source-dep.yml
@@ -96,6 +96,7 @@
       - src/freedreno/common/**/*
       - src/freedreno/drm/**/*
       - src/freedreno/fdl/**/*
+      - src/freedreno/ir2/**/*
       - src/freedreno/ir3/**/*
       - src/freedreno/perfcntrs/**/*
       - src/freedreno/registers/**/*
diff --git a/src/gallium/drivers/freedreno/a2xx/disasm-a2xx.c b/src/freedreno/ir2/disasm-a2xx.c
similarity index 99%
rename from src/gallium/drivers/freedreno/a2xx/disasm-a2xx.c
rename to src/freedreno/ir2/disasm-a2xx.c
index 43c6333fb56..36567093663 100644
--- a/src/gallium/drivers/freedreno/a2xx/disasm-a2xx.c
+++ b/src/freedreno/ir2/disasm-a2xx.c
@@ -425,6 +425,9 @@ static void print_fetch_tex(instr_fetch_t *fetch)
 		printf(" LOD(%u)", tex->use_comp_lod);
 		printf(" LOD_BIAS(%u)", tex->lod_bias);
 	}
+	if (tex->use_reg_lod) {
+		printf(" REG_LOD(%u)", tex->use_reg_lod);
+	}
 	if (tex->use_reg_gradients)
 		printf(" USE_REG_GRADIENTS");
 	printf(" LOCATION(%s)", sample_loc[tex->sample_location]);
diff --git a/src/gallium/drivers/freedreno/a2xx/instr-a2xx.h b/src/freedreno/ir2/instr-a2xx.h
similarity index 100%
rename from src/gallium/drivers/freedreno/a2xx/instr-a2xx.h
rename to src/freedreno/ir2/instr-a2xx.h
diff --git a/src/freedreno/ir2/meson.build b/src/freedreno/ir2/meson.build
new file mode 100644
index 00000000000..d56326bfebe
--- /dev/null
+++ b/src/freedreno/ir2/meson.build
@@ -0,0 +1,37 @@
+# Copyright © 2020 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.
+
+libfreedreno_ir2 = static_library(
+  'freedreno_ir2',
+  [
+    'disasm-a2xx.c',
+    'instr-a2xx.h',
+    freedreno_xml_header_files,
+  ],
+  include_directories : [
+    inc_freedreno,
+    inc_include,
+    inc_src,
+  ],
+  c_args : [no_override_init_args],
+  gnu_symbol_visibility : 'hidden',
+  dependencies : [],
+  build_by_default : false,
+)
diff --git a/src/freedreno/meson.build b/src/freedreno/meson.build
index 6a1a16ea84a..0517c404ff4 100644
--- a/src/freedreno/meson.build
+++ b/src/freedreno/meson.build
@@ -24,6 +24,7 @@ inc_freedreno_rnn = include_directories('rnn')
 subdir('common')
 subdir('registers')
 subdir('drm')
+subdir('ir2')
 subdir('ir3')
 subdir('fdl')
 subdir('perfcntrs')
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
index b9b68971320..f61f5db22a8 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_gmem.c
@@ -40,7 +40,7 @@
 #include "fd2_util.h"
 #include "fd2_zsa.h"
 #include "fd2_draw.h"
-#include "instr-a2xx.h"
+#include "ir2/instr-a2xx.h"
 
 static uint32_t fmt2swap(enum pipe_format format)
 {
diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_program.c b/src/gallium/drivers/freedreno/a2xx/fd2_program.c
index 7d40e8c99b3..33ea965a3df 100644
--- a/src/gallium/drivers/freedreno/a2xx/fd2_program.c
+++ b/src/gallium/drivers/freedreno/a2xx/fd2_program.c
@@ -40,7 +40,7 @@
 #include "fd2_program.h"
 #include "fd2_texture.h"
 #include "fd2_util.h"
-#include "instr-a2xx.h"
+#include "ir2/instr-a2xx.h"
 
 static struct fd2_shader_stateobj *
 create_shader(struct pipe_context *pctx, gl_shader_stage type)
diff --git a/src/gallium/drivers/freedreno/a2xx/ir2_private.h b/src/gallium/drivers/freedreno/a2xx/ir2_private.h
index 5f71731aa4c..3b856bffa0c 100644
--- a/src/gallium/drivers/freedreno/a2xx/ir2_private.h
+++ b/src/gallium/drivers/freedreno/a2xx/ir2_private.h
@@ -32,7 +32,7 @@
 
 #include "ir2.h"
 #include "fd2_program.h"
-#include "instr-a2xx.h"
+#include "ir2/instr-a2xx.h"
 
 enum ir2_src_type {
 	IR2_SRC_SSA,
diff --git a/src/gallium/drivers/freedreno/meson.build b/src/gallium/drivers/freedreno/meson.build
index 8179e78ffc5..1455f5a329d 100644
--- a/src/gallium/drivers/freedreno/meson.build
+++ b/src/gallium/drivers/freedreno/meson.build
@@ -57,7 +57,6 @@ files_libfreedreno = files(
   'freedreno_texture.h',
   'freedreno_util.c',
   'freedreno_util.h',
-  'a2xx/disasm-a2xx.c',
   'a2xx/fd2_blend.c',
   'a2xx/fd2_blend.h',
   'a2xx/fd2_context.c',
@@ -84,7 +83,6 @@ files_libfreedreno = files(
   'a2xx/fd2_util.h',
   'a2xx/fd2_zsa.c',
   'a2xx/fd2_zsa.h',
-  'a2xx/instr-a2xx.h',
   'a2xx/ir2.c',
   'a2xx/ir2.h',
   'a2xx/ir2_assemble.c',
@@ -251,6 +249,7 @@ driver_freedreno = declare_dependency(
     libfreedrenowinsys,
     libfreedreno,
     libfreedreno_drm,
+    libfreedreno_ir2,
     libfreedreno_ir3,
     libfreedreno_layout,
     libfreedreno_perfcntrs
@@ -289,6 +288,7 @@ gmemtool = executable(
   link_with : [
     libfreedreno,
     libfreedreno_drm,
+    libfreedreno_ir2,
     libfreedreno_ir3,
     libfreedreno_layout,
     libgallium,



More information about the mesa-commit mailing list