From: Chris Wilson Subject: Re: [PATCH] drm/i915: allow stolen, pre-allocated objects to avoid GTT allocation Date: Wed, 8 May 2013 17:56:41 +0100 Message-ID: <20130508165641.GE22739@cantiga.alporthouse.com> References: <1368030989-4817-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id A2F7CE628F for ; Wed, 8 May 2013 09:56:45 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1368030989-4817-1-git-send-email-jbarnes@virtuousgeek.org> 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: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, May 08, 2013 at 09:36:29AM -0700, Jesse Barnes wrote: > In some cases, we may not need GTT address space allocated to a stolen > object, so allow passing -1 to the preallocated function to indicate as > much. > > Signed-off-by: Jesse Barnes > --- > drivers/gpu/drm/i915/i915_gem_stolen.c | 4 ++++ > drivers/gpu/drm/i915/intel_pm.c | 2 +- > 2 files changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c > index 9137fa4c..2e92861 100644 > --- a/drivers/gpu/drm/i915/i915_gem_stolen.c > +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c > @@ -360,6 +360,10 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev, > return NULL; > } > > + /* Some objects just need physical mem from stolen space */ > + if (gtt_offset == -1) For complete symmetry, we should do a list_add(&obj->gtt_list, &dev_priv->mm.unbound_list); but as these bo are irrelevant for the shrinker there are no immediate consequences. If we wanted to further complicate the code, we could exclude stolen objects from unbound tracking entirely. Not worth it. So as it stands, for completeness we should do the list_add here. Hmm, actually, _i915_gem_object_create_stolen() should do the list_add(unbound) and we should later do the list_move(bound) after reserving the GTT space. Ok, ignore all of this and Reviewed-by: Chris Wilson (replacing -1 with a fancy name if some one else bikesheds :) -Chris -- Chris Wilson, Intel Open Source Technology Centre