i965: perf: keep on reading reports until delimiting timestamp
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 30 Mar 2017 14:46:40 +0000 (15:46 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 27 Jun 2017 11:10:29 +0000 (14:10 +0300)
commit31b11f69f75ff92cb42a13bb2f6740c183f761df
tree31ee091210f7ff0a61a4f2d713c2ec6f6e20c086
parent1fc7b951278428bd0fbbe040226737a44742f353
i965: perf: keep on reading reports until delimiting timestamp

Due to an underlying hardware race condition, we have no guarantee
that all the reports coming from the OA buffer related to the workload
we're trying to measure have landed to memory by the time all the work
submitted has completed. That means we need to keep on reading the OA
stream until we read a report with a timestamp more recent than the
timestamp recored by the MI_REPORT_PERF_COUNT at the end of the
performance query.

v2: fix uninitialized offset variable to 0 (Lionel)

v3: rework the reading to avoid blocking the user of the API unless
    requested (Rob)

v4: fix a bug that makes the i965 driver reading the perf stream when
    not necessary, leading to very long counter accumulation times
    (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_performance_query.c