aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-06-09 23:20:10 +0100
committerLionel Landwerlin <[email protected]>2019-10-23 05:41:14 +0000
commita0e0e75db172222c4ab608971e08c6e59f9227fa (patch)
treeca0462a9991979cd8023c065b42baf92c7cd2a7c /src/intel
parentc352cdf970fd8a42d7b2d3b3375e0633d9d870bb (diff)
intel/perf: add mdapi maker helper
A simple utility to put the marker at the right location. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/perf/gen_perf_mdapi.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/intel/perf/gen_perf_mdapi.h b/src/intel/perf/gen_perf_mdapi.h
index 3c3aec2c64e..9747198be95 100644
--- a/src/intel/perf/gen_perf_mdapi.h
+++ b/src/intel/perf/gen_perf_mdapi.h
@@ -26,6 +26,8 @@
#include <stdint.h>
+#include "dev/gen_device_info.h"
+
struct gen_device_info;
struct gen_perf_query_result;
@@ -132,4 +134,30 @@ int gen_perf_query_result_write_mdapi(void *data, uint32_t data_size,
const struct gen_perf_query_result *result,
uint64_t freq_start, uint64_t freq_end);
+static inline void gen_perf_query_mdapi_write_marker(void *data, uint32_t data_size,
+ const struct gen_device_info *devinfo,
+ uint64_t value)
+{
+ switch (devinfo->gen) {
+ case 8: {
+ if (data_size < sizeof(struct gen8_mdapi_metrics))
+ return;
+ struct gen8_mdapi_metrics *mdapi_data = data;
+ mdapi_data->MarkerUser = value;
+ break;
+ }
+ case 9:
+ case 10:
+ case 11: {
+ if (data_size < sizeof(struct gen9_mdapi_metrics))
+ return;
+ struct gen9_mdapi_metrics *mdapi_data = data;
+ mdapi_data->MarkerUser = value;
+ break;
+ }
+ default:
+ break;
+ }
+}
+
#endif /* GEN_PERF_MDAPI_H */