From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: optimize the shmem_pwrite slowpath handling Date: Thu, 29 Nov 2012 13:49:41 +0100 Message-ID: <20121129124941.GL3202@phenom.ffwll.local> References: <453bf0$6g3v6k@azsmga001.ch.intel.com> <1352994838-15156-1-git-send-email-daniel.vetter@ffwll.ch> 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 353DBE5FEA for ; Thu, 29 Nov 2012 04:48:17 -0800 (PST) Received: by mail-ea0-f177.google.com with SMTP id c10so3887752eaa.36 for ; Thu, 29 Nov 2012 04:48:16 -0800 (PST) Content-Disposition: inline In-Reply-To: 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: Daniel Vetter , Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Thu, Nov 15, 2012 at 04:07:45PM +0000, Chris Wilson wrote: > On Thu, 15 Nov 2012 16:53:58 +0100, Daniel Vetter wrote: > > Since we drop dev->struct_mutex when going through the slowpath, the > > object might have been moved out of the cpu domain. Hence we need to > > clflush the entire object to ensure that after the ioctl returns, > > everything is coherent again (interwoven writes are ill-defined > > anyway). > > > > But we only need to do this if we start in the cpu domain and the > > object requires flushing for coherency. So don't do the flushing if > > the object is coherent anyway or if we've done in-line clfushing > > already. > > > > v2: i915_gem_clflush_object already checks whether the object is > > coherent and if so, drops the flushing. Hence we don't need to check > > that ourselves, simplifying the condition. > > > > v3: Reorder the checks for better clarify (and adjust the comment > > accordingly), suggested by Chris Wilson. > > > > Signed-off-by: Daniel Vetter > > Yup, the comment makes much more sense now. > Reviewed-by: Chris Wilson Both patches merged to dinq, thanks a lot for the review comments. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch