Re: [PATCH 2/4] drm/i915: Support for creating Stolen memory backed objects

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

 



On Tue, Sep 15, 2015 at 02:03:25PM +0530, ankitprasad.r.sharma@xxxxxxxxx wrote:
>  i915_gem_create(struct drm_file *file,
>  		struct drm_device *dev,
>  		uint64_t size,
> +		uint32_t flags,
>  		uint32_t *handle_p)
>  {
>  	struct drm_i915_gem_object *obj;
> @@ -385,8 +386,31 @@ i915_gem_create(struct drm_file *file,
>  	if (size == 0)
>  		return -EINVAL;
>  
> +	if (flags & __I915_CREATE_UNKNOWN_FLAGS)
> +		return -EINVAL;
> +
>  	/* Allocate the new object */
> -	obj = i915_gem_alloc_object(dev, size);
> +	if (flags & I915_CREATE_PLACEMENT_STOLEN) {
> +		mutex_lock(&dev->struct_mutex);
> +		obj = i915_gem_object_create_stolen(dev, size);
> +		if (!obj) {
> +			mutex_unlock(&dev->struct_mutex);
> +			return -ENOMEM;

Note that you should change the i915_gem_object_create_stolen() to
report the precise error, as with the eviction support we may trigger
EINTR. Also ENOSPC will be preferrable for requesting a larger stolen
object than the available space (to help distinguish between true oom).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux