From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 2/3] drm/i915: Fix obj->map_and_fenceable for ppgtt Date: Sat, 9 Aug 2014 12:29:17 -0700 Message-ID: <20140809192916.GB508@intel.com> References: <1407602244-29463-1-git-send-email-chris@chris-wilson.co.uk> <1407602244-29463-2-git-send-email-chris@chris-wilson.co.uk> 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 400666E0F6 for ; Sat, 9 Aug 2014 12:27:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1407602244-29463-2-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, Aug 09, 2014 at 05:37:23PM +0100, Chris Wilson wrote: > With ppgtt, it is no longer correct to mark an object as > map_and_fenceable if we simply unbind it from the global gtt. This has > consequences during execbuffer where we simply use > obj->map_and_fenceable in use_cpu_reloc() to decide which access method > to use for writing into the object. Now for a ppgtt object, > map_and_fenceable will be true when it is not bound into the ggtt but > only in a ppgtt, leading to an invalid access on a non-llc architecture. The last sentence confused me for some reason. I think the first two sentences were perfectly succinct in describing the problem. > > v2: Revamp and resend to ease future patches. > > Signed-off-by: Chris Wilson > Cc: Ben Widawsky > Cc: Daniel Vetter I didn't read the patch closely, but the problem is clear. It seems like the one hunk: > - if (use_cpu_reloc(obj)) > + if (use_cpu_reloc(obj) || !i915_gem_obj_ggtt_bound(obj)) would be sufficient to fix the problem. I had a local solution at one point (I'm too lazy to check what I've sent out these days) where I turned map_and_fenceable into a getter(). I thought that looked pretty nice as well. lgtm [snip] -- Ben Widawsky, Intel Open Source Technology Center