amd/common,radeonsi: Move gfx10_format_table to common.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 1 Jun 2020 21:49:22 +0000 (23:49 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 3 Jun 2020 00:17:00 +0000 (00:17 +0000)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5291>

src/amd/Android.common.mk
src/amd/Makefile.sources
src/amd/common/gfx10_format_table.py [moved from src/gallium/drivers/radeonsi/gfx10_format_table.py with 99% similarity]
src/amd/common/meson.build
src/gallium/drivers/radeonsi/Android.mk
src/gallium/drivers/radeonsi/Makefile.sources
src/gallium/drivers/radeonsi/meson.build
src/gallium/drivers/radeonsi/si_state.c

index 416bae1..7abbd37 100644 (file)
@@ -69,6 +69,20 @@ $(intermediates)/common/amdgfxregs.h: $(AMDGFXREGS) $(AMDGFXREGS_INPUTS)
        @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
        $(hide) $(MESA_PYTHON2) $(AMDGFXREGS) $(AMDGFXREGS_INPUTS) --sort address --guard AMDGFXREGS_H > $@ || ($(RM) $@; false)
 
+GEN10_FORMAT_TABLE_INPUTS := \
+       $(MESA_TOP)/src/util/format/u_format.csv \
+       $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
+
+GEN10_FORMAT_TABLE_DEP := \
+       $(MESA_TOP)/src/amd/registers/regdb.py
+
+GEN10_FORMAT_TABLE := $(LOCAL_PATH)/common/gfx10_format_table.py
+
+$(intermediates)/common/gfx10_format_table.h: $(GEN10_FORMAT_TABLE) $(GEN10_FORMAT_TABLE_INPUTS) $(GEN10_FORMAT_TABLE_DEP)
+       @mkdir -p $(dir $@)
+       @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+       $(hide) $(MESA_PYTHON2) $(GEN10_FORMAT_TABLE) $(GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
+
 LOCAL_C_INCLUDES := \
        $(MESA_TOP)/include \
        $(MESA_TOP)/src \
index 04d4d7d..ce914e0 100644 (file)
@@ -69,6 +69,7 @@ AMD_DEBUG_FILES = \
 
 AMD_GENERATED_FILES = \
        common/amdgfxregs.h \
+       common/gfx10_format_table.h \
        common/sid_tables.h
 
 ACO_FILES = \
similarity index 99%
rename from src/gallium/drivers/radeonsi/gfx10_format_table.py
rename to src/amd/common/gfx10_format_table.py
index 7a67622..43a878b 100644 (file)
@@ -33,8 +33,8 @@ import os
 import re
 import sys
 
-AMD_REGISTERS = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../../../amd/registers"))
-UTIL_FORMAT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../../../util/format"))
+AMD_REGISTERS = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../registers"))
+UTIL_FORMAT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../../util/format"))
 sys.path.extend([AMD_REGISTERS, UTIL_FORMAT])
 
 from regdb import Object, RegisterDatabase
index 739428b..a1ce30f 100644 (file)
@@ -36,6 +36,18 @@ amdgfxregs_h = custom_target(
   capture : true,
 )
 
+gfx10_format_table_h = custom_target(
+  'gfx10_format_table.h',
+  input : files(
+    'gfx10_format_table.py',
+    '../../util/format/u_format.csv', '../registers/gfx10-rsrc.json'
+  ),
+  output : 'gfx10_format_table.h',
+  command : [prog_python, '@INPUT@'],
+  capture : true,
+  depend_files : ['../registers/regdb.py']
+)
+
 amd_common_files = files(
   'ac_binary.c',
   'ac_binary.h',
@@ -56,7 +68,7 @@ amd_common_files = files(
 
 libamd_common = static_library(
   'amd_common',
-  [amd_common_files, sid_tables_h, amdgfxregs_h],
+  [amd_common_files, sid_tables_h, amdgfxregs_h, gfx10_format_table_h],
   include_directories : [
     inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_compiler, inc_mapi, inc_amd,
   ],
index bbee933..6ced1b4 100644 (file)
@@ -66,20 +66,6 @@ $(intermediates)/radeonsi/si_driinfo.h: $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
        @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
        $(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || ($(RM) $@; false)
 
-GEN10_FORMAT_TABLE_INPUTS := \
-       $(MESA_TOP)/src/util/format/u_format.csv \
-       $(MESA_TOP)/src/amd/registers/gfx10-rsrc.json
-
-GEN10_FORMAT_TABLE_DEP := \
-       $(MESA_TOP)/src/amd/registers/regdb.py
-
-GEN10_FORMAT_TABLE := $(LOCAL_PATH)/gfx10_format_table.py
-
-$(intermediates)/radeonsi/gfx10_format_table.h: $(GEN10_FORMAT_TABLE) $(GEN10_FORMAT_TABLE_INPUTS) $(GEN10_FORMAT_TABLE_DEP)
-       @mkdir -p $(dir $@)
-       @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
-       $(hide) $(MESA_PYTHON2) $(GEN10_FORMAT_TABLE) $(GEN10_FORMAT_TABLE_INPUTS) > $@ || ($(RM) $@; false)
-
 LOCAL_C_INCLUDES += $(intermediates)/radeonsi
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)
index 6827818..f34368c 100644 (file)
@@ -1,5 +1,4 @@
 GENERATED_SOURCES := \
-       gfx10_format_table.h \
        si_driinfo.h
 
 C_SOURCES := \
index 4f6ea13..1164a97 100644 (file)
@@ -103,21 +103,9 @@ si_driinfo_h = custom_target(
   capture : true,
 )
 
-gfx10_format_table_h = custom_target(
-  'gfx10_format_table.h',
-  input : files(
-    'gfx10_format_table.py',
-    '../../../util/format/u_format.csv', '../../../amd/registers/gfx10-rsrc.json'
-  ),
-  output : 'gfx10_format_table.h',
-  command : [prog_python, '@INPUT@'],
-  capture : true,
-  depend_files : ['../../../amd/registers/regdb.py']
-)
-
 libradeonsi = static_library(
   'radeonsi',
-  [files_libradeonsi, si_driinfo_h, sid_tables_h, gfx10_format_table_h],
+  [files_libradeonsi, si_driinfo_h, sid_tables_h],
   include_directories : [
     inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_amd_common, inc_amd_common_llvm,
     inc_gallium_drivers,
index f17e8b5..4705423 100644 (file)
@@ -42,7 +42,7 @@ struct gfx10_format {
    bool buffers_only : 1;
 };
 
-#include "gfx10_format_table.h"
+#include "amd/common/gfx10_format_table.h"
 
 static unsigned si_map_swizzle(unsigned swizzle)
 {