Commit 87130255 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Pass stride to rotate_pages()

Pass stride in addition to width and height to rotate_pages(). For now
width and stride are the same, but once framebuffer offsets enter the
scene that may no longer be the case.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1453316739-13296-3-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 7723f47d
...@@ -3348,6 +3348,7 @@ i915_gem_obj_lookup_or_create_ggtt_vma(struct drm_i915_gem_object *obj, ...@@ -3348,6 +3348,7 @@ i915_gem_obj_lookup_or_create_ggtt_vma(struct drm_i915_gem_object *obj,
static struct scatterlist * static struct scatterlist *
rotate_pages(const dma_addr_t *in, unsigned int offset, rotate_pages(const dma_addr_t *in, unsigned int offset,
unsigned int width, unsigned int height, unsigned int width, unsigned int height,
unsigned int stride,
struct sg_table *st, struct scatterlist *sg) struct sg_table *st, struct scatterlist *sg)
{ {
unsigned int column, row; unsigned int column, row;
...@@ -3359,7 +3360,7 @@ rotate_pages(const dma_addr_t *in, unsigned int offset, ...@@ -3359,7 +3360,7 @@ rotate_pages(const dma_addr_t *in, unsigned int offset,
} }
for (column = 0; column < width; column++) { for (column = 0; column < width; column++) {
src_idx = width * (height - 1) + column; src_idx = stride * (height - 1) + column;
for (row = 0; row < height; row++) { for (row = 0; row < height; row++) {
st->nents++; st->nents++;
/* We don't need the pages, but need to initialize /* We don't need the pages, but need to initialize
...@@ -3370,7 +3371,7 @@ rotate_pages(const dma_addr_t *in, unsigned int offset, ...@@ -3370,7 +3371,7 @@ rotate_pages(const dma_addr_t *in, unsigned int offset,
sg_dma_address(sg) = in[offset + src_idx]; sg_dma_address(sg) = in[offset + src_idx];
sg_dma_len(sg) = PAGE_SIZE; sg_dma_len(sg) = PAGE_SIZE;
sg = sg_next(sg); sg = sg_next(sg);
src_idx -= width; src_idx -= stride;
} }
} }
...@@ -3423,6 +3424,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, ...@@ -3423,6 +3424,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,
/* Rotate the pages. */ /* Rotate the pages. */
sg = rotate_pages(page_addr_list, 0, sg = rotate_pages(page_addr_list, 0,
rot_info->width_pages, rot_info->height_pages, rot_info->width_pages, rot_info->height_pages,
rot_info->width_pages,
st, NULL); st, NULL);
/* Append the UV plane if NV12. */ /* Append the UV plane if NV12. */
...@@ -3438,6 +3440,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view, ...@@ -3438,6 +3440,7 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view *ggtt_view,
rotate_pages(page_addr_list, uv_start_page, rotate_pages(page_addr_list, uv_start_page,
rot_info->width_pages_uv, rot_info->width_pages_uv,
rot_info->height_pages_uv, rot_info->height_pages_uv,
rot_info->width_pages_uv,
st, sg); st, sg);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment