[igt-dev] [PATCH i-g-t v4 02/11] lib/igt_gt: add intel_measure_ring_size

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 23 09:29:24 UTC 2018


Quoting Antonio Argenziano (2018-02-21 23:19:38)
> +unsigned int
> +gem_measure_ring_inflight(int fd, unsigned int engine, enum measure_ring_flags flags)
> +{
> +       struct sigaction old_sa, sa = { .sa_handler = alarm_handler };
> +       struct drm_i915_gem_exec_object2 obj[2];
> +       struct drm_i915_gem_execbuffer2 execbuf;
> +       const uint32_t bbe = MI_BATCH_BUFFER_END;
> +       unsigned int count, last;
> +       struct itimerval itv;
> +       IGT_CORK_HANDLE(cork);

An improvement we can make here is to iterate over all engines and
report the minimum ring size (for engine==-1). Something like,

if (engine == ~0u) {
	unsigned int min = ~0u;

	for_each_physical_engine(fd, engine) {
		unsigned int this = gem_measure_ring_inflight(fd, engine, flags);
		if (this < min)
			min = this;
	}

	return min;
}
-Chris


More information about the igt-dev mailing list