From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH 01/11] drm/i915: Move gtt and ppgtt under address space umbrella Date: Thu, 11 Jul 2013 14:14:06 +0300 Message-ID: <1373541246.12949.4.camel@intelbox> References: <1373350122-5118-1-git-send-email-ben@bwidawsk.net> <1373350122-5118-2-git-send-email-ben@bwidawsk.net> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0070445301==" Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 84761E64B2 for ; Thu, 11 Jul 2013 04:14:29 -0700 (PDT) In-Reply-To: <1373350122-5118-2-git-send-email-ben@bwidawsk.net> 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: Ben Widawsky Cc: Intel GFX List-Id: intel-gfx@lists.freedesktop.org --===============0070445301== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-rS4tF9mf3sSCl2SM2AG8" --=-rS4tF9mf3sSCl2SM2AG8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2013-07-08 at 23:08 -0700, Ben Widawsky wrote: > The GTT and PPGTT can be thought of more generally as GPU address > spaces. Many of their actions (insert entries), state (LRU lists) and > many of their characteristics (size), can be shared. Do that. >=20 > The change itself doesn't actually impact most of the VMA/VM rework > coming up, it just fits in with the grand scheme. GGTT will usually be a > special case where we either know an object must be in the GGTT (dislay > engine, workarounds, etc.). >=20 > v2: Drop usage of i915_gtt_vm (Daniel) > Make cleanup also part of the parent class (Ben) > Modified commit msg > Rebased >=20 > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/i915_debugfs.c | 4 +- > drivers/gpu/drm/i915/i915_dma.c | 4 +- > drivers/gpu/drm/i915/i915_drv.h | 57 ++++++------- > drivers/gpu/drm/i915/i915_gem.c | 4 +- > drivers/gpu/drm/i915/i915_gem_gtt.c | 162 ++++++++++++++++++++----------= ------ > 5 files changed, 121 insertions(+), 110 deletions(-) >=20 >[...] > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i= 915_gem_gtt.c > index 242d0f9..693115a 100644 > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c > @@ -102,7 +102,7 @@ static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr, > =20 > static void gen6_write_pdes(struct i915_hw_ppgtt *ppgtt) > { > - struct drm_i915_private *dev_priv =3D ppgtt->dev->dev_private; > + struct drm_i915_private *dev_priv =3D ppgtt->base.dev->dev_private; > gen6_gtt_pte_t __iomem *pd_addr; > uint32_t pd_entry; > int i; > @@ -181,18 +181,18 @@ static int gen6_ppgtt_enable(struct drm_device *dev= ) > } > =20 > /* PPGTT support for Sandybdrige/Gen6 and later */ > -static void gen6_ppgtt_clear_range(struct i915_hw_ppgtt *ppgtt, > +static void gen6_ppgtt_clear_range(struct i915_address_space *vm, > unsigned first_entry, > unsigned num_entries) > { > - struct drm_i915_private *dev_priv =3D ppgtt->dev->dev_private; > + struct i915_hw_ppgtt *ppgtt =3D > + container_of(vm, struct i915_hw_ppgtt, base); > gen6_gtt_pte_t *pt_vaddr, scratch_pte; > unsigned act_pt =3D first_entry / I915_PPGTT_PT_ENTRIES; > unsigned first_pte =3D first_entry % I915_PPGTT_PT_ENTRIES; > unsigned last_pte, i; > =20 > - scratch_pte =3D ppgtt->pte_encode(dev_priv->gtt.scratch.addr, > - I915_CACHE_LLC); > + scratch_pte =3D vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC); I only see ggtt's scratch page being initialized, but can't find the corresponding init/teardown for ppgtt. Btw, why do we need separate global/per-process scratch pages? (would be nice to add it to the commit message) --Imre --=-rS4tF9mf3sSCl2SM2AG8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQEcBAABAgAGBQJR3pN+AAoJEORIIAnNuWDFHXUH/jlEV9mHCoOTyTn23zCb1Q23 7h9AHoBGnnVhy3IovjvOkQxS28guJIV2giVgCtmkgYXmY2TueR4kik9ZaPpL99LE W1EHPMKVbIsXqHYrHMl1K1ObAh8Y+ogXDBLvgoFwI2m16tkSTHEPjLp5jOu66oF2 hFh1qwtdEC/SfybgBjkGFrO6dKRfIaiFGvAg0Dua+jJBFmXnPCRSFcCeVBt08Iex AvhwBBI87IdF/uJqnD1yXR/Ab6RETYzlM9/l5JEMHRkGitXkc4ZljtnwELCR5c3d s9kJeZ/c87RcYaXfvA7vjczw8M4DQL8SG1+kkwhm7/IGa92UNjOH7T9sHYOCweM= =uGJr -----END PGP SIGNATURE----- --=-rS4tF9mf3sSCl2SM2AG8-- --===============0070445301== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0070445301==--