Re: [PATCH v7 3/4] drm/i915/perf: prepare driver to receive multiple ctx handles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
}
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux