From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 3/7] drm/vc4: Add a bitmap of branch targets during shader validation. Date: Fri, 15 Jul 2016 15:26:38 -0700 Message-ID: <87fura1qsh.fsf@eliezer.anholt.net> References: <1467681280-20317-1-git-send-email-eric@anholt.net> <1467681280-20317-4-git-send-email-eric@anholt.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: In-Reply-To: <1467681280-20317-4-git-send-email-eric@anholt.net> Sender: linux-kernel-owner@vger.kernel.org To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org --=-=-= Content-Type: text/plain Eric Anholt writes: > This isn't used yet, it's just a first step toward loop validation. > During the main parsing of instructions, we need to know when we hit a > new basic block so that we can reset validated state. > > Signed-off-by: Eric Anholt > --- > drivers/gpu/drm/vc4/vc4_qpu_defines.h | 12 +++ > drivers/gpu/drm/vc4/vc4_validate_shaders.c | 114 ++++++++++++++++++++++++++++- > 2 files changed, 124 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_qpu_defines.h b/drivers/gpu/drm/vc4/vc4_qpu_defines.h > index d5c2f3c85ebb..82ef0e525d55 100644 > --- a/drivers/gpu/drm/vc4/vc4_qpu_defines.h > +++ b/drivers/gpu/drm/vc4/vc4_qpu_defines.h > + /* The actual branch target is the instruction after the delay > + * slots, plus whatever byte offset is in the low 32 bits of > + * the instruction. Make sure we're not branching beyond the > + * end of the shader object. > + */ > + if (branch_imm % sizeof(inst) != 0) { > + DRM_ERROR("branch target not aligned\n"); > + return false; > + }; Last change before pull request: I dropped the stray ';' that kbuild test robot caught. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJXiWMfAAoJELXWKTbR/J7oQYYQALpbXnadSEAlbuQa2Tk4h1iw d274skM2gdnY5u4DIjs/RW4AgE5gSS5ArqVbWIMbRQToQQkw4UiYFLg24twMFJZy ikTyG0v6ilx4AzLQRW7hbAIXO3h1Ii4P1jAiEBviLah/92n6VHHWt5gGaK3mDN9m hOVaMRJ+EoZG9Wu2uOXOZpMNtX+dZa0/UqfG/j/6M5XcZPxy/g2RQD7DfUxR2GCp k9z36kZqf338ez44hMl3r2ej7DkDLtWNl4tm1SrVq/GU5fPvEciZAoyEQzn2qdDj 0yxb1kJtFsGB7hSbIOWvKeoPrwUAE557l8URdDY14pfUTEg4sVqfc8M/wdy3IGir N25W7QUQK3lZZ1FWYOVR7sdvff7QBD2M0WvT0iPoFVQ1HQArqPgJoB3J253EII+6 DqYSLKhZefGyO1KqkY6RFb8q+VDH0VqO1BJGZc3+tnEhRUpI/5iuicY+rZq7CPEd 4bAk2AE+RJjIWst5w9aiVlDGQ3C2+c1rz7uYz+VO7mLl8LV4QoOo0PDiNYpCM02L CBzvhmyMf7wr6TJuhhNMmyfICNy7dNeuHj5looWJQhtdTjyQDvqUBfRD5EWaAwPn idrCJV+j0ODj2AHMskspelC60GUAEj9DsKnIh8Z/qtrZlbPkvrSH0L9xazkrfmN5 /oapyn1w5wVBNjR5M6yC =/KlQ -----END PGP SIGNATURE----- --=-=-=--