Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Remove temporary allocation of dma addresses when rotating
Date: Thu, 16 Nov 2017 12:43:42 +0200	[thread overview]
Message-ID: <1510829022.5503.8.camel@linux.intel.com> (raw)
In-Reply-To: <20171114191135.26205-2-chris@chris-wilson.co.uk>

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@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.william.auld@gmail.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

<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.

> +		for (row = 0; row < p->height; row++) {
> +			struct scatterlist *src;
> +			unsigned int n;
> +
> +			src = i915_gem_object_get_sg(obj, src_idx, &n);

It's bit confusing that the arguments are "n" and "offset" and "n" is
passed as "offset", so maybe s/n/sg_offset/. With that sorted out;

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

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-11-16 10:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 19:11 [PATCH 1/2] drm/i915: Drop the unbound page cache upon idling Chris Wilson
2017-11-14 19:11 ` [PATCH 2/2] drm/i915: Remove temporary allocation of dma addresses when rotating Chris Wilson
2017-11-16 10:43   ` Joonas Lahtinen [this message]
2017-11-16 11:17     ` Chris Wilson
2017-11-14 19:50 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Drop the unbound page cache upon idling Patchwork
2017-11-14 22:44 ` ✗ Fi.CI.IGT: warning " Patchwork
2017-11-16 10:11 ` [PATCH 1/2] " Joonas Lahtinen

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=1510829022.5503.8.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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