From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 04/13] drm/i915: Introduce i915_gem_object_finish_gtt() Date: Thu, 14 Apr 2011 18:12:13 +0200 Message-ID: <20110414161211.GB3408@viiv.ffwll.ch> References: <1302771827-26112-1-git-send-email-chris@chris-wilson.co.uk> <1302771827-26112-5-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 mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id AD5C69E897 for ; Thu, 14 Apr 2011 09:12:18 -0700 (PDT) Received: by wwb17 with SMTP id 17so1844571wwb.12 for ; Thu, 14 Apr 2011 09:12:17 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1302771827-26112-5-git-send-email-chris@chris-wilson.co.uk> 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: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Apr 14, 2011 at 10:03:38AM +0100, Chris Wilson wrote: > Like its siblings finish_gpu(), this function clears the object from the > GTT domain forcing it to be trigger a domain invalidation should we ever > need to use via the GTT again. > > Note that the most important side-effect of finishing the GTT domain > (aside from clearing the tracking read/write domains) is that it imposes > an memory barrier so that all accesses are complete before it returns, > which is important if you intend to be modifying translation tables > shortly afterwards. The second most important side-effect is that it > tears down the GTT mappings forcing a page-fault and invalidation on > next user access to the object. Our maze of cache handling functions, all alike is starting to get annoying. Especially these finish functions which are essentially two-way barriers and hence contain all the code that already exists in the from of flush_foo_write_domain. But every time I bang my head against this particular wall, the only thing I can come up with is some abomination from hell. And I've been tossing around ideas for the better part of a year already with no luck. Reviewed-by: Daniel Vetter -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48