[Intel-gfx] [PATCH 04/15] drm/i915: introduce gem object page_sizes
Chris Wilson
chris at chris-wilson.co.uk
Wed May 31 19:25:45 UTC 2017
On Wed, May 31, 2017 at 07:51:59PM +0100, Matthew Auld wrote:
> err = mutex_lock_interruptible(&obj->mm.lock);
> @@ -2533,7 +2543,33 @@ int __i915_gem_object_get_pages(struct drm_i915_gem_object *obj)
>
> unlock:
> mutex_unlock(&obj->mm.lock);
> - return err;
> +
> + if (err)
> + return err;
> +
> + for_each_sg(obj->mm.pages->sgl, sg, obj->mm.pages->nents, i)
> + sg_mask |= sg->length;
This is the worst place to put a loop over sg. Not only is this
synchronous, but pages may not have been allocated yet. Using
set_pages was at least correct in that regard! The interface I will keep
nagging for is for each task to compute sg_mask as they populate the
scatterlist, and then they pass sg_mask to
__i915_gem_object_set_pages() alongside the pages.
Since this didn't fail BAT, that only means we do not have any userptr
tests there...
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list