On Thu, 2 Jan 2020 at 10:38, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote: > > Create a vmap for discontinguous lmem objects to support > i915_gem_object_pin_map(). Yes, please. > > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Cc: Matthew Auld <matthew.auld@xxxxxxxxx> > --- [snip] > @@ -288,12 +284,28 @@ static void *i915_gem_object_map(struct drm_i915_gem_object *obj, > pgprot = pgprot_writecombine(PAGE_KERNEL_IO); > break; > } > - addr = vmap(pages, n_pages, 0, pgprot); > > - if (pages != stack_pages) > - kvfree(pages); > + if (i915_gem_object_has_struct_page(obj)) { > + struct sgt_iter iter; > + struct page *page; > + pte_t **ptes = mem; > + > + for_each_sgt_page(page, iter, sgt) > + **ptes++ = mk_pte(page, pgprot); > + } else { > + const resource_size_t iomap = obj->mm.region->iomap.base; > + struct sgt_iter iter; > + dma_addr_t addr; > + pte_t **ptes = mem; > + > + for_each_sgt_daddr(addr, iter, sgt) addr -= region.start; for poor old fake local-memory. > + **ptes++ = iomap_pte(iomap, addr, pgprot); _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx