Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kenneth Graunke <kenneth@whitecape.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, Ben Widawsky <ben@bwidawsk.net>
Subject: Re: [PATCH 1/2] drm/i915: Use the same pte_encoding for ppgtt as for gtt
Date: Tue, 30 Jul 2013 10:39:05 -0700	[thread overview]
Message-ID: <51F7FA39.8000908@whitecape.org> (raw)
In-Reply-To: <1375203516-8023-1-git-send-email-chris@chris-wilson.co.uk>

On 07/30/2013 09:58 AM, Chris Wilson wrote:
> The PTE layouts are the same for both ppgtt and gtt, so we can simplify
> the setup for ppgtt by copying the encoding function pointer from gtt.
> This prevents bugs where we update one function pointer, but forget the
> other.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ben Widawsky <ben@bwidawsk.net>
> ---
>   drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +-------
>   1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 1294cee..0522d00 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -298,13 +298,7 @@ static int gen6_ppgtt_init(struct i915_hw_ppgtt *ppgtt)
>   	 * now. */
>   	first_pd_entry_in_global_pt = gtt_total_entries(dev_priv->gtt);
>
> -	if (IS_HASWELL(dev)) {
> -		ppgtt->base.pte_encode = hsw_pte_encode;
> -	} else if (IS_VALLEYVIEW(dev)) {
> -		ppgtt->base.pte_encode = byt_pte_encode;
> -	} else {
> -		ppgtt->base.pte_encode = gen6_pte_encode;
> -	}
> +	ppgtt->base.pte_encode = dev_priv->gtt.base.pte_encode;
>   	ppgtt->num_pd_entries = GEN6_PPGTT_PD_ENTRIES;
>   	ppgtt->enable = gen6_ppgtt_enable;
>   	ppgtt->base.clear_range = gen6_ppgtt_clear_range;

This is much nicer than my old code - thanks!

It might be worth mentioning in the commit message that in particular, 
iris_pte_encode was forgotten here.  Either way,

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

  parent reply	other threads:[~2013-07-30 17:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 16:58 [PATCH 1/2] drm/i915: Use the same pte_encoding for ppgtt as for gtt Chris Wilson
2013-07-30 16:58 ` [PATCH 2/2] drm/i915: Use Write-Through cacheing for the display plane on Iris Chris Wilson
2013-07-30 17:19   ` Ville Syrjälä
2013-07-30 17:36     ` Chris Wilson
2013-07-30 18:01       ` Ville Syrjälä
2013-07-30 18:10         ` Chris Wilson
2013-07-30 18:29           ` Chris Wilson
2013-07-30 17:45     ` [PATCH] " Chris Wilson
2013-07-30 19:25       ` Chris Wilson
2013-07-31 13:16         ` Ville Syrjälä
2013-07-31 13:36           ` Chris Wilson
2013-07-31 15:16             ` Ville Syrjälä
2013-07-31 15:26               ` Chris Wilson
2013-07-31 15:54                 ` Ville Syrjälä
2013-07-31 16:14                   ` Chris Wilson
2013-07-30 17:39   ` [PATCH 2/2] " Kenneth Graunke
2013-07-30 17:39 ` Kenneth Graunke [this message]
2013-07-30 18:04 ` [PATCH] drm/i915: Use the same pte_encoding for ppgtt as for gtt Chris Wilson
2013-07-31  7:42   ` Ben Widawsky

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=51F7FA39.8000908@whitecape.org \
    --to=kenneth@whitecape.org \
    --cc=ben@bwidawsk.net \
    --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