Commit de13fdc2 authored by Boris Brezillon's avatar Boris Brezillon
Browse files

panfrost: Prepare pandecode to per-gen XML


Signed-off-by: Boris Brezillon's avatarBoris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
Part-of: <!12935>
parent 502b9429
......@@ -643,10 +643,10 @@ panfrost_batch_submit_ioctl(struct panfrost_batch *batch,
INT64_MAX, 0, NULL);
if (dev->debug & PAN_DBG_TRACE)
pandecode_jc(submit.jc, pan_is_bifrost(dev), dev->gpu_id);
pandecode_jc(submit.jc, dev->gpu_id);
if (dev->debug & PAN_DBG_SYNC)
pandecode_abort_on_fault(submit.jc);
pandecode_abort_on_fault(submit.jc, dev->gpu_id);
}
return 0;
......
This diff is collapsed.
......@@ -26,6 +26,8 @@
#ifndef __PAN_DECODE_H__
#define __PAN_DECODE_H__
#include "gen_macros.h"
#include "wrap.h"
extern FILE *pandecode_dump_stream;
......@@ -81,4 +83,9 @@ __pandecode_fetch_gpu_mem(const struct pandecode_mapped_memory *mem,
name = __pandecode_fetch_gpu_mem(mem, gpu_va, sizeof(*name), \
__LINE__, __FILE__)
#ifdef PAN_ARCH
void GENX(pandecode_jc)(mali_ptr jc_gpu_va, unsigned gpu_id);
void GENX(pandecode_abort_on_fault)(mali_ptr jc_gpu_va);
#endif
#endif /* __MMAP_TRACE_H__ */
......@@ -36,6 +36,8 @@
#include "util/u_dynarray.h"
#include "util/hash_table.h"
FILE *pandecode_dump_stream;
/* Memory handling */
static struct hash_table_u64 *mmap_table;
......@@ -218,3 +220,37 @@ pandecode_close(void)
util_dynarray_fini(&ro_mappings);
pandecode_dump_file_close();
}
void pandecode_abort_on_fault_v4(mali_ptr jc_gpu_va);
void pandecode_abort_on_fault_v5(mali_ptr jc_gpu_va);
void pandecode_abort_on_fault_v6(mali_ptr jc_gpu_va);
void pandecode_abort_on_fault_v7(mali_ptr jc_gpu_va);
void
pandecode_abort_on_fault(mali_ptr jc_gpu_va, unsigned gpu_id)
{
switch (pan_arch(gpu_id)) {
case 4: pandecode_abort_on_fault_v4(jc_gpu_va); return;
case 5: pandecode_abort_on_fault_v5(jc_gpu_va); return;
case 6: pandecode_abort_on_fault_v6(jc_gpu_va); return;
case 7: pandecode_abort_on_fault_v7(jc_gpu_va); return;
default: unreachable("Unsupported architecture");
}
}
void pandecode_jc_v4(mali_ptr jc_gpu_va, unsigned gpu_id);
void pandecode_jc_v5(mali_ptr jc_gpu_va, unsigned gpu_id);
void pandecode_jc_v6(mali_ptr jc_gpu_va, unsigned gpu_id);
void pandecode_jc_v7(mali_ptr jc_gpu_va, unsigned gpu_id);
void
pandecode_jc(mali_ptr jc_gpu_va, unsigned gpu_id)
{
switch (pan_arch(gpu_id)) {
case 4: pandecode_jc_v4(jc_gpu_va, gpu_id); return;
case 5: pandecode_jc_v5(jc_gpu_va, gpu_id); return;
case 6: pandecode_jc_v6(jc_gpu_va, gpu_id); return;
case 7: pandecode_jc_v7(jc_gpu_va, gpu_id); return;
default: unreachable("Unsupported architecture");
}
}
......@@ -49,6 +49,7 @@ foreach ver : pixel_format_versions
endforeach
libpanfrost_per_arch = []
libpanfrost_decode_per_arch = []
foreach ver : ['4', '5', '6', '7']
libpanfrost_per_arch += static_library(
......@@ -65,6 +66,16 @@ foreach ver : ['4', '5', '6', '7']
gnu_symbol_visibility : 'hidden',
dependencies : [dep_libdrm, idep_pan_packers, idep_nir],
)
libpanfrost_decode_per_arch += static_library(
'pandecode-arch-v' + ver,
['decode.c', pan_packers],
include_directories : [inc_include, inc_src, inc_panfrost],
dependencies : [dep_libdrm, idep_pan_packers, idep_nir],
c_args : [no_override_init_args, '-DPAN_ARCH=' + ver],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
)
endforeach
libpanfrost_lib_files = files(
......@@ -85,11 +96,6 @@ libpanfrost_lib_files = files(
'pan_util.c',
)
libpanfrost_decode_files = files(
'decode_common.c',
'decode.c',
)
libpanfrost_lib = static_library(
'panfrost_lib',
[libpanfrost_lib_files, pan_packers],
......@@ -103,12 +109,16 @@ libpanfrost_lib = static_library(
libpanfrost_decode = static_library(
'panfrost_decode',
[libpanfrost_decode_files, pan_packers],
[
'decode_common.c',
pan_packers
],
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_panfrost],
dependencies : idep_mesautil,
c_args : [no_override_init_args],
gnu_symbol_visibility : 'hidden',
build_by_default : false,
link_with: [libpanfrost_decode_per_arch],
)
libpanfrost_dep = declare_dependency(
......
......@@ -53,9 +53,9 @@ pandecode_inject_mmap(uint64_t gpu_va, void *cpu, unsigned sz, const char *name)
void pandecode_inject_free(uint64_t gpu_va, unsigned sz);
void pandecode_jc(uint64_t jc_gpu_va, bool bifrost, unsigned gpu_id);
void pandecode_jc(uint64_t jc_gpu_va, unsigned gpu_id);
void
pandecode_abort_on_fault(uint64_t jc_gpu_va);
pandecode_abort_on_fault(uint64_t jc_gpu_va, unsigned gpu_id);
#endif /* __MMAP_TRACE_H__ */
......@@ -85,7 +85,7 @@ panvk_queue_submit_batch(struct panvk_queue *queue,
}
if (debug & PANVK_DEBUG_TRACE)
pandecode_jc(batch->scoreboard.first_job, PAN_ARCH >= 6, pdev->gpu_id);
GENX(pandecode_jc)(batch->scoreboard.first_job, pdev->gpu_id);
}
if (batch->fragment_job) {
......@@ -113,7 +113,7 @@ panvk_queue_submit_batch(struct panvk_queue *queue,
}
if (debug & PANVK_DEBUG_TRACE)
pandecode_jc(batch->fragment_job, PAN_ARCH >= 6, pdev->gpu_id);
GENX(pandecode_jc)(batch->fragment_job, pdev->gpu_id);
}
if (debug & PANVK_DEBUG_TRACE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment