On Thu, Oct 13, 2016 at 10:04:02AM +0100, Tvrtko Ursulin wrote:
> -     src = obj->pages->sgl;
> -     dst = st->sgl;
> -     for (i = 0; i < obj->pages->nents; i++) {
> -             sg_set_page(dst, sg_page(src), src->length, 0);
> -             dst = sg_next(dst);
> -             src = sg_next(src);
> -     }
> +     for_each_sgt_page(page, sgt_iter, obj->pages)
> +             i915_sg_add_page(state, page);

This (and partial_pages) can just copy the existing compact obj->pages.
The previous code should already be as compact as its input. And that is
not a simpler loop!
-Chris

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

Reply via email to