On 9 May 2012 20:07, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, 7 May 2012 14:32:18 -0700, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
> +/**<br>
> + * Generate a set of aub file annotations for the current batch buffer, and<br>
> + * deliver them to DRM.<br>
> + *<br>
> + * The "used" section of the batch buffer (the portion containing batch<br>
> + * commands) is annotated with AUB_TRACE_TYPE_BATCH. The remainder of the<br>
> + * batch buffer (which contains data structures pointed to by batch commands)<br>
> + * is annotated according to the type of each data structure.<br>
> + */<br>
> +void<br>
> +brw_annotate_aub(struct intel_context *intel)<br>
> +{<br>
> + struct brw_context *brw = brw_context(&intel->ctx);<br>
> +<br>
> + unsigned annotation_count = 2 * brw->state_batch_count + 1;<br>
> + drm_intel_aub_annotation annotations[annotation_count];<br>
> + int a = 0;<br>
> + make_annotation(&annotations[a++], AUB_TRACE_TYPE_BATCH, 0,<br>
> + 4*intel->batch.used);<br>
> + for (int i = brw->state_batch_count; i-- > 0; ) {<br>
> + uint32_t type = brw->state_batch_list[i].type;<br>
<br>
</div>Isn't the for loop start here off by one?<br></blockquote><div><br>I don't think so. Note the postdecrement in the loop condition, so the first time through the loop i == brw->state_batch_count - 1.<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Other than that,<br>
<br>
Reviewed-by: Eric Anholt<br>
<br>
feel free to just squash the <a href="http://configure.ac" target="_blank">configure.ac</a> bump into this.<br>
</blockquote></div><br>Ok, will do. I'll hold off on pushing this patch until after drm is released so that nobody's build gets broken.<br>