summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_compute.c
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2018-07-16 21:22:22 -0400
committerJan Vesely <[email protected]>2018-07-18 13:56:56 -0400
commit9baacf3fa7065fdb35cc3a70c977913d235ad93a (patch)
tree5dfa0052bf239f5b7d7dc2bb6c5781eef22b2e22 /src/gallium/drivers/radeonsi/si_compute.c
parent70534dbe29052e2b4444d1c669750db3608c9eb9 (diff)
radeonsi: Refuse to accept code with unhandled relocations
They might lead to unrecoverable GPU hang. Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Cc: [email protected]
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_compute.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_compute.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_compute.c b/src/gallium/drivers/radeonsi/si_compute.c
index 5d3341ff61e..2349be95849 100644
--- a/src/gallium/drivers/radeonsi/si_compute.c
+++ b/src/gallium/drivers/radeonsi/si_compute.c
@@ -238,6 +238,12 @@ static void *si_create_compute_state(
const amd_kernel_code_t *code_object =
si_compute_get_code_object(program, 0);
code_object_to_config(code_object, &program->shader.config);
+ if (program->shader.binary.reloc_count != 0) {
+ fprintf(stderr, "Error: %d unsupported relocations\n",
+ program->shader.binary.reloc_count);
+ FREE(program);
+ return NULL;
+ }
} else {
si_shader_binary_read_config(&program->shader.binary,
&program->shader.config, 0);