[Intel-gfx] [PATCH v7 3/4] drm/i915/perf: prepare driver to receive multiple ctx handles
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Tue Apr 28 18:11:45 UTC 2020
On 28/04/2020 13:23, Chris Wilson wrote:
> Quoting Lionel Landwerlin (2020-04-28 11:08:15)
>> +static int ctx_id_equal(const void *key, const void *elem)
>> +{
>> + const struct i915_perf_context_detail *details = elem;
>> +
>> + return ((int)details->id) - *((int *)key);
>> +}
>> +
>> +static inline bool ctx_id_match(struct i915_perf_stream *stream,
>> + u32 masked_ctx_id)
>> +{
>> + return bsearch(&masked_ctx_id,
> You might as well just (void *)(uintptr_t)masked_ctx_id and
>
> static int ctx_id_cmp(const void *key, const void *elem)
> {
> const struct i915_perf_context_detail *details = elem;
>
> return details->id - (uinptr_t)key;
> }
Oops, forgot to add that change.
I have it locally and it works fine, will resend tomorrow.
-Lionel
More information about the Intel-gfx
mailing list