Quoting Joonas Lahtinen (2017-11-16 10:43:42) > On Tue, 2017-11-14 at 19:11 +0000, Chris Wilson wrote: > > The object already stores (computed on the fly) the index to dma address > > so use it instead of reallocating a large temporary array every time we > > bind a rotated framebuffer. > > > > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > > Cc: Matthew Auld <matthew.william.auld@xxxxxxxxx> > > Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> > > <SNIP> > > > @@ -3665,27 +3665,32 @@ void i915_gem_restore_gtt_mappings(struct drm_i915_private *dev_priv) > > } > > > > static struct scatterlist * > > -rotate_pages(const dma_addr_t *in, unsigned int offset, > > - unsigned int width, unsigned int height, > > - unsigned int stride, > > +rotate_pages(struct drm_i915_gem_object *obj, > > + const struct intel_rotation_plane_info *p, > > struct sg_table *st, struct scatterlist *sg) > > { > > unsigned int column, row; > > - unsigned int src_idx; > > > > - for (column = 0; column < width; column++) { > > - src_idx = stride * (height - 1) + column; > > - for (row = 0; row < height; row++) { > > - st->nents++; > > + for (column = 0; column < p->width; column++) { > > + unsigned long src_idx = > > + p->stride * (p->height - 1) + column + p->offset; > > Wouldn't you rather do offset + ...? It's the most dominating factor. Yes. p->offset matches image in the (image, row, column) hierarchy. It just happens that when I was playing with the selftests, I used very small (and unrealistic) offsets. -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx