Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: don't assume struct page in i915_sg_trim
Date: Thu, 20 Sep 2018 17:38:28 +0300	[thread overview]
Message-ID: <20180920143828.GO5565@intel.com> (raw)
In-Reply-To: <20180920142707.19659-1-matthew.auld@intel.com>

On Thu, Sep 20, 2018 at 03:27:06PM +0100, Matthew Auld wrote:
> Which means we can now also put it to work in fake_get_huge_pages.

Just another reminder to write self-contained commit msgs. Reading
this wihtout copy pasting the subject line in makes one wonder
what the "which" is here.

> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c             | 4 +++-
>  drivers/gpu/drm/i915/selftests/huge_pages.c | 2 ++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index a94d5a308c4d..b79362bbd97b 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2506,7 +2506,9 @@ static bool i915_sg_trim(struct sg_table *orig_st)
>  	new_sg = new_st.sgl;
>  	for_each_sg(orig_st->sgl, sg, orig_st->nents, i) {
>  		sg_set_page(new_sg, sg_page(sg), sg->length, 0);
> -		/* called before being DMA mapped, no need to copy sg->dma_* */
> +		sg_dma_address(new_sg) = sg_dma_address(sg);
> +		sg_dma_len(new_sg) = sg_dma_len(sg);
> +
>  		new_sg = sg_next(new_sg);
>  	}
>  	GEM_BUG_ON(new_sg); /* Should walk exactly nents and hit the end */
> diff --git a/drivers/gpu/drm/i915/selftests/huge_pages.c b/drivers/gpu/drm/i915/selftests/huge_pages.c
> index e272127783fe..8d03f64eabd7 100644
> --- a/drivers/gpu/drm/i915/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/selftests/huge_pages.c
> @@ -235,6 +235,8 @@ static int fake_get_huge_pages(struct drm_i915_gem_object *obj)
>  		sg = sg_next(sg);
>  	} while (1);
>  
> +	i915_sg_trim(st);
> +
>  	obj->mm.madv = I915_MADV_DONTNEED;
>  
>  	__i915_gem_object_set_pages(obj, st, sg_page_sizes);
> -- 
> 2.17.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-09-20 14:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 14:27 [PATCH 1/2] drm/i915: don't assume struct page in i915_sg_trim Matthew Auld
2018-09-20 14:27 ` [PATCH 2/2] drm/i915: pass dev_priv to i915_gem_cleanup_stolen Matthew Auld
2018-09-20 14:34   ` Chris Wilson
2018-09-20 14:33 ` [PATCH 1/2] drm/i915: don't assume struct page in i915_sg_trim Chris Wilson
2018-09-20 14:38 ` Ville Syrjälä [this message]
2018-09-20 15:42   ` Chris Wilson
2018-09-20 14:49 ` Tvrtko Ursulin
2018-09-20 14:57 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork

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=20180920143828.GO5565@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@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