[Intel-gfx] [PATCH 17/42] drm/i915: Pass around sg_table to get_pages/put_pages backend

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Fri Oct 14 09:12:32 UTC 2016


On pe, 2016-10-07 at 10:46 +0100, Chris Wilson wrote:
> @@ -2376,6 +2374,19 @@ __deprecated
>  extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *);
>  
>  static inline bool
> +i915_gem_object_is_dead(const struct drm_i915_gem_object *obj)
> +{
> +	return atomic_read(&obj->base.refcount.refcount) == 0;
> +}

Seems like this ought to be in DRM? Todo item.

> +
> +#if IS_ENABLED(CONFIG_LOCKDEP)
> +#define lockdep_assert_held_unless(lock, cond) \
> +	GEM_BUG_ON(!lockdep_is_held(lock) && !(cond))
> +#else
> +#define lockdep_assert_held_unless(lock, cond)
> +#endif

Ugh.

> @@ -646,21 +647,22 @@ i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj)
>  
>  	active = false;
>  	if (pinned < 0)
> -		ret = pinned, pinned = 0;
> +		pages = ERR_PTR(pinned), pinned = 0;

Just convert to curly braces.

> 	else if (pinned < num_pages)
> -		ret = __i915_gem_userptr_get_pages_schedule(obj, &active);
> +		pages = __i915_gem_userptr_get_pages_schedule(obj, &active);
>  	else
> -		ret = __i915_gem_userptr_set_pages(obj, pvec, num_pages);
> -	if (ret) {
> +		pages = __i915_gem_userptr_set_pages(obj, pvec, num_pages);
> +	if (IS_ERR(pages)) {
>  		__i915_gem_userptr_set_active(obj, active);
>  		release_pages(pvec, pinned, 0);
>  	}
>  	drm_free_large(pvec);
> -	return ret;
> +	return pages;
>  }
>  

Horrible patch to review, mix of different changes all in one.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regars, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list