From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 1/2] intel: Add the ability to supply annotations for .aub files. Date: Wed, 09 May 2012 20:07:01 -0700 Message-ID: <87aa1gspii.fsf@eliezer.anholt.net> References: <1336426312-23315-1-git-send-email-stereotype441@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1666685230==" Return-path: In-Reply-To: <1336426312-23315-1-git-send-email-stereotype441@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Paul Berry , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============1666685230== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Mon, 7 May 2012 14:31:51 -0700, Paul Berry wr= ote: > This patch adds a new function, > drm_intel_bufmgr_gem_set_aub_annotations(), which can be used to > annotate the type and subtype of data stored in various sections of > each buffer. This data is used to populate type and subtype fields > when generating the .aub file, which improves the ability of later > debugging tools to analyze the contents of the .aub file. >=20 > If drm_intel_bufmgr_gem_set_aub_annotations() is not called, then we > fall back to the old set of annotations (annotate the portion of the > batchbuffer that is executed as AUB_TRACE_TYPE_BATCH, and everything > else as AUB_TRACE_TYPE_NOTYPE). This looks better than the interface I was thinking of. Only real nitpick note is that the style in this file is tab indents, rather than 8 spaces, same as linux kernel and 2d driver style. (I have since been convinced that 8 spaces is superior, but a mix is worse). > /* > @@ -1989,23 +2027,31 @@ aub_exec(drm_intel_bo *bo, int ring_flag, int use= d) > drm_intel_bufmgr_gem *bufmgr_gem =3D (drm_intel_bufmgr_gem *) bo->bufmg= r; > drm_intel_bo_gem *bo_gem =3D (drm_intel_bo_gem *) bo; > int i; > + bool batch_buffer_needs_annotations; >=20=20 > if (!bufmgr_gem->aub_file) > return; >=20=20 > - /* Write out all but the batchbuffer to AUB memory */ > - for (i =3D 0; i < bufmgr_gem->exec_count - 1; i++) { > - if (bufmgr_gem->exec_bos[i] !=3D bo) > - aub_write_bo(bufmgr_gem->exec_bos[i]); > + /* If batch buffer is not annotated, annotate it the best we > + * can. > + */ > + batch_buffer_needs_annotations =3D bo_gem->aub_annotation_count = =3D=3D 0; > + if (batch_buffer_needs_annotations) { > + drm_intel_aub_annotation annotations[2] =3D { > + { AUB_TRACE_TYPE_BATCH, 0, used }, > + { AUB_TRACE_TYPE_NOTYPE, 0, bo->size } > + }; > + drm_intel_bufmgr_gem_set_aub_annotations(bo, annotations= , 2); Looks like you don't actually need to be explicit about the range from used to bo->size given the "Write out any remaining unannotated data" code above, but either way. Assuming tab replacement: Reviewed-by: Eric Anholt --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAk+rMNUACgkQHUdvYGzw6vfsQQCeL4jHo2ZgvUyhxA/7omrZ/l3z 2KEAnA6fH4hV0cS/CXaz0v4ETKKEWgp8 =Fr2x -----END PGP SIGNATURE----- --=-=-=-- --===============1666685230== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1666685230==--