aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-10-24 20:50:20 +0100
committerEric Anholt <[email protected]>2014-10-28 17:15:36 -0700
commit8911879dec564ab2ef343d58e6de4fd558e35c3d (patch)
tree96d932b01a0b94f019abbc7e4a71fbc7d3f2ceff /src
parentfc1eb614a70a777be0f4f8ada194bab53105999b (diff)
vc4: Don't forget to validate code that's got PROG_END on it.
This signal doesn't terminate the program now, it terminates the program soon. So you have to actually validate the code in the instruction.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/vc4/kernel/vc4_validate_shaders.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/drivers/vc4/kernel/vc4_validate_shaders.c b/src/gallium/drivers/vc4/kernel/vc4_validate_shaders.c
index 56c4a1767dc..fdce0335e12 100644
--- a/src/gallium/drivers/vc4/kernel/vc4_validate_shaders.c
+++ b/src/gallium/drivers/vc4/kernel/vc4_validate_shaders.c
@@ -261,6 +261,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj,
case QPU_SIG_COLOR_LOAD:
case QPU_SIG_LOAD_TMU0:
case QPU_SIG_LOAD_TMU1:
+ case QPU_SIG_PROG_END:
if (!check_instruction_writes(inst, validated_shader,
&validation_state)) {
DRM_ERROR("Bad write at ip %d\n", ip);
@@ -270,6 +271,11 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj,
if (!check_instruction_reads(inst, validated_shader))
goto fail;
+ if (sig == QPU_SIG_PROG_END) {
+ found_shader_end = true;
+ shader_end_ip = ip;
+ }
+
break;
case QPU_SIG_LOAD_IMM:
@@ -280,11 +286,6 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj,
}
break;
- case QPU_SIG_PROG_END:
- found_shader_end = true;
- shader_end_ip = ip;
- break;
-
default:
DRM_ERROR("Unsupported QPU signal %d at "
"instruction %d\n", sig, ip);