From c98e52f88a1b24b33b4e8b95f80cf5dbbe6d2d66 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Mon, 1 Jun 2020 23:49:22 +0200 Subject: [PATCH] amd/common,radeonsi: Move gfx10_format_table to common. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/Android.common.mk | 14 ++++++++++++++ src/amd/Makefile.sources | 1 + .../radeonsi => amd/common}/gfx10_format_table.py | 4 ++-- src/amd/common/meson.build | 14 +++++++++++++- src/gallium/drivers/radeonsi/Android.mk | 14 -------------- src/gallium/drivers/radeonsi/Makefile.sources | 1 - src/gallium/drivers/radeonsi/meson.build | 14 +------------- src/gallium/drivers/radeonsi/si_state.c | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) rename src/{gallium/drivers/radeonsi => amd/common}/gfx10_format_table.py (99%) diff --git a/src/amd/Android.common.mk b/src/amd/Android.common.mk index 416bae107fa..7abbd378b38 100644 --- a/src/amd/Android.common.mk +++ b/src/amd/Android.common.mk @@ -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 \ diff --git a/src/amd/Makefile.sources b/src/amd/Makefile.sources index 04d4d7dd848..ce914e0aa85 100644 --- a/src/amd/Makefile.sources +++ b/src/amd/Makefile.sources @@ -69,6 +69,7 @@ AMD_DEBUG_FILES = \ AMD_GENERATED_FILES = \ common/amdgfxregs.h \ + common/gfx10_format_table.h \ common/sid_tables.h ACO_FILES = \ diff --git a/src/gallium/drivers/radeonsi/gfx10_format_table.py b/src/amd/common/gfx10_format_table.py similarity index 99% rename from src/gallium/drivers/radeonsi/gfx10_format_table.py rename to src/amd/common/gfx10_format_table.py index 7a6762287df..43a878bd856 100644 --- a/src/gallium/drivers/radeonsi/gfx10_format_table.py +++ b/src/amd/common/gfx10_format_table.py @@ -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 diff --git a/src/amd/common/meson.build b/src/amd/common/meson.build index 739428baec0..a1ce30f39f5 100644 --- a/src/amd/common/meson.build +++ b/src/amd/common/meson.build @@ -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, ], diff --git a/src/gallium/drivers/radeonsi/Android.mk b/src/gallium/drivers/radeonsi/Android.mk index bbee9336065..6ced1b4caa9 100644 --- a/src/gallium/drivers/radeonsi/Android.mk +++ b/src/gallium/drivers/radeonsi/Android.mk @@ -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) diff --git a/src/gallium/drivers/radeonsi/Makefile.sources b/src/gallium/drivers/radeonsi/Makefile.sources index 68278186278..f34368c1993 100644 --- a/src/gallium/drivers/radeonsi/Makefile.sources +++ b/src/gallium/drivers/radeonsi/Makefile.sources @@ -1,5 +1,4 @@ GENERATED_SOURCES := \ - gfx10_format_table.h \ si_driinfo.h C_SOURCES := \ diff --git a/src/gallium/drivers/radeonsi/meson.build b/src/gallium/drivers/radeonsi/meson.build index 4f6ea1315c8..1164a97fa9a 100644 --- a/src/gallium/drivers/radeonsi/meson.build +++ b/src/gallium/drivers/radeonsi/meson.build @@ -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, diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index f17e8b57a13..470542354eb 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -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) { -- 2.30.2