intel/decoder: Move decoder to a separate module

Depends on both intel/common and intel/compiler.  Breaks circular
dependency between these two modules.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27647>
This commit is contained in:
Caio Oliveira
2024-01-25 10:50:59 -08:00
committed by Marge Bot
parent 7009f00ae0
commit 805d45e916
21 changed files with 116 additions and 62 deletions

View File

@@ -30,7 +30,7 @@
#include "util/u_dynarray.h"
#include "common/intel_decoder.h"
#include "decoder/intel_decoder.h"
#include "drm-uapi/i915_drm.h"
#include "crocus_fence.h"

View File

@@ -80,7 +80,11 @@ libcrocus = static_library(
c_args : [sse2_args],
cpp_args : [sse2_args],
gnu_symbol_visibility : 'hidden',
dependencies : [dep_libdrm, dep_valgrind, idep_genxml, idep_libintel_common, idep_nir_headers, idep_intel_dev, idep_intel_blorp],
dependencies : [
dep_libdrm, dep_valgrind, idep_genxml,
idep_libintel_common, idep_nir_headers,
idep_intel_dev, idep_intel_blorp, idep_intel_decoder,
],
link_with : [
crocus_per_hw_ver_libs, libintel_compiler, libisl,
libintel_perf

View File

@@ -31,7 +31,7 @@
#include "util/u_dynarray.h"
#include "util/perf/u_trace.h"
#include "common/intel_decoder.h"
#include "decoder/intel_decoder.h"
#include "ds/intel_driver_ds.h"
#include "ds/intel_tracepoints.h"

View File

@@ -101,7 +101,7 @@ libiris = static_library(
gnu_symbol_visibility : 'hidden',
dependencies : [dep_libdrm, dep_valgrind, idep_genxml, idep_nir_headers,
idep_libintel_common, idep_intel_driver_ds, idep_intel_dev,
idep_intel_blorp],
idep_intel_blorp, idep_intel_decoder],
link_with : [
iris_per_hw_ver_libs, libintel_compiler, libisl,
libintel_perf

View File

@@ -36,7 +36,6 @@ files_libintel_common = files(
'intel_bind_timeline.c',
'intel_bind_timeline.h',
'intel_buffer_alloc.h',
'intel_decoder.h',
'intel_engine.c',
'intel_engine.h',
'intel_gem.c',
@@ -58,11 +57,6 @@ files_libintel_common = files(
'intel_pixel_hash.h'
)
files_batch_decoder = files(
'intel_batch_decoder.c',
'intel_decoder.c',
)
libintel_common_links = [libisl]
if with_clflushopt
@@ -76,14 +70,6 @@ if with_clflushopt
libintel_common_links += libintel_clflushopt
endif
batch_decoder_dependencies = []
if not dep_expat.found()
files_libintel_common += 'intel_batch_decoder_stub.c'
else
batch_decoder_dependencies += dep_expat
files_libintel_common += files_batch_decoder
endif
libintel_common = static_library(
'intel_common',
[files_libintel_common, genX_xml_h, sha1_h],
@@ -91,7 +77,7 @@ libintel_common = static_library(
c_args : [no_override_init_args, sse2_args],
gnu_symbol_visibility : 'hidden',
link_with : libintel_common_links,
dependencies : [batch_decoder_dependencies, dep_libdrm, dep_thread, idep_genxml, idep_mesautil, idep_intel_dev],
dependencies : [dep_libdrm, dep_thread, idep_genxml, idep_mesautil, idep_intel_dev],
)
libintel_extra_dependencies = []
@@ -110,37 +96,6 @@ if install_intel_gpu_tests and not with_tests
endif
if with_tests and not with_platform_android
gentest_xml = files('tests/gentest.xml')
_name = 'gentest_pack.h'
gentest_pack = custom_target(
_name,
input : [gen_pack_header_py, gentest_xml],
output : _name,
command : [prog_python, '@INPUT@'],
capture : true,
depend_files: gen_pack_header_deps
)
genxml_path = join_paths(dir_source_root,
'@0@'.format(gentest_xml[0]))
test(
'genxml_test',
executable(
'genxml_test',
['tests/genxml_test.c', gentest_pack],
include_directories : [inc_include, inc_src, inc_intel],
dependencies : [idep_mesautil, idep_intel_dev, idep_genxml],
link_with : libintel_common,
c_args : [
'-DGENXML_DIR="@0@"'.format(fs.parent(genxml_path)),
'-DGENXML_FILE="@0@"'.format(fs.name(genxml_path)),
],
),
args : ['-quiet'],
suite : ['intel'],
)
foreach g : [['70', 'gfx7'], ['75', 'hsw'], ['80', 'gfx8'],
['90', 'gfx9'], ['110', 'gfx11'], ['120', 'gfx12'],
['125', 'gfx125']]

View File

@@ -21,7 +21,8 @@
* IN THE SOFTWARE.
*/
#include "common/intel_decoder.h"
#include "intel_decoder.h"
#include "compiler/brw_disasm.h"
#include "util/macros.h"
#include "util/u_debug.h"

View File

@@ -21,7 +21,7 @@
* IN THE SOFTWARE.
*/
#include "common/intel_decoder.h"
#include "intel_decoder.h"
#include "util/log.h"
void

View File

@@ -0,0 +1,79 @@
# Copyright © 2017 Intel Corporation
# SPDX-License-Identifier: MIT
libintel_decoder_files = files(
'intel_decoder.h',
)
libintel_decoder_deps = [
idep_intel_dev
]
if not dep_expat.found()
libintel_decoder_files += files(
'intel_batch_decoder_stub.c',
)
else
libintel_decoder_deps += dep_expat
libintel_decoder_files += files(
'intel_decoder.c',
'intel_batch_decoder.c',
)
endif
libintel_decoder = static_library(
'intel_decoder',
[libintel_decoder_files, genX_xml_h, sha1_h],
include_directories : [inc_include, inc_src, inc_intel],
c_args : [no_override_init_args, sse2_args],
gnu_symbol_visibility : 'hidden',
dependencies : libintel_decoder_deps,
)
idep_intel_decoder = declare_dependency(
link_with : [libintel_decoder],
dependencies : libintel_decoder_deps,
)
if with_tests and not with_platform_android
gentest_xml = files('tests/gentest.xml')
_name = 'gentest_pack.h'
gentest_pack = custom_target(
_name,
input : [gen_pack_header_py, gentest_xml],
output : _name,
command : [prog_python, '@INPUT@'],
capture : true,
depend_files: gen_pack_header_deps
)
genxml_path = join_paths(dir_source_root,
'@0@'.format(gentest_xml[0]))
test(
'genxml_test',
executable(
'genxml_test',
['tests/genxml_test.c', gentest_pack],
include_directories : [
inc_include,
inc_src,
inc_intel
],
dependencies : [
idep_libintel_common,
idep_intel_decoder,
idep_mesautil,
idep_intel_dev,
idep_genxml,
],
c_args : [
'-DGENXML_DIR="@0@"'.format(fs.parent(genxml_path)),
'-DGENXML_FILE="@0@"'.format(fs.name(genxml_path)),
],
),
args : ['-quiet'],
suite : ['intel'],
)
endif

View File

@@ -28,6 +28,7 @@ endif
subdir('isl')
subdir('common')
subdir('compiler')
subdir('decoder')
subdir('shaders')
if with_intel_hasvk or with_intel_vk or with_gallium_crocus or with_gallium_iris or with_intel_tools
subdir('perf')

View File

@@ -30,8 +30,8 @@
#include "util/list.h"
#include "util/rb_tree.h"
#include "decoder/intel_decoder.h"
#include "dev/intel_device_info.h"
#include "common/intel_decoder.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -38,8 +38,8 @@
#include <getopt.h>
#include <zlib.h>
#include "common/intel_decoder.h"
#include "compiler/brw_compiler.h"
#include "decoder/intel_decoder.h"
#include "dev/intel_debug.h"
#include "util/macros.h"

View File

@@ -3,8 +3,8 @@
#include "imgui/imgui.h"
#include "common/intel_decoder.h"
#include "compiler/brw_disasm.h"
#include "decoder/intel_decoder.h"
struct aub_viewer_cfg {
ImColor clear_color;

View File

@@ -22,7 +22,7 @@ libaub = static_library(
'aub',
files('aub_read.c', 'aub_mem.c'),
include_directories : [inc_include, inc_src, inc_intel],
dependencies : [idep_mesautil, idep_intel_dev],
dependencies : [idep_mesautil, idep_intel_dev, idep_intel_decoder],
link_with : [libintel_common],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
@@ -32,7 +32,7 @@ libaub = static_library(
aubinator = executable(
'aubinator',
files('aubinator.c'),
dependencies : [idep_mesautil, dep_expat, dep_zlib, dep_dl, dep_thread, dep_m, idep_intel_dev],
dependencies : [idep_mesautil, dep_expat, dep_zlib, dep_dl, dep_thread, dep_m, idep_intel_dev, idep_intel_decoder],
include_directories : [inc_include, inc_src, inc_intel],
link_with : [libintel_common, libintel_compiler, libaub],
c_args : [no_override_init_args],
@@ -43,7 +43,7 @@ aubinator = executable(
aubinator_error_decode = executable(
'aubinator_error_decode',
files('aubinator_error_decode.c'),
dependencies : [idep_mesautil, dep_zlib, dep_thread, idep_intel_dev],
dependencies : [idep_mesautil, dep_zlib, dep_thread, idep_intel_dev, idep_intel_decoder],
include_directories : [inc_include, inc_src, inc_intel],
link_with : [libintel_common, libintel_compiler],
c_args : [no_override_init_args],
@@ -171,9 +171,19 @@ if with_tools.contains('intel-ui')
intel_hang_viewer = executable(
'intel_hang_viewer',
files('intel_hang_viewer.cpp', 'aubinator_viewer_decoder.cpp'),
dependencies : [idep_mesautil, dep_zlib, dep_dl, dep_thread, dep_m, libintel_imgui_gtk_dep, idep_intel_dev],
dependencies : [
idep_mesautil,
dep_zlib,
dep_dl,
dep_thread,
dep_m,
libintel_imgui_gtk_dep,
idep_intel_dev,
idep_libintel_common,
idep_intel_decoder,
],
include_directories : [inc_include, inc_src, inc_intel],
link_with : [libintel_common, libintel_compiler],
link_with : [libintel_compiler],
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
cpp_args : ['-fpermissive', '-Wno-parentheses'],

View File

@@ -42,13 +42,13 @@
#include "common/intel_aux_map.h"
#include "common/intel_bind_timeline.h"
#include "common/intel_decoder.h"
#include "common/intel_engine.h"
#include "common/intel_gem.h"
#include "common/intel_l3_config.h"
#include "common/intel_measure.h"
#include "common/intel_mem.h"
#include "common/intel_sample_positions.h"
#include "decoder/intel_decoder.h"
#include "dev/intel_device_info.h"
#include "blorp/blorp.h"
#include "compiler/brw_compiler.h"

View File

@@ -262,6 +262,7 @@ libvulkan_intel = shared_library(
idep_nir, idep_genxml, idep_vulkan_util, idep_vulkan_wsi,
idep_vulkan_runtime, idep_mesautil, idep_xmlconfig,
idep_intel_driver_ds, idep_intel_dev, idep_intel_blorp,
idep_intel_decoder,
],
c_args : anv_flags,
gnu_symbol_visibility : 'hidden',
@@ -299,6 +300,7 @@ if with_tests
dep_thread, dep_dl, dep_m, anv_deps,
idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_vulkan_runtime,
idep_mesautil, idep_intel_dev, idep_intel_shaders, idep_intel_blorp,
idep_intel_decoder,
],
c_args : anv_flags,
gnu_symbol_visibility : 'hidden',

View File

@@ -41,13 +41,13 @@
#define VG(x) ((void)0)
#endif
#include "common/intel_decoder.h"
#include "common/intel_engine.h"
#include "common/intel_gem.h"
#include "common/intel_l3_config.h"
#include "common/intel_measure.h"
#include "common/intel_mem.h"
#include "common/intel_sample_positions.h"
#include "decoder/intel_decoder.h"
#include "dev/intel_device_info.h"
#include "blorp/blorp.h"
#include "compiler/brw_compiler.h"

View File

@@ -197,6 +197,7 @@ libvulkan_intel_hasvk = shared_library(
idep_nir, idep_genxml, idep_vulkan_util, idep_vulkan_wsi,
idep_vulkan_runtime, idep_mesautil, idep_xmlconfig,
idep_intel_driver_ds, idep_intel_dev, idep_intel_blorp,
idep_intel_decoder,
],
c_args : anv_flags,
gnu_symbol_visibility : 'hidden',
@@ -235,6 +236,7 @@ if with_tests
dep_thread, dep_dl, dep_m, anv_deps,
idep_nir, idep_vulkan_util, idep_vulkan_wsi, idep_vulkan_runtime,
idep_mesautil, idep_intel_dev, idep_intel_blorp,
idep_intel_decoder,
],
c_args : anv_flags,
gnu_symbol_visibility : 'hidden',