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

Eric Anholt eric at anholt.net
Fri Apr 12 11:21:39 PDT 2013


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.

> +/**
> + * i965 representation of a performance monitor object.
> + */
> +struct brw_perf_monitor_object
> +{
> +   /** The base class. */
> +   struct gl_perf_monitor_object base;
> +
> +   /**
> +    * The GPU-facing BO, holding raw counter data in a hardware specific form.
> +    */
> +   drm_intel_bo *gpu_facing_bo;
> +};

Why all the emphasis of "GPU-facing"?  We don't use BOs for anything
that the GPU doesn't touch.

> +/**
> + * Driver hook for glEndPerformanceMonitorAMD().
> + */
> +static void
> +brw_end_perf_monitor(struct gl_context *ctx,
> +                     struct gl_perf_monitor_object *m)
> +{
> +   struct brw_context *brw = brw_context(ctx);
> +   struct brw_perf_monitor_object *monitor = brw_perf_monitor(m);
> +   if (aggregating_counters_needed(brw, m)) {
> +      snapshot_aggregating_counters(brw, monitor->gpu_facing_bo,
> +                                    brw->perfmon.total_counter_size);

At least some variants of the command require 64b alignment -- I'd
probably stick the ending dump at some fixed offset in the BO, like
halfway through.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130412/86442eb9/attachment.pgp>


More information about the mesa-dev mailing list