[igt-dev] [PATCH i-g-t v2] tests/perf: add tests for multi context filtering

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Mar 31 12:20:52 UTC 2020


On 31/03/2020 15:09, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2020-03-31 12:53:13)
>> +       /* Missing DRM_I915_PERF_PROP_CTX_HANDLE_ARRAY. */
>> +       {
>> +               uint32_t context_ids[] = {
>> +                       0,
>> +                       0,
>> +               };
>> +               uint64_t properties[] = {
>> +                       /* Note: we have to specify at least one sample property even
>> +                        * though we aren't interested in samples in this case
>> +                        */
>> +                       DRM_I915_PERF_PROP_SAMPLE_OA, true,
>> +
>> +                       /* OA unit configuration */
>> +                       DRM_I915_PERF_PROP_OA_METRICS_SET, test_set->perf_oa_metrics_set,
>> +                       DRM_I915_PERF_PROP_OA_FORMAT, test_set->perf_oa_format,
>> +
>> +                       /* Note: no OA exponent specified in this case */
>> +
>> +                       DRM_I915_PERF_PROP_CTX_HANDLE_ARRAY_LENGTH, ARRAY_SIZE(context_ids),
>> +               };
>> +               struct drm_i915_perf_open_param param = {
>> +                       .flags = I915_PERF_FLAG_FD_CLOEXEC,
>> +                       .num_properties = sizeof(properties) / 16,
>> +                       .properties_ptr = to_user_pointer(properties),
>> +               };
>> +
>> +               do_ioctl_err(drm_fd, DRM_IOCTL_I915_PERF_OPEN, &param, EFAULT);
>> +       }
>> +}
> Also
> (CTX_HANDLE_ARRAY = -1, CTX_HANDLE_ARRAY_LENGTH = 4)
> (CTX_HANDLE_ARRAY = &context_ids[], !IS_ALIGNED(CTX_HANDLE_ARRAY_LENGTH, 4))
> (CTX_HANDLE_ARRAY = &context_ids[], CTX_HANDLE_ARRAY_LENGTH = -4)
>
> I'll take it as a given that passing unmapped pointers doesn't work :)
> -Chris

Ah... I'll check all of that. Thanks for the reminder :)


-Lionel



More information about the igt-dev mailing list