From patchwork Sat Apr 27 09:53:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Xiong Y" X-Patchwork-Id: 2496971 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id D5AC9DF23A for ; Sat, 27 Apr 2013 09:53:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D5CDE6307 for ; Sat, 27 Apr 2013 02:53:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 2857FE5C4E for ; Sat, 27 Apr 2013 02:53:37 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 27 Apr 2013 02:53:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,562,1363158000"; d="scan'208";a="303910852" Received: from fmsmsx108.amr.corp.intel.com ([10.19.9.228]) by orsmga001.jf.intel.com with ESMTP; 27 Apr 2013 02:53:36 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.19.17.221) by FMSMSX108.amr.corp.intel.com (10.19.9.228) with Microsoft SMTP Server (TLS) id 14.1.355.2; Sat, 27 Apr 2013 02:53:35 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by fmsmsx152.amr.corp.intel.com (10.19.17.221) with Microsoft SMTP Server (TLS) id 14.1.355.2; Sat, 27 Apr 2013 02:53:35 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.170]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.01.0355.002; Sat, 27 Apr 2013 17:53:33 +0800 From: "Zhang, Xiong Y" To: "intel-gfx@lists.freedesktop.org" Thread-Topic: [Intel-gfx] [PATCH] drm/i915: correct the calculation of first_pd_entry_in_global_pt Thread-Index: Ac5DLRPdY6TrRbFLQ2GzYgf5pPrsrg== Date: Sat, 27 Apr 2013 09:53:33 +0000 Message-ID: <8082FF9BCB2B054996454E47167FF4EC0165CC32@SHSMSX102.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915: correct the calculation of first_pd_entry_in_global_pt X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org When ppgtt is enabled, dev_priv->gtt.total has excluded the gtt space occupied by ppgtt table in i915_gem_init_global_gtt() function. So the calculation of first_pd_entry_in_global_pt doesn't need to subtract I915_PPGTT_PD_ENTRIES again. Or else PPGTT directory table will be destroyed by global gtt allocation. Signed-off-by: Xiong Zhang diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index ce024bd..3cd48e2 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -258,8 +258,7 @@ static int gen6_ppgtt_init(struct i915_hw_ppgtt *ppgtt) /* ppgtt PDEs reside in the global gtt pagetable, which has 512*1024 * entries. For aliasing ppgtt support we just steal them at the end for * now. */ - first_pd_entry_in_global_pt = - gtt_total_entries(dev_priv->gtt) - I915_PPGTT_PD_ENTRIES; + first_pd_entry_in_global_pt = gtt_total_entries(dev_priv->gtt); if (IS_HASWELL(dev)) { ppgtt->pte_encode = hsw_pte_encode;