[PATCH 2/4] drm/i915/perf: Whitelist OA report trigger registers

Chris Wilson chris at chris-wilson.co.uk
Tue Aug 18 10:28:43 UTC 2020


Quoting Umesh Nerlige Ramappa (2020-08-04 19:06:42)
> +static void _wa_remove(struct i915_wa_list *wal, i915_reg_t reg, u32 flags)
> +{
> +       int index;
> +       struct i915_wa *wa = wal->list;

If there's no other reason, go from longest to shortest local.

> +       reg.reg |= flags;
> +
> +       index = _wa_index(wal, reg);
> +       if (index < 0)
> +               return;
> +
> +       memset(wa + index, 0, sizeof(*wa));
> +
> +       while (index < wal->count - 1) {
> +               swap(wa[index], wa[index + 1]);
> +               index++;
> +       }

Just noticed that this is
	memove(wa + index,
	       wa + index + 1,
	       sizeof(*wa) * (wal->count - index - 1));
-Chris


More information about the Intel-gfx-trybot mailing list