From mboxrd@z Thu Jan 1 00:00:00 1970 From: Imre Deak Subject: Re: [PATCH .5/9] drm/i915: Move ppgtt_release out of the header Date: Mon, 24 Feb 2014 18:18:33 +0200 Message-ID: <1393258713.13131.122.camel@intelbox> References: <1392876349-24684-2-git-send-email-benjamin.widawsky@intel.com> <1392925627-6033-1-git-send-email-benjamin.widawsky@intel.com> Reply-To: imre.deak@intel.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0733042962==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 47025FAB2A for ; Mon, 24 Feb 2014 08:19:25 -0800 (PST) In-Reply-To: <1392925627-6033-1-git-send-email-benjamin.widawsky@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Ben Widawsky Cc: Intel GFX , Ben Widawsky List-Id: intel-gfx@lists.freedesktop.org --===============0733042962== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-+ZnzRDHkuuYPKnY3JIAb" --=-+ZnzRDHkuuYPKnY3JIAb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2014-02-20 at 11:47 -0800, Ben Widawsky wrote: > At one time it was expected to be called in multiple places by kref_put. > At the current time however, it is all contained within > i915_gem_context.c. >=20 > This patch makes an upcoming required addition a bit nicer since it too > doesn't need to be defined in a header file. >=20 > Signed-off-by: Ben Widawsky Reviewed-by: Imre Deak > --- > drivers/gpu/drm/i915/i915_drv.h | 36 ---------------------------= ------ > drivers/gpu/drm/i915/i915_gem_context.c | 36 +++++++++++++++++++++++++++= ++++++ > 2 files changed, 36 insertions(+), 36 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_= drv.h > index 8c64831..57556fb 100644 > --- a/drivers/gpu/drm/i915/i915_drv.h > +++ b/drivers/gpu/drm/i915/i915_drv.h > @@ -2387,42 +2387,6 @@ static inline bool intel_enable_ppgtt(struct drm_d= evice *dev, bool full) > return HAS_ALIASING_PPGTT(dev); > } > =20 > -static inline void ppgtt_release(struct kref *kref) > -{ > - struct i915_hw_ppgtt *ppgtt =3D container_of(kref, struct i915_hw_ppgtt= , ref); > - struct drm_device *dev =3D ppgtt->base.dev; > - struct drm_i915_private *dev_priv =3D dev->dev_private; > - struct i915_address_space *vm =3D &ppgtt->base; > - > - if (ppgtt =3D=3D dev_priv->mm.aliasing_ppgtt || > - (list_empty(&vm->active_list) && list_empty(&vm->inactive_list))) { > - ppgtt->base.cleanup(&ppgtt->base); > - return; > - } > - > - /* > - * Make sure vmas are unbound before we take down the drm_mm > - * > - * FIXME: Proper refcounting should take care of this, this shouldn't b= e > - * needed at all. > - */ > - if (!list_empty(&vm->active_list)) { > - struct i915_vma *vma; > - > - list_for_each_entry(vma, &vm->active_list, mm_list) > - if (WARN_ON(list_empty(&vma->vma_link) || > - list_is_singular(&vma->vma_link))) > - break; > - > - i915_gem_evict_vm(&ppgtt->base, true); > - } else { > - i915_gem_retire_requests(dev); > - i915_gem_evict_vm(&ppgtt->base, false); > - } > - > - ppgtt->base.cleanup(&ppgtt->base); > -} > - > /* i915_gem_stolen.c */ > int i915_gem_init_stolen(struct drm_device *dev); > int i915_gem_stolen_setup_compression(struct drm_device *dev, int size); > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i9= 15/i915_gem_context.c > index f8c21a6..171a2ef 100644 > --- a/drivers/gpu/drm/i915/i915_gem_context.c > +++ b/drivers/gpu/drm/i915/i915_gem_context.c > @@ -99,6 +99,42 @@ > static int do_switch(struct intel_ring_buffer *ring, > struct i915_hw_context *to); > =20 > +static void ppgtt_release(struct kref *kref) > +{ > + struct i915_hw_ppgtt *ppgtt =3D container_of(kref, struct i915_hw_ppgtt= , ref); > + struct drm_device *dev =3D ppgtt->base.dev; > + struct drm_i915_private *dev_priv =3D dev->dev_private; > + struct i915_address_space *vm =3D &ppgtt->base; > + > + if (ppgtt =3D=3D dev_priv->mm.aliasing_ppgtt || > + (list_empty(&vm->active_list) && list_empty(&vm->inactive_list))) { > + ppgtt->base.cleanup(&ppgtt->base); > + return; > + } > + > + /* > + * Make sure vmas are unbound before we take down the drm_mm > + * > + * FIXME: Proper refcounting should take care of this, this shouldn't b= e > + * needed at all. > + */ > + if (!list_empty(&vm->active_list)) { > + struct i915_vma *vma; > + > + list_for_each_entry(vma, &vm->active_list, mm_list) > + if (WARN_ON(list_empty(&vma->vma_link) || > + list_is_singular(&vma->vma_link))) > + break; > + > + i915_gem_evict_vm(&ppgtt->base, true); > + } else { > + i915_gem_retire_requests(dev); > + i915_gem_evict_vm(&ppgtt->base, false); > + } > + > + ppgtt->base.cleanup(&ppgtt->base); > +} > + > static size_t get_context_alignment(struct drm_device *dev) > { > if (IS_GEN6(dev)) --=-+ZnzRDHkuuYPKnY3JIAb 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.14 (GNU/Linux) iQEcBAABAgAGBQJTC3DZAAoJEORIIAnNuWDF734H/jiMC9pCSSJZO/tpVDxhjcZ0 om+VEPzqne0t3mmEu6TkVnS8XyQwpjHxc/TtNizOclT0j6RqVDAq7UpMSSgzQvo9 2D/laynYtmsgtPFB0knj2qvMvuGBlN84L3+DBEgf+5iQoLH9uxdL+r2nFha+awQ2 BtG0RStibUOT28EqI2LorMJGMwdBWU1PTVQT9ezIbRkc/ALsgAcm/chs3GsrqR/o slzGelN3+w3i+khwglb7+OZS8CQTaDF8NMl6SDTEMFMmM4plvOjJpgkpic5LrNQ+ YtKpyJGYgMfzPP1KIfuKLr5C+SjKSm9RD1CzkCTOeCL6aZTwT7aERi5q/mZ2r1w= =Xwaz -----END PGP SIGNATURE----- --=-+ZnzRDHkuuYPKnY3JIAb-- --===============0733042962== 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 --===============0733042962==--