[igt-dev] [PATCH i-g-t v4 02/11] lib/igt_gt: add intel_measure_ring_size
Antonio Argenziano
antonio.argenziano at intel.com
Fri Feb 23 23:16:54 UTC 2018
On 23/02/18 01:29, Chris Wilson wrote:
> 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,
Which would make the usage in some tests more correct. I'll add it to my
TODO list.
Thanks,
Antonio
>
> 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