intel: Add meson option -Dintel-elk

Defaults to true.  When set to false Iris and various tools can be
built without ELK support.  In both cases this means supporting
only Gfx9+.  This option must be true to build Crocus or Hasvk.

This allows skipping re-building ELK when developing for newer platforms
with tools/tests enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11575
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33054>
This commit is contained in:
Caio Oliveira
2025-01-15 11:18:24 -08:00
committed by Marge Bot
parent 31e5d909e7
commit fbacf3761f
17 changed files with 291 additions and 52 deletions
+18
View File
@@ -7,10 +7,20 @@
#include "compiler/brw_disasm.h"
#include "compiler/brw_isa_info.h"
#ifdef INTEL_USE_ELK
#include "compiler/elk/elk_disasm.h"
#include "compiler/elk/elk_isa_info.h"
#endif
#include "dev/intel_device_info.h"
static void
not_supported(const struct intel_device_info *devinfo)
{
fprintf(stderr, "ERROR: Tool compiled without support for Gfx version %d.\n",
devinfo->ver);
exit(EXIT_FAILURE);
}
void
intel_disassemble(const struct intel_device_info *devinfo,
const void *assembly, int start, FILE *out)
@@ -20,9 +30,13 @@ intel_disassemble(const struct intel_device_info *devinfo,
brw_init_isa_info(&isa, devinfo);
brw_disassemble_with_errors(&isa, assembly, start, out);
} else {
#ifdef INTEL_USE_ELK
struct elk_isa_info isa;
elk_init_isa_info(&isa, devinfo);
elk_disassemble_with_errors(&isa, assembly, start, out);
#else
not_supported(devinfo);
#endif
}
}
@@ -41,9 +55,13 @@ intel_decoder_init(struct intel_batch_decode_ctx *ctx,
intel_batch_decode_ctx_init_brw(ctx, &isa, devinfo, fp,
flags, xml_path, get_bo, get_state_size, user_data);
} else {
#ifdef INTEL_USE_ELK
struct elk_isa_info isa;
elk_init_isa_info(&isa, devinfo);
intel_batch_decode_ctx_init_elk(ctx, &isa, devinfo, fp,
flags, xml_path, get_bo, get_state_size, user_data);
#else
not_supported(devinfo);
#endif
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ libintel_tools = static_library(
idep_libintel_common,
],
include_directories : [inc_include, inc_src, inc_intel],
c_args : [no_override_init_args],
c_args : [intel_common_args, no_override_init_args],
gnu_symbol_visibility : 'hidden',
install : false,
)