[Mesa-dev] [PATCH] anv: implement pipeline statistics queries

Ilia Mirkin imirkin at alum.mit.edu
Wed Feb 15 23:04:28 UTC 2017


On Tue, Jan 24, 2017 at 5:27 PM, Robert Bragg <robert at sixbynine.org> wrote:
>>>>> Depending on how strictly we consider that the queries should only measure
>>>>> the commands they bracket then I think some stalling will be necessary to
>>>>> serialize the work associated with a query and defer reading the end state
>>>>> until after the relevant stages have completed their work.
>>>>>
>>>>> We aren't very precise about this in GL currently, but in Begin maybe we
>>>>> should stall until everything >= the statistic-stage is idle and in End
>>>>> stall until everything <= the statistic-stage is idle before reading
>>>>> (where
>>>>> 'statistic-stage' here is the pipeline stage associated with the pipeline
>>>>> statistic being queried (or respectively the min/max stage for a set)).
>>>>>
>>>>> For reference in my implementation of INTEL_performance_query facing this
>>>>> same question, I'm currently just stalling before and after queries:
>>>>>
>>>>>
>>>>> https://github.com/rib/mesa/blob/wip/rib/oa-next/src/mesa/drivers/dri/i965/brw_performance_query.c#L994
>>>>>
>>>>> https://github.com/rib/mesa/blob/wip/rib/oa-next/src/mesa/drivers/dri/i965/brw_performance_query.c#L1136
>>>>
>>>> So that's essentially what I'm doing here, I think. (And what the GL
>>>> driver does.)
>
> Yup, the upshot might just be a comment explaining the need for a
> stall. I think we probably need a stall in CmdEndQuery too, otherwise
> the command streamer may read the end counter before the work has
> finished.

Robert,

Can you give me some examples of how I might implement this? I'm not
so familiar with the Intel HW to know this offhand. Mostly hoping you
can point me at a mapping of which bit in what command corresponds to
which stage.

Thanks,

  -ilia


More information about the mesa-dev mailing list