From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 08/15] drm/i915: re-order ppgtt sanitize logic v2 Date: Wed, 6 Aug 2014 10:22:42 +0200 Message-ID: <20140806082242.GV8727@phenom.ffwll.local> References: <1407250286-1801-1-git-send-email-rodrigo.vivi@intel.com> <1407250286-1801-9-git-send-email-rodrigo.vivi@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EAE96E5C0 for ; Wed, 6 Aug 2014 01:22:30 -0700 (PDT) Received: by mail-wi0-f170.google.com with SMTP id f8so9235668wiw.3 for ; Wed, 06 Aug 2014 01:22:30 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1407250286-1801-9-git-send-email-rodrigo.vivi@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, Aug 05, 2014 at 07:51:19AM -0700, Rodrigo Vivi wrote: > From: Jesse Barnes > > Put hw limitations first, disabling ppgtt if necessary right away. > After that, check user passed args or auto-detect and do the right > thing, falling back to aliasing PPGTT if the user tries to enable full > PPGTT but it isn't available. > > v2: simplify auto-detect case since we already caught the no PPGTT case early > on (Jesse) > > Signed-off-by: Jesse Barnes > Signed-off-by: Rodrigo Vivi > --- > drivers/gpu/drm/i915/i915_gem_gtt.c | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c > index ffa4bb3..264f2a6 100644 > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c > @@ -35,15 +35,6 @@ static void chv_setup_private_ppat(struct drm_i915_private *dev_priv); > > static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt) > { > - if (enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev)) > - return 0; > - > - if (enable_ppgtt == 1) > - return 1; > - > - if (enable_ppgtt == 2 && HAS_PPGTT(dev)) > - return 2; > - > #ifdef CONFIG_INTEL_IOMMU > /* Disable ppgtt on SNB if VT-d is on. */ > if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) { > @@ -59,10 +50,20 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt) > return 0; > } > > - if (HAS_PPGTT(dev)) > - return 2; > + if (!HAS_ALIASING_PPGTT(dev)) > + return 0; > > - return HAS_ALIASING_PPGTT(dev) ? 1 : 0; > + /* Check user passed enable_ppgtt param and try to honor it */ > + switch (enable_ppgtt) { > + case 0: > + return 0; > + case 1: > + return 1; /* caught any hw limits above */ > + case 2: > + /* fall through to auto-detect */ > + default: /* auto-detect */ > + return HAS_PPGTT(dev) ? 2 : 1; Same issue, so not going to merge for now. Until that's address I guess we can drop this. -Daniel > + } > } > > > -- > 1.9.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch