amd/common,radeonsi: Move gfx10_format_table to common.

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>
This commit is contained in:
Bas Nieuwenhuizen 2020-06-01 23:49:22 +02:00 committed by Marge Bot
parent d936f69677
commit c98e52f88a
8 changed files with 32 additions and 32 deletions

View file

@ -69,6 +69,20 @@ $(intermediates)/common/amdgfxregs.h: $(AMDGFXREGS) $(AMDGFXREGS_INPUTS)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(MESA_PYTHON2) $(AMDGFXREGS) $(AMDGFXREGS_INPUTS) --sort address --guard AMDGFXREGS_H > $@ || ($(RM) $@; false) $(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 := \ LOCAL_C_INCLUDES := \
$(MESA_TOP)/include \ $(MESA_TOP)/include \
$(MESA_TOP)/src \ $(MESA_TOP)/src \

View file

@ -69,6 +69,7 @@ AMD_DEBUG_FILES = \
AMD_GENERATED_FILES = \ AMD_GENERATED_FILES = \
common/amdgfxregs.h \ common/amdgfxregs.h \
common/gfx10_format_table.h \
common/sid_tables.h common/sid_tables.h
ACO_FILES = \ ACO_FILES = \

View file

@ -33,8 +33,8 @@ import os
import re import re
import sys import sys
AMD_REGISTERS = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../../../amd/registers")) 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")) UTIL_FORMAT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "../../util/format"))
sys.path.extend([AMD_REGISTERS, UTIL_FORMAT]) sys.path.extend([AMD_REGISTERS, UTIL_FORMAT])
from regdb import Object, RegisterDatabase from regdb import Object, RegisterDatabase

View file

@ -36,6 +36,18 @@ amdgfxregs_h = custom_target(
capture : true, 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( amd_common_files = files(
'ac_binary.c', 'ac_binary.c',
'ac_binary.h', 'ac_binary.h',
@ -56,7 +68,7 @@ amd_common_files = files(
libamd_common = static_library( libamd_common = static_library(
'amd_common', 'amd_common',
[amd_common_files, sid_tables_h, amdgfxregs_h], [amd_common_files, sid_tables_h, amdgfxregs_h, gfx10_format_table_h],
include_directories : [ include_directories : [
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_compiler, inc_mapi, inc_amd, inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_compiler, inc_mapi, inc_amd,
], ],

View file

@ -66,20 +66,6 @@ $(intermediates)/radeonsi/si_driinfo.h: $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
@echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))" @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
$(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || ($(RM) $@; false) $(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_C_INCLUDES += $(intermediates)/radeonsi
LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates) LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)

View file

@ -1,5 +1,4 @@
GENERATED_SOURCES := \ GENERATED_SOURCES := \
gfx10_format_table.h \
si_driinfo.h si_driinfo.h
C_SOURCES := \ C_SOURCES := \

View file

@ -103,21 +103,9 @@ si_driinfo_h = custom_target(
capture : true, 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( libradeonsi = static_library(
'radeonsi', 'radeonsi',
[files_libradeonsi, si_driinfo_h, sid_tables_h, gfx10_format_table_h], [files_libradeonsi, si_driinfo_h, sid_tables_h],
include_directories : [ include_directories : [
inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_amd_common, inc_amd_common_llvm, inc_src, inc_include, inc_gallium, inc_gallium_aux, inc_amd_common, inc_amd_common_llvm,
inc_gallium_drivers, inc_gallium_drivers,

View file

@ -42,7 +42,7 @@ struct gfx10_format {
bool buffers_only : 1; bool buffers_only : 1;
}; };
#include "gfx10_format_table.h" #include "amd/common/gfx10_format_table.h"
static unsigned si_map_swizzle(unsigned swizzle) static unsigned si_map_swizzle(unsigned swizzle)
{ {