From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 10/12] drm/i915: Allow ggtt lookups to not WARN Date: Tue, 26 Nov 2013 10:16:34 +0100 Message-ID: <20131126091634.GG27344@phenom.ffwll.local> References: <1385402083-8719-1-git-send-email-benjamin.widawsky@intel.com> <1385402083-8719-11-git-send-email-benjamin.widawsky@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 2700CFA481 for ; Tue, 26 Nov 2013 01:15:53 -0800 (PST) Received: by mail-ea0-f177.google.com with SMTP id n15so3260377ead.36 for ; Tue, 26 Nov 2013 01:15:53 -0800 (PST) Content-Disposition: inline In-Reply-To: <1385402083-8719-11-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 On Mon, Nov 25, 2013 at 09:54:41AM -0800, Ben Widawsky wrote: > To be able to effectively use the GGTT object lookup function, we don't > want to warn when there is no GGTT mapping. Let the caller deal with it > instead. > > Originally, I had intended to have this behavior, and has not > introduced the WARN. It was introduced during review with the addition > of the follow commit > > commit 5c2abbeab798154166d42fce4f71790caa6dd9bc > Author: Ben Widawsky > Date: Tue Sep 24 09:57:57 2013 -0700 > > drm/i915: Provide a cheap ggtt vma lookup > > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/i915_gem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index bc5c865..6388706 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -5069,7 +5069,7 @@ struct i915_vma *i915_gem_obj_to_ggtt(struct drm_i915_gem_object *obj) > return NULL; > > vma = list_first_entry(&obj->vma_list, typeof(*vma), vma_link); > - if (WARN_ON(vma->vm != obj_to_ggtt(obj))) > + if (vma->vm != obj_to_ggtt(obj)) Makes sense, but then please add a must_check annotation to this function. That will point you at the user in the context code which imo deserves a BUG_ON or similar. I guess we should also convert over the little ggtt helpers to use this function. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch