Mesa (staging/19.3): intel/perf: expose timestamp begin for mdapi
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jan 21 20:16:12 UTC 2020
Module: Mesa
Branch: staging/19.3
Commit: 3c1e9479b85ec6616999dc8e25f0265eb6ca07d7
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c1e9479b85ec6616999dc8e25f0265eb6ca07d7
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Mon Dec 16 15:36:24 2019 +0200
intel/perf: expose timestamp begin for mdapi
This was forgotten in the initial implementation.
v2: ensure the value is written for both GL & Vulkan queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Cc: <mesa-stable at lists.freedesktop.org>
Acked-by: Tapani Pälli <tapani.palli at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3112>
(cherry picked from commit 3bb8a4bfecbfb1345256c4faa8cd10d5b0a7ca76)
---
.pick_status.json | 2 +-
src/intel/perf/gen_perf.c | 2 ++
src/intel/perf/gen_perf.h | 5 +++++
src/intel/perf/gen_perf_mdapi.c | 2 ++
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 6b97c9328cb..fe9f559232a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1228,7 +1228,7 @@
"description": "intel/perf: expose timestamp begin for mdapi",
"nominated": true,
"nomination_type": 0,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": null
},
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index 2e0d31c2244..a7436530f9b 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -1142,6 +1142,8 @@ gen_perf_query_result_accumulate(struct gen_perf_query_result *result,
if (result->hw_id == OA_REPORT_INVALID_CTX_ID &&
start[2] != OA_REPORT_INVALID_CTX_ID)
result->hw_id = start[2];
+ if (result->reports_accumulated == 0)
+ result->begin_timestamp = start[1];
result->reports_accumulated++;
switch (query->oa_format) {
diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h
index 46d37e07c25..25f234b5bde 100644
--- a/src/intel/perf/gen_perf.h
+++ b/src/intel/perf/gen_perf.h
@@ -113,6 +113,11 @@ struct gen_perf_query_result {
* query.
*/
uint64_t unslice_frequency[2];
+
+ /**
+ * Timestamp of the query.
+ */
+ uint64_t begin_timestamp;
};
struct gen_perf_query_counter {
diff --git a/src/intel/perf/gen_perf_mdapi.c b/src/intel/perf/gen_perf_mdapi.c
index 38ca23088d2..0f35671930f 100644
--- a/src/intel/perf/gen_perf_mdapi.c
+++ b/src/intel/perf/gen_perf_mdapi.c
@@ -73,6 +73,7 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size,
mdapi_data->ReportsCount = result->reports_accumulated;
mdapi_data->TotalTime =
gen_device_info_timebase_scale(devinfo, result->accumulator[0]);
+ mdapi_data->BeginTimestamp = result->begin_timestamp;
mdapi_data->GPUTicks = result->accumulator[1];
mdapi_data->CoreFrequency = freq_end;
mdapi_data->CoreFrequencyChanged = freq_end != freq_start;
@@ -101,6 +102,7 @@ gen_perf_query_result_write_mdapi(void *data, uint32_t data_size,
mdapi_data->ReportsCount = result->reports_accumulated;
mdapi_data->TotalTime =
gen_device_info_timebase_scale(devinfo, result->accumulator[0]);
+ mdapi_data->BeginTimestamp = result->begin_timestamp;
mdapi_data->GPUTicks = result->accumulator[1];
mdapi_data->CoreFrequency = freq_end;
mdapi_data->CoreFrequencyChanged = freq_end != freq_start;
More information about the mesa-commit
mailing list