[Intel-gfx] [PATCH 2/7] drm/i915: Use GGTT view when (un)pinning objects to planes

Daniel Vetter daniel at ffwll.ch
Mon Mar 23 06:58:45 PDT 2015


On Mon, Mar 23, 2015 at 03:07:58PM +0200, Joonas Lahtinen wrote:
> On ma, 2015-03-23 at 11:10 +0000, Tvrtko Ursulin wrote:
> > @@ -4214,15 +4217,16 @@ i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj,
> >  }
> >  
> >  void
> > -i915_gem_object_ggtt_unpin(struct drm_i915_gem_object *obj)
> > +i915_gem_object_ggtt_unpin_view(struct drm_i915_gem_object *obj,
> > +				const struct i915_ggtt_view *view)
> >  {
> > -	struct i915_vma *vma = i915_gem_obj_to_ggtt(obj);
> > +	struct i915_vma *vma = i915_gem_obj_to_ggtt_view(obj, view);
> >  
> >  	BUG_ON(!vma);
> >  	BUG_ON(vma->pin_count == 0);
> > -	BUG_ON(!i915_gem_obj_ggtt_bound(obj));
> > +	BUG_ON(!i915_gem_obj_ggtt_bound_view(obj, view->type));

Just an side: I really don't like BUG_ON since it kills machines and makes
debugging needlessly harder. If you run into them and it's not guaranteed
that the kernel will oops anyway please convert to WARN_ON. I've done that
while applying (and left the !vma check as-is since that's the only one
taht catches a real oops).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the Intel-gfx mailing list