Re: [PATCH drm-next v3 04/15] drm: manager to keep track of GPUs VA mappings

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

 



On Tue,  4 Apr 2023 03:27:30 +0200
Danilo Krummrich <dakr@xxxxxxxxxx> wrote:

> +/**
> + * drm_gpuva_prealloc_create - creates a preallocated node to store a
> + * &drm_gpuva entry.
> + *
> + * Returns: the &drm_gpuva_prealloc object on success, NULL on failure
> + */
> +struct drm_gpuva_prealloc *
> +drm_gpuva_prealloc_create(void)
> +{
> +	struct drm_gpuva_prealloc *pa;
> +
> +	pa = kzalloc(sizeof(*pa), GFP_KERNEL);
> +	if (!pa)
> +		return NULL;
> +
> +	if (mas_preallocate(&pa->mas, GFP_KERNEL)) {

mas_preallocate() needs a valid tree field to calculate the number
of nodes to pre-allocate. I guess we're missing a MA_STATE_INIT() here,
and we need to pass a gpuva_mgr object to this helper.

> +		kfree(pa);
> +		return NULL;
> +	}
> +
> +	return pa;
> +}
> +EXPORT_SYMBOL(drm_gpuva_prealloc_create);



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux