From: Eric Anholt Date: Fri, 24 Oct 2014 19:50:20 +0000 (+0100) Subject: vc4: Don't forget to validate code that's got PROG_END on it. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8911879dec564ab2ef343d58e6de4fd558e35c3d;p=mesa.git 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. --- 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);