Re: [PATCH 12/34] drm: kselftest for drm_mm and alignment

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

 



On ma, 2016-12-12 at 11:53 +0000, Chris Wilson wrote:
> Check that we can request alignment to any power-of-two or prime using a
> plain drm_mm_node_insert(), and also handle a reasonable selection of
> primes.
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

<SNIP>

> +static int igt_align(void *ignored)
> +{
> +	struct drm_mm mm;
> +	struct drm_mm_node *node, *next;
> +	int ret = -EINVAL;
> +	int prime;
> +
> +	drm_mm_init(&mm, 1, U64_MAX - 1);
> +
> +	drm_for_each_prime(prime, 8192) {
> +		u64 size;
> +		int err;
> +
> +		node = kzalloc(sizeof(*node), GFP_KERNEL);
> +		if (!node) {
> +			ret = -ENOMEM;
> +			goto out;
> +		}

If the amount of primes would be predictable (pun intended), we could
malloc the nodes at one go.

Other than that, looks like I reviewed this already;

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux