public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: Support appending to the rotated pages mapping
Date: Mon, 21 Sep 2015 14:07:46 +0300	[thread overview]
Message-ID: <1442833666.24060.3.camel@linux.intel.com> (raw)
In-Reply-To: <1442828735-9448-3-git-send-email-tvrtko.ursulin@linux.intel.com>

Hi,

On ma, 2015-09-21 at 10:45 +0100, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> By providing a start offset into the source array of pages, and
> returning the
> end position in the scatter-gather table, we will be able to append
> the UV
> plane to the rotated mapping in later patches.
> 
> v2: Rebase.
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 21 +++++++++++++--------
>  1 file changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c
> b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 87862813cfde..59c934fb9230 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3234,15 +3234,18 @@ i915_gem_obj_lookup_or_create_ggtt_vma(struct
> drm_i915_gem_object *obj,
>  
>  }
>  
> -static void
> -rotate_pages(dma_addr_t *in, unsigned int width, unsigned int
> height,
> -	     struct sg_table *st)
> +static struct scatterlist *
> +rotate_pages(dma_addr_t *in, unsigned int offset,
> +	     unsigned int width, unsigned int height,
> +	     struct sg_table *st, struct scatterlist *sg)
>  {
>  	unsigned int column, row;
>  	unsigned int src_idx;
> -	struct scatterlist *sg = st->sgl;
>  
> -	st->nents = 0;
> +	if (!sg) {
> +		st->nents = 0;
> +		sg = st->sgl;
> +	}
>  
>  	for (column = 0; column < width; column++) {
>  		src_idx = width * (height - 1) + column;
> @@ -3253,12 +3256,14 @@ rotate_pages(dma_addr_t *in, unsigned int
> width, unsigned int height,
>  			 * The only thing we need are DMA addresses.
>  			 */
>  			sg_set_page(sg, NULL, PAGE_SIZE, 0);
> -			sg_dma_address(sg) = in[src_idx];
> +			sg_dma_address(sg) = in[offset + src_idx];
>  			sg_dma_len(sg) = PAGE_SIZE;
>  			sg = sg_next(sg);
>  			src_idx -= width;
>  		}
>  	}
> +
> +	return sg;
>  }
>  
>  static struct sg_table *
> @@ -3296,9 +3301,9 @@ intel_rotate_fb_obj_pages(struct i915_ggtt_view
> *ggtt_view,
>  	}
>  
>  	/* Rotate the pages. */
> -	rotate_pages(page_addr_list,
> +	rotate_pages(page_addr_list, 0,
>  		     rot_info->width_pages, rot_info->height_pages,
> -		     st);
> +		     st, NULL);
>  
>  	DRM_DEBUG_KMS(
>  		      "Created rotated page mapping for object size
> %zu (pitch=%u, height=%u, pixel_format=0x%x, %ux%u tiles, %u
> pages).\n",
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-09-21 11:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21  9:45 [PATCH 0/4] NV12 rotation GTT handling prep work Tvrtko Ursulin
2015-09-21  9:45 ` [PATCH 1/4] drm/i915: Support planar formats in tile height calculations Tvrtko Ursulin
2015-09-21 10:57   ` Joonas Lahtinen
2015-09-21  9:45 ` [PATCH 2/4] drm/i915: Support appending to the rotated pages mapping Tvrtko Ursulin
2015-09-21 11:07   ` Joonas Lahtinen [this message]
2015-09-21  9:45 ` [PATCH 3/4] drm/i915: Support NV12 in rotated GGTT mapping Tvrtko Ursulin
2015-09-21 11:14   ` Joonas Lahtinen
2015-09-23 15:31     ` Daniel Vetter
2015-09-24 16:35   ` Ville Syrjälä
2015-09-25  9:44     ` Tvrtko Ursulin
2015-09-25 11:29       ` Ville Syrjälä
2015-09-28  8:37         ` Daniel Vetter
2015-09-28 12:41           ` Ville Syrjälä
2015-09-21  9:45 ` [PATCH 4/4] drm/i915: Enable querying offset of UV plane with intel_plane_obj_offset Tvrtko Ursulin
2015-09-21 11:19   ` Joonas Lahtinen
2015-09-21 12:18 ` [PATCH 0/4] NV12 rotation GTT handling prep work Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2015-08-03 10:54 [PATCH v2 0/8] NV12 90/270 rotated GGTT mapping Tvrtko Ursulin
2015-08-03 10:54 ` [PATCH 2/4] drm/i915: Support appending to the rotated pages mapping Tvrtko Ursulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1442833666.24060.3.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox