From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenneth Graunke 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 Message-ID: <51F7FA39.8000908@whitecape.org> References: <1375203516-8023-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from hapkido.dreamhost.com (hapkido.dreamhost.com [66.33.216.122]) by gabe.freedesktop.org (Postfix) with ESMTP id 99E59E5DE5 for ; Tue, 30 Jul 2013 10:39:28 -0700 (PDT) Received: from homiemail-a62.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by hapkido.dreamhost.com (Postfix) with ESMTP id 4A61C3B0F7B for ; Tue, 30 Jul 2013 10:39:28 -0700 (PDT) In-Reply-To: <1375203516-8023-1-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org 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 > Cc: Ben Widawsky > --- > 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