From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Move flags describing VMA mappings into the VMA Date: Fri, 24 Oct 2014 16:43:08 +0200 Message-ID: <20141024144308.GE26941@phenom.ffwll.local> References: <1414150953-23764-1-git-send-email-tvrtko.ursulin@linux.intel.com> <20141024120908.GY13512@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by gabe.freedesktop.org (Postfix) with ESMTP id D02826E5D7 for ; Fri, 24 Oct 2014 07:42:59 -0700 (PDT) Received: by mail-wg0-f45.google.com with SMTP id l18so1268190wgh.16 for ; Fri, 24 Oct 2014 07:42:59 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20141024120908.GY13512@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Tvrtko Ursulin , Intel-gfx@lists.freedesktop.org, Tvrtko Ursulin List-Id: intel-gfx@lists.freedesktop.org On Fri, Oct 24, 2014 at 01:09:08PM +0100, Chris Wilson wrote: > On Fri, Oct 24, 2014 at 12:42:33PM +0100, Tvrtko Ursulin wrote: > > From: Tvrtko Ursulin > > > > If these flags are on the object level it will be more difficult to allow > > for multiple VMAs per object. > > > > v2: Simplification and cleanup after code review comments (Chris Wilson). > > > > Signed-off-by: Tvrtko Ursulin > > Cc: Chris Wilson > Reviewed-by: Chris Wilson > > > diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c > > index 053d99e..80f0c80 100644 > > --- a/drivers/gpu/drm/i915/i915_gpu_error.c > > +++ b/drivers/gpu/drm/i915/i915_gpu_error.c > > @@ -567,6 +567,7 @@ i915_error_object_create(struct drm_i915_private *dev_priv, > > struct i915_address_space *vm) > > { > > struct drm_i915_error_object *dst; > > + struct i915_vma *vma = NULL; > > int num_pages; > > bool use_ggtt; > > int i = 0; > > @@ -587,16 +588,17 @@ i915_error_object_create(struct drm_i915_private *dev_priv, > > dst->gtt_offset = -1; > > > > reloc_offset = dst->gtt_offset; > > + if (i915_is_ggtt(vm)) > > + vma = i915_gem_obj_to_ggtt(src); > > use_ggtt = (src->cache_level == I915_CACHE_NONE && > > - i915_is_ggtt(vm) && > > - src->has_global_gtt_mapping && > > - reloc_offset + num_pages * PAGE_SIZE <= dev_priv->gtt.mappable_end); > > + vma && (vma->bound & GLOBAL_BIND) && > > + reloc_offset + num_pages * PAGE_SIZE <= dev_priv->gtt.mappable_end); > > > > /* Cannot access stolen address directly, try to use the aperture */ > > if (src->stolen) { > > use_ggtt = true; > > > > - if (!src->has_global_gtt_mapping) > > + if (!(vma && vma->bound & GLOBAL_BIND)) > > goto unwind; > > This looked odd as I have the vma being passed in: > > static struct drm_i915_error_object * > i915_error_object_create(struct drm_i915_private *dev_priv, > struct i915_vma *vma); > > but I presume the ppgtt error-capture is still outstanding. Oh meh, this is probably one of those tasks that I've asked Jesse to close in one of the "fuck this all" rage-quits in the past few months ... Indeed both code and testcase seem to not have materialized afaics. Jesse? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch