[PATCH v3 04/37] drm/i915/region: support continuous allocations

Chris Wilson chris at chris-wilson.co.uk
Sat Aug 10 10:22:00 UTC 2019


Quoting Matthew Auld (2019-08-09 23:26:10)
> Some objects may need to be allocated as a continuous block, thinking
> ahead the various kernel io_mapping interfaces seem to expect it.

But we could always use scattergather over top...

> @@ -98,10 +101,12 @@ i915_gem_object_get_pages_buddy(struct drm_i915_gem_object *obj)
>  }
>  
>  void i915_gem_object_init_memory_region(struct drm_i915_gem_object *obj,
> -                                       struct intel_memory_region *mem)
> +                                       struct intel_memory_region *mem,
> +                                       unsigned long flags)
>  {
>         INIT_LIST_HEAD(&obj->mm.blocks);
>         obj->mm.region= mem;
> +       obj->flags = flags;
>  
>         mutex_lock(&mem->obj_lock);
>         list_add(&obj->mm.region_link, &mem->objects);
> @@ -125,6 +130,9 @@ i915_gem_object_create_region(struct intel_memory_region *mem,
>         if (!mem)
>                 return ERR_PTR(-ENODEV);
>  
> +       if (flags & ~I915_BO_ALLOC_FLAGS)
> +               return ERR_PTR(-EINVAL);

This is a programmer error not a user.

> +
>         size = round_up(size, mem->min_page_size);


More information about the dri-devel mailing list