mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 18:00:13 +01:00
i965: Pass pointer and end of assembly to brw_validate_instructions
This will allow us to more easily run brw_validate_instructions() on shader programs we find in GPU hang error states. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
8ca8ebbf78
commit
a7217e909c
5 changed files with 22 additions and 11 deletions
|
|
@ -548,7 +548,8 @@ void brw_debug_compact_uncompact(const struct gen_device_info *devinfo,
|
||||||
brw_inst *orig, brw_inst *uncompacted);
|
brw_inst *orig, brw_inst *uncompacted);
|
||||||
|
|
||||||
/* brw_eu_validate.c */
|
/* brw_eu_validate.c */
|
||||||
bool brw_validate_instructions(const struct brw_codegen *p, int start_offset,
|
bool brw_validate_instructions(const struct gen_device_info *devinfo,
|
||||||
|
void *assembly, int start_offset, int end_offset,
|
||||||
struct annotation_info *annotation);
|
struct annotation_info *annotation);
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
|
|
|
||||||
|
|
@ -1030,17 +1030,16 @@ region_alignment_rules(const struct gen_device_info *devinfo,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
brw_validate_instructions(const struct brw_codegen *p, int start_offset,
|
brw_validate_instructions(const struct gen_device_info *devinfo,
|
||||||
|
void *assembly, int start_offset, int end_offset,
|
||||||
struct annotation_info *annotation)
|
struct annotation_info *annotation)
|
||||||
{
|
{
|
||||||
const struct gen_device_info *devinfo = p->devinfo;
|
|
||||||
const void *store = p->store;
|
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
|
|
||||||
for (int src_offset = start_offset; src_offset < p->next_insn_offset;
|
for (int src_offset = start_offset; src_offset < end_offset;
|
||||||
src_offset += sizeof(brw_inst)) {
|
src_offset += sizeof(brw_inst)) {
|
||||||
struct string error_msg = { .str = NULL, .len = 0 };
|
struct string error_msg = { .str = NULL, .len = 0 };
|
||||||
const brw_inst *inst = store + src_offset;
|
const brw_inst *inst = assembly + src_offset;
|
||||||
|
|
||||||
if (is_unsupported_inst(devinfo, inst)) {
|
if (is_unsupported_inst(devinfo, inst)) {
|
||||||
ERROR("Instruction not supported on this Gen");
|
ERROR("Instruction not supported on this Gen");
|
||||||
|
|
|
||||||
|
|
@ -2167,10 +2167,16 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width)
|
||||||
annotation_finalize(&annotation, p->next_insn_offset);
|
annotation_finalize(&annotation, p->next_insn_offset);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
bool validated = brw_validate_instructions(p, start_offset, &annotation);
|
bool validated = brw_validate_instructions(devinfo, p->store,
|
||||||
|
start_offset,
|
||||||
|
p->next_insn_offset,
|
||||||
|
&annotation);
|
||||||
#else
|
#else
|
||||||
if (unlikely(debug_flag))
|
if (unlikely(debug_flag))
|
||||||
brw_validate_instructions(p, start_offset, &annotation);
|
brw_validate_instructions(devinfo, p->store,
|
||||||
|
start_offset,
|
||||||
|
p->next_insn_offset,
|
||||||
|
&annotation);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int before_size = p->next_insn_offset - start_offset;
|
int before_size = p->next_insn_offset - start_offset;
|
||||||
|
|
|
||||||
|
|
@ -2180,10 +2180,14 @@ generate_code(struct brw_codegen *p,
|
||||||
annotation_finalize(&annotation, p->next_insn_offset);
|
annotation_finalize(&annotation, p->next_insn_offset);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
bool validated = brw_validate_instructions(p, 0, &annotation);
|
bool validated = brw_validate_instructions(devinfo, p->store,
|
||||||
|
0, p->next_insn_offset,
|
||||||
|
&annotation);
|
||||||
#else
|
#else
|
||||||
if (unlikely(debug_flag))
|
if (unlikely(debug_flag))
|
||||||
brw_validate_instructions(p, 0, &annotation);
|
brw_validate_instructions(devinfo, p->store,
|
||||||
|
0, p->next_insn_offset,
|
||||||
|
&annotation);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int before_size = p->next_insn_offset;
|
int before_size = p->next_insn_offset;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,8 @@ validate(struct brw_codegen *p)
|
||||||
annotation.ann[annotation.ann_count].offset = p->next_insn_offset;
|
annotation.ann[annotation.ann_count].offset = p->next_insn_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ret = brw_validate_instructions(p, 0, &annotation);
|
bool ret = brw_validate_instructions(devinfo, p->store, 0,
|
||||||
|
p->next_insn_offset, &annotation);
|
||||||
|
|
||||||
if (print) {
|
if (print) {
|
||||||
dump_assembly(p->store, annotation.ann_count, annotation.ann, p->devinfo);
|
dump_assembly(p->store, annotation.ann_count, annotation.ann, p->devinfo);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue