]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: optimize the shmem_pwrite slowpath handling
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 15 Nov 2012 15:53:58 +0000 (16:53 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 29 Nov 2012 12:49:08 +0000 (13:49 +0100)
commit0df2b7e9604c07aecfa7a9e54902b94384a96fc9
tree3650113cc42e2f2380b5a5f3123a913061e98489
parente9d6d6193d76a9789e7fe5ef56cff61634b2248a
drm/i915: optimize the shmem_pwrite slowpath handling

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 clarity (and adjust the comment
accordingly), suggested by Chris Wilson.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem.c