mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
intel/tools: Add ELK support for intel_hang_viewer
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27563>
This commit is contained in:
parent
d641ca5b86
commit
23e0cff907
2 changed files with 22 additions and 6 deletions
|
|
@ -42,8 +42,11 @@
|
|||
#include "util/macros.h"
|
||||
|
||||
#include "common/intel_hang_dump.h"
|
||||
|
||||
#include "compiler/brw_disasm.h"
|
||||
#include "compiler/brw_isa_info.h"
|
||||
#include "compiler/elk/elk_disasm.h"
|
||||
#include "compiler/elk/elk_isa_info.h"
|
||||
|
||||
/* Data */
|
||||
|
||||
|
|
@ -124,7 +127,9 @@ static struct Context {
|
|||
|
||||
struct intel_device_info devinfo;
|
||||
struct intel_spec *spec = NULL;
|
||||
struct brw_isa_info isa;
|
||||
|
||||
struct brw_isa_info brw;
|
||||
struct elk_isa_info elk;
|
||||
|
||||
/* Result of parsing the hang file */
|
||||
std::vector<hang_bo> bos;
|
||||
|
|
@ -223,9 +228,15 @@ public:
|
|||
size_t shader_txt_size = 0;
|
||||
FILE *f = open_memstream(&shader_txt, &shader_txt_size);
|
||||
if (f) {
|
||||
brw_disassemble_with_errors(&context.isa,
|
||||
(const uint8_t *) bo->map +
|
||||
(address - bo->offset), 0, f);
|
||||
if (context.devinfo.ver >= 9) {
|
||||
brw_disassemble_with_errors(&context.brw,
|
||||
(const uint8_t *) bo->map +
|
||||
(address - bo->offset), 0, f);
|
||||
} else {
|
||||
elk_disassemble_with_errors(&context.elk,
|
||||
(const uint8_t *) bo->map +
|
||||
(address - bo->offset), 0, f);
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
|
@ -769,7 +780,11 @@ main(int argc, char *argv[])
|
|||
intel_device_name_to_pci_device_id(platform),
|
||||
&context.devinfo);
|
||||
|
||||
brw_init_isa_info(&context.isa, &context.devinfo);
|
||||
if (context.devinfo.ver >= 9) {
|
||||
brw_init_isa_info(&context.brw, &context.devinfo);
|
||||
} else {
|
||||
elk_init_isa_info(&context.elk, &context.devinfo);
|
||||
}
|
||||
context.spec = intel_spec_load(&context.devinfo);
|
||||
|
||||
parse_hang_file(filename);
|
||||
|
|
|
|||
|
|
@ -185,9 +185,10 @@ if with_tools.contains('intel-ui')
|
|||
idep_intel_dev,
|
||||
idep_libintel_common,
|
||||
idep_intel_decoder_brw,
|
||||
idep_intel_decoder_elk,
|
||||
],
|
||||
include_directories : [inc_include, inc_src, inc_intel],
|
||||
link_with : [libintel_compiler],
|
||||
link_with : [libintel_compiler, libintel_compiler_elk],
|
||||
c_args : [no_override_init_args],
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
cpp_args : ['-fpermissive', '-Wno-parentheses'],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue