summaryrefslogtreecommitdiff
path: root/lib/igt_gt.h
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@intel.com>2019-03-28 17:09:48 +0200
committerAndi Shyti <andi.shyti@intel.com>2019-05-13 01:58:57 +0300
commit7d439890b2b9deda54dd2929bb1591f9791eed28 (patch)
tree2808a2b75b86590cbbe39bd8e026fc3b180b90f8 /lib/igt_gt.h
parent364a71b13ffd73607563dbb5a015a59622f942bf (diff)
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 <andi.shyti@intel.com>
Diffstat (limited to 'lib/igt_gt.h')
-rw-r--r--lib/igt_gt.h2
1 files changed, 2 insertions, 0 deletions
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