[Mesa-dev] [PATCH 2/2] i965: Add support for GL_AMD_performance_monitor on Ironlake.

Kenneth Graunke kenneth at whitecape.org
Mon Apr 22 11:53:52 PDT 2013


On 04/12/2013 01:16 PM, Eric Anholt wrote:
> Kenneth Graunke <kenneth at whitecape.org> writes:
>
>> Ironlake's counters are always enabled; userspace can simply send a
>> MI_REPROT_PERF_COUNT packet to take a snapshot of them.  This makes it
>> easy to implement.
>>
>> The counters are documented in the source code for the intel-gpu-tools
>> intel_perf_counters utility.
>>
>> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
>
>> +/**
>> + * Is a performance monitor result available?
>> + */
>> +static GLboolean
>> +brw_is_perf_monitor_result_available(struct gl_perf_monitor_object *m)
>> +{
>> +   struct brw_perf_monitor_object *monitor = brw_perf_monitor(m);
>> +   return !m->Active && monitor->gpu_facing_bo &&
>> +          !drm_intel_bo_busy(monitor->gpu_facing_bo);
>> +}
>
> This also needs to check for !drm_intel_bo_references by the batch --
> otherwise if the batch hasn't flushed, we'll report result_available
> when it isn't ready.

Good catch.  Fixed for v2.  Thanks!



More information about the mesa-dev mailing list