From 7d439890b2b9deda54dd2929bb1591f9791eed28 Mon Sep 17 00:00:00 2001 From: Andi Shyti Date: Thu, 28 Mar 2019 17:09:48 +0200 Subject: lib/i915: add gem_engine_topology library and for_each loop definition The gem_engine_topology library is a set of functions that interface with the query and getparam/setparam ioctls. The library's access point is the 'intel_init_engine_list()' function that, everytime is called, generates the list of active engines and returns them in a 'struct intel_engine_data'. The structure contains only the engines that are actively present in the GPU. The function can work in both the cases that the query and getparam ioctls are implemented or not by the running kernel. In case they are implemented, a query is made to the driver to fetch the list of active engines. In case they are not implemented, the list is taken from the 'intel_execution_engines2' array and stored only after checking their presence. The gem_engine_topology library provides some iteration helpers: - intel_get_current_engine(): provides the current engine in the iteration. - intel_get_current_physical_engine(): provides the current physical engine, if the current engine is a virtual engine, it moves forward until it finds a physical engine. - intel_next_engine() it just increments the counter so that it points to the next engine. Extend the 'for_each_engine_class_instance' so that it can loop using the new 'intel_init_engine_list()' and rename it to 'for_each_context_engine'. Move '__for_each_engine_class_instance' to gem_engine_topology.h and rename it to '__for_each_static_engine'. Update accordingly tests/perf_pmu.c to use correctly the new for_each loops. Signed-off-by: Andi Shyti --- lib/igt_gt.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/igt_gt.h') diff --git a/lib/igt_gt.h b/lib/igt_gt.h index 475c0b3c..52b2f1ea 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -95,6 +95,8 @@ extern const struct intel_execution_engine2 { const char *name; int class; int instance; + uint64_t flags; + bool is_virtual; } intel_execution_engines2[]; unsigned int -- cgit v1.2.3