Re: [PATCH] drm/i915/selftests: Exercise rc6 handling

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

 



Quoting Chris Wilson (2019-11-14 08:54:43)
> +static struct intel_engine_cs **
> +randomised_engines(struct intel_gt *gt,
> +                  struct rnd_state *prng,
> +                  unsigned int *count)
> +{
> +       struct intel_engine_cs *engine, **engines;
> +       enum intel_engine_id id;
> +       int n;
> +
> +       n = 0;
> +       for_each_engine(engine, gt, id)
> +               n++;
> +       if (!n)
> +               return NULL;
> +
> +       engines = kmalloc_array(n, sizeof(*engines), GFP_KERNEL);
> +       if (!engines)
> +               return NULL;
> +
> +       n = 0;
> +       for_each_engine(engine, gt, id)
> +               engines[n++] = engine;
> +
> +       i915_prandom_shuffle(engines, sizeof(*engines), n, prng);
> +
*count = n;
> +       return engines;
> +}
_______________________________________________
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